From 3fb749a4e40fe65c82741ca2622c052707bfa3f7 Mon Sep 17 00:00:00 2001 From: zume0127 <790589151@qq.com> Date: Tue, 6 Dec 2022 22:50:13 +0800 Subject: [PATCH 001/178] Bug: Bad attempt to compute absolute value of signed 32-bit hashcode (#2151) * Bug: Bad attempt to compute absolute value of signed 32-bit hashcode * check code style --- .../impl/RoundRobinByNameJobShardingStrategy.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java index a3cb679d53..dfcf937026 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java @@ -38,7 +38,13 @@ public Map> sharding(final List jobInsta private List rotateServerList(final List shardingUnits, final String jobName) { int shardingUnitsSize = shardingUnits.size(); - int offset = Math.abs(jobName.hashCode()) % shardingUnitsSize; + int jobHashCode = jobName.hashCode(); + int offset = 0; + if (jobHashCode != Integer.MIN_VALUE) { + offset = Math.abs(jobHashCode) % shardingUnitsSize; + } else { + offset = Integer.MIN_VALUE % shardingUnitsSize; + } if (0 == offset) { return shardingUnits; } From 2fb71cf481121223b4ac95c437f8c66f5c6e71a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Tue, 6 Dec 2022 22:58:54 +0800 Subject: [PATCH 002/178] Revert "Bug: Bad attempt to compute absolute value of signed 32-bit hashcode (#2151)" (#2160) This reverts commit 3fb749a4e40fe65c82741ca2622c052707bfa3f7. --- .../impl/RoundRobinByNameJobShardingStrategy.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java index dfcf937026..a3cb679d53 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java @@ -38,13 +38,7 @@ public Map> sharding(final List jobInsta private List rotateServerList(final List shardingUnits, final String jobName) { int shardingUnitsSize = shardingUnits.size(); - int jobHashCode = jobName.hashCode(); - int offset = 0; - if (jobHashCode != Integer.MIN_VALUE) { - offset = Math.abs(jobHashCode) % shardingUnitsSize; - } else { - offset = Integer.MIN_VALUE % shardingUnitsSize; - } + int offset = Math.abs(jobName.hashCode()) % shardingUnitsSize; if (0 == offset) { return shardingUnits; } From 573dea4e16d5c43fbd264ffbe2ce7f0608e4b6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Mon, 12 Dec 2022 17:27:08 +0800 Subject: [PATCH 003/178] Avoid possible NPE in LegacyCrashedRunningItemListener (#2163) * Avoid possible NPE in LegacyCrashedRunningItemListener * Fix checkstyle * Complete tests --- .../lite/internal/failover/FailoverListenerManager.java | 2 +- .../internal/failover/FailoverListenerManagerTest.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java index f33d88e90e..afee2a8fb1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java @@ -154,7 +154,7 @@ public void onChange(final DataChangedEvent event) { } private boolean isCurrentInstanceOnline(final DataChangedEvent event) { - return Type.ADDED == event.getType() && event.getKey().endsWith(instanceNode.getLocalInstancePath()); + return Type.ADDED == event.getType() && !JobRegistry.getInstance().isShutdown(jobName) && event.getKey().endsWith(instanceNode.getLocalInstancePath()); } private boolean isTheOnlyInstance(final Set availableJobInstances) { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java index e2c7a8f78b..d9f72c6625 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java @@ -44,8 +44,10 @@ import java.util.LinkedHashMap; import java.util.Map; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) @@ -186,6 +188,7 @@ public void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathAndUpdateB @Test public void assertLegacyCrashedRunningItemListenerWhenRunningItemsArePresent() { JobInstance jobInstance = new JobInstance("127.0.0.1@-@1"); + JobRegistry.getInstance().registerJob("test_job", mock(JobScheduleController.class)); JobRegistry.getInstance().addJobInstance("test_job", jobInstance); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).build()); when(instanceNode.getLocalInstancePath()).thenReturn("instances/127.0.0.1@-@1"); @@ -203,4 +206,10 @@ public void assertLegacyCrashedRunningItemListenerWhenRunningItemsArePresent() { verify(executionService).clearRunningInfo(Collections.singletonList(0)); verify(failoverService).failoverIfNecessary(); } + + @Test + public void assertLegacyCrashedRunningItemListenerWhenJobInstanceAbsent() { + failoverListenerManager.new LegacyCrashedRunningItemListener().onChange(new DataChangedEvent(Type.ADDED, "", "")); + verifyNoInteractions(instanceNode); + } } From 1cbeacf2b3fdb440a0d2a9da7c1cbcf20118ff64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Mon, 12 Dec 2022 17:41:07 +0800 Subject: [PATCH 004/178] Avoid NPE in InstanceService.getAvailableJobInstances (#2164) --- .../lite/internal/instance/InstanceService.java | 9 +++++++-- .../lite/internal/instance/InstanceServiceTest.java | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceService.java index 0fb0c3baf1..1fe987b11a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceService.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceService.java @@ -69,9 +69,14 @@ public void removeInstance() { public List getAvailableJobInstances() { List result = new LinkedList<>(); for (String each : jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)) { - JobInstance jobInstance = YamlEngine.unmarshal(jobNodeStorage.getJobNodeData(instanceNode.getInstancePath(each)), JobInstance.class); + // TODO It's better to make it atomic + String jobNodeData = jobNodeStorage.getJobNodeData(instanceNode.getInstancePath(each)); + if (null == jobNodeData) { + continue; + } + JobInstance jobInstance = YamlEngine.unmarshal(jobNodeData, JobInstance.class); if (null != jobInstance && serverService.isEnableServer(jobInstance.getServerIp())) { - result.add(new JobInstance(each)); + result.add(jobInstance); } } return result; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java index 5bc3ee7d2f..2e7cd55de1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java @@ -79,6 +79,14 @@ public void assertGetAvailableJobInstances() { assertThat(instanceService.getAvailableJobInstances(), is(Collections.singletonList(new JobInstance("127.0.0.1@-@0")))); } + @Test + public void assertGetAvailableJobInstancesWhenInstanceRemoving() { + when(jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)).thenReturn(Arrays.asList("127.0.0.1@-@0", "127.0.0.2@-@0")); + when(jobNodeStorage.getJobNodeData("instances/127.0.0.1@-@0")).thenReturn("jobInstanceId: 127.0.0.1@-@0\nlabels: labels\nserverIp: 127.0.0.1\n"); + when(serverService.isEnableServer("127.0.0.1")).thenReturn(true); + assertThat(instanceService.getAvailableJobInstances(), is(Collections.singletonList(new JobInstance("127.0.0.1@-@0")))); + } + @Test public void assertIsLocalJobInstanceExisted() { when(jobNodeStorage.isJobNodeExisted("instances/127.0.0.1@-@0")).thenReturn(true); From 666b7c977f7a66789fd0fe15dcaf86fc0385a47d Mon Sep 17 00:00:00 2001 From: skai Date: Wed, 21 Dec 2022 16:55:30 +0800 Subject: [PATCH 005/178] Support annotation job (#2103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add annotation interface * add test * add JobAnnotationBuilder * complete JobAnntotationBuilder * Bootstarp support annotation job && add test * add License * fix bug * fix review problem * import `Optional` * fix bug * spring scan the elasticJobConfiguration * move to spring-core * add test * fix from review * fix again * Update elasticjob.xsd revert these format changes * Update JobScannerConfiguration.java simplified by @RequiredArgsConstructor * remove implements ResourceLoaderAware Co-authored-by: 蔡顺铠 Co-authored-by: skcai --- .../annotation/ElasticJobConfiguration.java | 161 ++++++++++++++++++ .../elasticjob/annotation/ElasticJobProp.java | 42 +++++ .../api/JobExtraConfigurationFactory.java | 32 ++++ .../ElasticJobConfigurationTest.java | 51 ++++++ .../SimpleTracingConfigurationFactory.java | 30 ++++ .../elasticjob/annotation/job/CustomJob.java | 31 ++++ .../annotation/job/impl/SimpleTestJob.java | 43 +++++ .../bootstrap/impl/OneOffJobBootstrap.java | 7 + .../bootstrap/impl/ScheduleJobBootstrap.java | 6 + .../annotation/JobAnnotationBuilder.java | 74 ++++++++ .../lite/fixture/job/AnnotationSimpleJob.java | 46 +++++ .../fixture/job/AnnotationUnShardingJob.java | 39 +++++ .../annotation/JobAnnotationBuilderTest.java | 54 ++++++ .../integrate/BaseAnnotationTest.java | 102 +++++++++++ .../integrate/OneOffEnabledJobTest.java | 64 +++++++ .../integrate/ScheduleEnabledJobTest.java | 66 +++++++ .../job/ElasticJobSpringBootScannerTest.java | 54 ++++++ .../fixture/job/impl/AnnotationCustomJob.java | 58 +++++++ .../core/scanner/ClassPathJobScanner.java | 85 +++++++++ .../spring/core/scanner/ElasticJobScan.java | 51 ++++++ .../core/scanner/ElasticJobScanRegistrar.java | 65 +++++++ .../core/scanner/JobScannerConfiguration.java | 55 ++++++ .../namespace/ElasticJobNamespaceHandler.java | 2 + .../JobScannerBeanDefinitionParser.java | 40 +++++ .../tag/JobScannerBeanDefinitionTag.java | 29 ++++ .../META-INF/namespace/elasticjob.xsd | 21 ++- .../job/annotation/AnnotationSimpleJob.java | 55 ++++++ .../AbstractJobSpringIntegrateTest.java | 65 +++++++ .../namespace/scanner/JobScannerTest.java | 28 +++ .../META-INF/scanner/jobScannerContext.xml | 36 ++++ 30 files changed, 1487 insertions(+), 5 deletions(-) create mode 100644 elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java create mode 100644 elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java create mode 100644 elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java create mode 100644 elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java create mode 100644 elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java create mode 100644 elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java create mode 100644 elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java create mode 100644 elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilder.java create mode 100644 elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationSimpleJob.java create mode 100644 elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationUnShardingJob.java create mode 100644 elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java create mode 100644 elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java create mode 100644 elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java create mode 100644 elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ClassPathJobScanner.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScan.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScanRegistrar.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/JobScannerConfiguration.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/JobScannerTest.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java new file mode 100644 index 0000000000..7b7e841f8a --- /dev/null +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java @@ -0,0 +1,161 @@ +/* + * 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.elasticjob.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; + +/** + * The annotation that specify a job of elastic. + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface ElasticJobConfiguration { + + /** + * Job name. + * @return jobName + */ + String jobName(); + + /** + * CRON expression, control the job trigger time. + * @return cron + */ + String cron() default ""; + + /** + * Time zone of CRON. + * @return timeZone + */ + String timeZone() default ""; + + + /** + * registry center name. + * @return registryCenter + */ + String registryCenter() default ""; + + /** + * Sharding total count. + * @return shardingTotalCount + */ + int shardingTotalCount(); + + /** + * Sharding item parameters. + * @return shardingItemParameters + */ + String shardingItemParameters() default ""; + + /** + * Job parameter. + * @return jobParameter + */ + String jobParameter() default ""; + + /** + * Monitor job execution status. + * @return monitorExecution + */ + boolean monitorExecution() default true; + + /** + * Enable or disable job failover. + * @return failover + */ + boolean failover() default false; + + /** + * Enable or disable the missed task to re-execute. + * @return misfire + */ + boolean misfire() default true; + + /** + * The maximum value for time difference between server and registry center in seconds. + * @return maxTimeDiffSeconds + */ + int maxTimeDiffSeconds() default -1; + + /** + * Service scheduling interval in minutes for repairing job server inconsistent state. + * @return reconcileIntervalMinutes + */ + int reconcileIntervalMinutes() default 10; + + /** + * Job sharding strategy type. + * @return jobShardingStrategyType + */ + String jobShardingStrategyType() default ""; + + /** + * Job thread pool handler type. + * @return jobExecutorServiceHandlerType + */ + String jobExecutorServiceHandlerType() default ""; + + /** + * Job thread pool handler type. + * @return jobErrorHandlerType + */ + String jobErrorHandlerType() default ""; + + /** + * Job listener types. + * @return jobListenerTypes + */ + String[] jobListenerTypes() default {}; + + /** + * extra configurations. + * @return extraConfigurations + */ + Class[] extraConfigurations() default {}; + + /** + * Job description. + * @return description + */ + String description() default ""; + + /** + * Job properties. + * @return props + */ + ElasticJobProp[] props() default {}; + + /** + * Enable or disable start the job. + * @return disabled + */ + boolean disabled() default false; + + /** + * Enable or disable local configuration override registry center configuration. + * @return overwrite + */ + boolean overwrite() default false; +} diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java new file mode 100644 index 0000000000..aa0d7904e4 --- /dev/null +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java @@ -0,0 +1,42 @@ +/* + * 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.elasticjob.annotation; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * The annotation that specify elastic-job prop. + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +public @interface ElasticJobProp { + + /** + * Prop key. + * @return key + */ + String key(); + + /** + * Prop value. + * @return value + */ + String value() default ""; +} diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java new file mode 100644 index 0000000000..8670ed93a2 --- /dev/null +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java @@ -0,0 +1,32 @@ +/* + * 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.elasticjob.api; + +import java.util.Optional; + +/** + * Job extra configuration factory. + */ +public interface JobExtraConfigurationFactory { + + /** + * Get JobExtraConfiguration. + * @return JobExtraConfiguration + */ + Optional getJobExtraConfiguration(); +} diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java new file mode 100644 index 0000000000..ecba0802e8 --- /dev/null +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java @@ -0,0 +1,51 @@ +/* + * 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.elasticjob.annotation; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertThat; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.Queue; +import org.apache.shardingsphere.elasticjob.annotation.job.impl.SimpleTestJob; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; +import org.junit.Test; + +public final class ElasticJobConfigurationTest { + + @Test + public void assertAnnotationJob() { + ElasticJobConfiguration annotation = SimpleTestJob.class.getAnnotation(ElasticJobConfiguration.class); + assertThat(annotation.jobName(), is("SimpleTestJob")); + assertThat(annotation.cron(), is("0/5 * * * * ?")); + assertThat(annotation.shardingTotalCount(), is(3)); + assertThat(annotation.shardingItemParameters(), is("0=Beijing,1=Shanghai,2=Guangzhou")); + for (Class factory :annotation.extraConfigurations()) { + assertThat(factory, is(SimpleTracingConfigurationFactory.class)); + } + assertArrayEquals(annotation.jobListenerTypes(), new String[] {"NOOP", "LOG"}); + Queue propsKey = new LinkedList<>(Arrays.asList("print.title", "print.content")); + Queue propsValue = new LinkedList<>(Arrays.asList("test title", "test content")); + for (ElasticJobProp prop :annotation.props()) { + assertThat(prop.key(), is(propsKey.poll())); + assertThat(prop.value(), is(propsValue.poll())); + } + } +} diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java new file mode 100644 index 0000000000..cbc0b8de20 --- /dev/null +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java @@ -0,0 +1,30 @@ +/* + * 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.elasticjob.annotation; + +import java.util.Optional; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; + +public final class SimpleTracingConfigurationFactory implements JobExtraConfigurationFactory { + + @Override + public Optional getJobExtraConfiguration() { + return Optional.empty(); + } +} diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java new file mode 100644 index 0000000000..fbad39c622 --- /dev/null +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java @@ -0,0 +1,31 @@ +/* + * 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.elasticjob.annotation.job; + +import org.apache.shardingsphere.elasticjob.api.ElasticJob; +import org.apache.shardingsphere.elasticjob.api.ShardingContext; + +public interface CustomJob extends ElasticJob { + + /** + * Execute custom job. + * + * @param shardingContext sharding context + */ + void execute(ShardingContext shardingContext); +} diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java new file mode 100644 index 0000000000..1c85c78328 --- /dev/null +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java @@ -0,0 +1,43 @@ +/* + * 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.elasticjob.annotation.job.impl; + +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; +import org.apache.shardingsphere.elasticjob.annotation.SimpleTracingConfigurationFactory; +import org.apache.shardingsphere.elasticjob.annotation.job.CustomJob; +import org.apache.shardingsphere.elasticjob.api.ShardingContext; + +@ElasticJobConfiguration( + cron = "0/5 * * * * ?", + jobName = "SimpleTestJob", + shardingTotalCount = 3, + shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou", + jobListenerTypes = {"NOOP", "LOG"}, + extraConfigurations = {SimpleTracingConfigurationFactory.class}, + props = { + @ElasticJobProp(key = "print.title", value = "test title"), + @ElasticJobProp(key = "print.content", value = "test content") + } +) +public final class SimpleTestJob implements CustomJob { + + @Override + public void execute(final ShardingContext shardingContext) { + } +} diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrap.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrap.java index a98a33e3ff..3423f2470e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrap.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrap.java @@ -22,6 +22,7 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.lite.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; @@ -47,6 +48,12 @@ public OneOffJobBootstrap(final CoordinatorRegistryCenter regCenter, final Strin instanceService = new InstanceService(regCenter, jobConfig.getJobName()); } + public OneOffJobBootstrap(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob) { + JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(elasticJob.getClass()); + jobScheduler = new JobScheduler(regCenter, elasticJob, jobConfig); + instanceService = new InstanceService(regCenter, jobConfig.getJobName()); + } + /** * Execute job. */ diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/ScheduleJobBootstrap.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/ScheduleJobBootstrap.java index bb491995e8..8d1f6cee98 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/ScheduleJobBootstrap.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/ScheduleJobBootstrap.java @@ -22,6 +22,7 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.lite.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; @@ -40,6 +41,11 @@ public ScheduleJobBootstrap(final CoordinatorRegistryCenter regCenter, final Str jobScheduler = new JobScheduler(regCenter, elasticJobType, jobConfig); } + public ScheduleJobBootstrap(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob) { + JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(elasticJob.getClass()); + jobScheduler = new JobScheduler(regCenter, elasticJob, jobConfig); + } + /** * Schedule job. */ diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilder.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilder.java new file mode 100644 index 0000000000..6353b9683b --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilder.java @@ -0,0 +1,74 @@ +/* + * 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.elasticjob.lite.internal.annotation; + +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import java.util.Optional; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; +import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; + +/** + * Job Builder from @ElasticJobConfiguration. + */ +public final class JobAnnotationBuilder { + + /** + * generate JobConfiguration from @ElasticJobConfiguration. + * @param type The job of @ElasticJobConfiguration annotation class + * @return JobConfiguration + */ + public static JobConfiguration generateJobConfiguration(final Class type) { + ElasticJobConfiguration annotation = type.getAnnotation(ElasticJobConfiguration.class); + Preconditions.checkArgument(null != annotation, "@ElasticJobConfiguration not found by class '%s'.", type); + Preconditions.checkArgument(!Strings.isNullOrEmpty(annotation.jobName()), "@ElasticJobConfiguration jobName could not be empty by class '%s'.", type); + JobConfiguration.Builder jobConfigurationBuilder = JobConfiguration.newBuilder(annotation.jobName(), annotation.shardingTotalCount()) + .shardingItemParameters(annotation.shardingItemParameters()) + .cron(Strings.isNullOrEmpty(annotation.cron()) ? null : annotation.cron()) + .timeZone(Strings.isNullOrEmpty(annotation.timeZone()) ? null : annotation.timeZone()) + .jobParameter(annotation.jobParameter()) + .monitorExecution(annotation.monitorExecution()) + .failover(annotation.failover()) + .misfire(annotation.misfire()) + .maxTimeDiffSeconds(annotation.maxTimeDiffSeconds()) + .reconcileIntervalMinutes(annotation.reconcileIntervalMinutes()) + .jobShardingStrategyType(Strings.isNullOrEmpty(annotation.jobShardingStrategyType()) ? null : annotation.jobShardingStrategyType()) + .jobExecutorServiceHandlerType(Strings.isNullOrEmpty(annotation.jobExecutorServiceHandlerType()) ? null : annotation.jobExecutorServiceHandlerType()) + .jobErrorHandlerType(Strings.isNullOrEmpty(annotation.jobErrorHandlerType()) ? null : annotation.jobErrorHandlerType()) + .jobListenerTypes(annotation.jobListenerTypes()) + .description(annotation.description()) + .disabled(annotation.disabled()) + .overwrite(annotation.overwrite()); + for (Class clazz : annotation.extraConfigurations()) { + try { + Optional jobExtraConfiguration = clazz.newInstance().getJobExtraConfiguration(); + jobExtraConfiguration.ifPresent(jobConfigurationBuilder::addExtraConfigurations); + } catch (IllegalAccessException | InstantiationException exception) { + throw (JobConfigurationException) new JobConfigurationException("new JobExtraConfigurationFactory instance by class '%s' failure", clazz).initCause(exception); + } + } + for (ElasticJobProp prop :annotation.props()) { + jobConfigurationBuilder.setProperty(prop.key(), prop.value()); + } + return jobConfigurationBuilder.build(); + } +} diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationSimpleJob.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationSimpleJob.java new file mode 100644 index 0000000000..6d3391568d --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationSimpleJob.java @@ -0,0 +1,46 @@ +/* + * 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.elasticjob.lite.fixture.job; + +import lombok.Getter; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; +import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; + +@Getter +@ElasticJobConfiguration( + jobName = "AnnotationSimpleJob", + description = "desc", + shardingTotalCount = 3, + shardingItemParameters = "0=a,1=b,2=c", + cron = "*/10 * * * * ?", + props = { + @ElasticJobProp(key = "print.title", value = "test title"), + @ElasticJobProp(key = "print.content", value = "test content") + } +) +public class AnnotationSimpleJob implements SimpleJob { + + private volatile boolean completed; + + @Override + public void execute(final ShardingContext shardingContext) { + completed = true; + } +} diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationUnShardingJob.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationUnShardingJob.java new file mode 100644 index 0000000000..aab19658bc --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationUnShardingJob.java @@ -0,0 +1,39 @@ +/* + * 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.elasticjob.lite.fixture.job; + +import lombok.Getter; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; + +@Getter +@ElasticJobConfiguration( + jobName = "AnnotationUnShardingJob", + description = "desc", + shardingTotalCount = 1 +) +public final class AnnotationUnShardingJob implements SimpleJob { + + private volatile boolean completed; + + @Override + public void execute(final ShardingContext shardingContext) { + completed = true; + } +} diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java new file mode 100644 index 0000000000..25b73e555b --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java @@ -0,0 +1,54 @@ +/* + * 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.elasticjob.lite.internal.annotation; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertTrue; + +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationSimpleJob; +import org.junit.Test; + +public final class JobAnnotationBuilderTest { + + @Test + public void assertGenerateJobConfiguration() { + JobConfiguration jobConfiguration = JobAnnotationBuilder.generateJobConfiguration(AnnotationSimpleJob.class); + assertThat(jobConfiguration.getJobName(), is("AnnotationSimpleJob")); + assertThat(jobConfiguration.getShardingTotalCount(), is(3)); + assertThat(jobConfiguration.getShardingItemParameters(), is("0=a,1=b,2=c")); + assertThat(jobConfiguration.getCron(), is("*/10 * * * * ?")); + assertTrue(jobConfiguration.isMonitorExecution()); + assertFalse(jobConfiguration.isFailover()); + assertTrue(jobConfiguration.isMisfire()); + assertThat(jobConfiguration.getMaxTimeDiffSeconds(), is(-1)); + assertThat(jobConfiguration.getReconcileIntervalMinutes(), is(10)); + assertNull(jobConfiguration.getJobShardingStrategyType()); + assertNull(jobConfiguration.getJobExecutorServiceHandlerType()); + assertNull(jobConfiguration.getJobErrorHandlerType()); + assertThat(jobConfiguration.getDescription(), is("desc")); + assertThat(jobConfiguration.getProps().getProperty("print.title"), is("test title")); + assertThat(jobConfiguration.getProps().getProperty("print.content"), is("test content")); + assertFalse(jobConfiguration.isDisabled()); + assertFalse(jobConfiguration.isOverwrite()); + } + +} diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java new file mode 100644 index 0000000000..bbc3e46cd3 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java @@ -0,0 +1,102 @@ +/* + * 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.elasticjob.lite.internal.annotation.integrate; + +import lombok.AccessLevel; +import lombok.Getter; +import org.apache.shardingsphere.elasticjob.api.ElasticJob; +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.lite.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.lite.internal.annotation.JobAnnotationBuilder; +import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; + +@Getter(AccessLevel.PROTECTED) +public abstract class BaseAnnotationTest { + + private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), "zkRegTestCenter"); + + @Getter(AccessLevel.PROTECTED) + private static final CoordinatorRegistryCenter REGISTRY_CENTER = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIG); + + private final ElasticJob elasticJob; + + private final JobConfiguration jobConfiguration; + + private final JobBootstrap jobBootstrap; + + private final LeaderService leaderService; + + private final String jobName; + + protected BaseAnnotationTest(final TestType type, final ElasticJob elasticJob) { + this.elasticJob = elasticJob; + jobConfiguration = JobAnnotationBuilder.generateJobConfiguration(elasticJob.getClass()); + jobName = jobConfiguration.getJobName(); + jobBootstrap = createJobBootstrap(type, elasticJob); + leaderService = new LeaderService(REGISTRY_CENTER, jobName); + } + + private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob elasticJob) { + switch (type) { + case SCHEDULE: + return new ScheduleJobBootstrap(REGISTRY_CENTER, elasticJob); + case ONE_OFF: + return new OneOffJobBootstrap(REGISTRY_CENTER, elasticJob); + default: + throw new RuntimeException(String.format("Cannot support `%s`", type)); + } + } + + @BeforeClass + public static void init() { + EmbedTestingServer.start(); + ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); + REGISTRY_CENTER.init(); + } + + @Before + public void setUp() { + if (jobBootstrap instanceof ScheduleJobBootstrap) { + ((ScheduleJobBootstrap) jobBootstrap).schedule(); + } else { + ((OneOffJobBootstrap) jobBootstrap).execute(); + } + } + + @After + public void tearDown() { + jobBootstrap.shutdown(); + ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); + } + + public enum TestType { + + SCHEDULE, ONE_OFF + } +} diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java new file mode 100644 index 0000000000..33bf40ef86 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -0,0 +1,64 @@ +/* + * 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.elasticjob.lite.internal.annotation.integrate; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationUnShardingJob; +import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.junit.Before; +import org.junit.Test; + +public final class OneOffEnabledJobTest extends BaseAnnotationTest { + + public OneOffEnabledJobTest() { + super(TestType.ONE_OFF, new AnnotationUnShardingJob()); + } + + @Before + public void assertEnabledRegCenterInfo() { + assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(1)); + assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); + JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); + assertThat(jobConfig.getShardingTotalCount(), is(1)); + assertNull(jobConfig.getCron()); + assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); + assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + getREGISTRY_CENTER().remove("/" + getJobName() + "/leader/election"); + assertTrue(getLeaderService().isLeaderUntilBlock()); + } + + @Test + public void assertJobInit() { + while (!((AnnotationUnShardingJob) getElasticJob()).isCompleted()) { + BlockUtils.waitingShortTime(); + } + assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); + } + +} diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java new file mode 100644 index 0000000000..d250341e3f --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -0,0 +1,66 @@ +/* + * 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.elasticjob.lite.internal.annotation.integrate; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.junit.Before; +import org.junit.Test; + +public final class ScheduleEnabledJobTest extends BaseAnnotationTest { + + public ScheduleEnabledJobTest() { + super(TestType.SCHEDULE, new AnnotationSimpleJob()); + } + + @Before + public void assertEnabledRegCenterInfo() { + assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); + assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); + JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); + assertThat(jobConfig.getShardingTotalCount(), is(3)); + assertThat(jobConfig.getCron(), is("*/10 * * * * ?")); + assertNull(jobConfig.getTimeZone()); + assertThat(jobConfig.getShardingItemParameters(), is("0=a,1=b,2=c")); + assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); + assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + getREGISTRY_CENTER().remove("/" + getJobName() + "/leader/election"); + assertTrue(getLeaderService().isLeaderUntilBlock()); + } + + @Test + public void assertJobInit() { + while (!((AnnotationSimpleJob) getElasticJob()).isCompleted()) { + BlockUtils.waitingShortTime(); + } + assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); + } + +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java new file mode 100644 index 0000000000..25b948701a --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -0,0 +1,54 @@ +/* + * 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.elasticjob.lite.spring.boot.job; + +import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl.AnnotationCustomJob; +import org.apache.shardingsphere.elasticjob.lite.spring.core.scanner.ElasticJobScan; +import org.junit.BeforeClass; +import org.junit.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +@SpringBootTest +@ActiveProfiles("elasticjob") +@ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl") +public class ElasticJobSpringBootScannerTest extends AbstractJUnit4SpringContextTests { + + @BeforeClass + public static void init() { + EmbedTestingServer.start(); + AnnotationCustomJob.reset(); + } + + @Test + public void assertDefaultBeanNameWithTypeJob() { + while (!AnnotationCustomJob.isCompleted()) { + BlockUtils.waitingShortTime(); + } + assertTrue(AnnotationCustomJob.isCompleted()); + assertNotNull(applicationContext); + assertNotNull(applicationContext.getBean("annotationCustomJobSchedule", ScheduleJobBootstrap.class)); + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java new file mode 100644 index 0000000000..dfaf75a85c --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java @@ -0,0 +1,58 @@ +/* + * 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.elasticjob.lite.spring.boot.job.fixture.job.impl; + +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; +import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.CustomJob; +import org.springframework.transaction.annotation.Transactional; + +@Slf4j +@Transactional(rollbackFor = Exception.class) +@ElasticJobConfiguration( + jobName = "annotationCustomJobSchedule", + description = "desc", + shardingTotalCount = 3, + shardingItemParameters = "0=a,1=b,2=c", + cron = "*/1 * * * * ?", + props = { + @ElasticJobProp(key = "print.title", value = "test title"), + @ElasticJobProp(key = "print.content", value = "test content") + } +) +public class AnnotationCustomJob implements CustomJob { + + @Getter + private static volatile boolean completed; + + @Override + public void execute(final ShardingContext shardingContext) { + log.info("AnnotationCustomJob execut"); + completed = true; + } + + /** + * Set completed to false. + */ + public static void reset() { + completed = false; + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ClassPathJobScanner.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ClassPathJobScanner.java new file mode 100644 index 0000000000..c8028ad097 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ClassPathJobScanner.java @@ -0,0 +1,85 @@ +/* + * 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.elasticjob.lite.spring.core.scanner; + +import org.apache.commons.lang3.StringUtils; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.springframework.beans.factory.config.BeanDefinitionHolder; +import org.springframework.beans.factory.config.RuntimeBeanReference; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.context.annotation.ClassPathBeanDefinitionScanner; +import org.springframework.context.annotation.ScannedGenericBeanDefinition; +import org.springframework.core.type.filter.AnnotationTypeFilter; + +import java.util.Objects; +import java.util.Set; + +/** + * A {@link ClassPathBeanDefinitionScanner} that registers ScheduleJobBootstrap by {@code basePackage}. + * + * @see ScheduleJobBootstrap + */ +public class ClassPathJobScanner extends ClassPathBeanDefinitionScanner { + + public ClassPathJobScanner(final BeanDefinitionRegistry registry) { + super(registry, false); + } + + /** + * Calls the parent search that will search and register all the candidates by {@code ElasticJobConfiguration}. + * + * @param basePackages the packages to check for annotated classes + */ + @Override + protected Set doScan(final String... basePackages) { + addIncludeFilter(new AnnotationTypeFilter(ElasticJobConfiguration.class)); + Set beanDefinitions = super.doScan(basePackages); + if (!beanDefinitions.isEmpty()) { + processBeanDefinitions(beanDefinitions); + } + return beanDefinitions; + } + + private void processBeanDefinitions(final Set beanDefinitions) { + BeanDefinitionRegistry registry = getRegistry(); + for (BeanDefinitionHolder holder : beanDefinitions) { + ScannedGenericBeanDefinition definition = (ScannedGenericBeanDefinition) holder.getBeanDefinition(); + Class jobClass; + try { + jobClass = Class.forName(definition.getMetadata().getClassName()); + } catch (ClassNotFoundException ex) { + //TODO: log + continue; + } + ElasticJobConfiguration jobAnnotation = jobClass.getAnnotation(ElasticJobConfiguration.class); + String registryCenter = jobAnnotation.registryCenter(); + BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(ScheduleJobBootstrap.class); + factory.setInitMethodName("schedule"); + if (!StringUtils.isEmpty(registryCenter)) { + factory.addConstructorArgReference(registryCenter); + } else { + factory.addConstructorArgValue(new RuntimeBeanReference(CoordinatorRegistryCenter.class)); + } + factory.addConstructorArgReference(Objects.requireNonNull(holder.getBeanName())); + registry.registerBeanDefinition(jobAnnotation.jobName(), factory.getBeanDefinition()); + } + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScan.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScan.java new file mode 100644 index 0000000000..8e9ad95987 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScan.java @@ -0,0 +1,51 @@ +/* + * 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.elasticjob.lite.spring.core.scanner; + +import org.springframework.context.annotation.Import; + +import java.lang.annotation.Documented; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import java.lang.annotation.RetentionPolicy; + +/** + * Use this annotation to register Elastic job. + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Import(ElasticJobScanRegistrar.class) +@Target(ElementType.TYPE) +public @interface ElasticJobScan { + + /** + * Alias for the {@link #basePackages()} attribute. + * + * @return Base packages name + */ + String[] value() default ""; + + /** + * Base packages to scan for Elastic job. + * + * @return Base packages name + */ + String[] basePackages() default {}; +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScanRegistrar.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScanRegistrar.java new file mode 100644 index 0000000000..5183bae7f2 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScanRegistrar.java @@ -0,0 +1,65 @@ +/* + * 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.elasticjob.lite.spring.core.scanner; + +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; +import org.springframework.core.annotation.AnnotationAttributes; +import org.springframework.core.type.AnnotationMetadata; +import org.springframework.util.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * A {@link ImportBeanDefinitionRegistrar} to allow annotation configuration of Elastic Job scanning. + * + * @see ClassPathJobScanner + */ +public class ElasticJobScanRegistrar implements ImportBeanDefinitionRegistrar { + + @Override + public void registerBeanDefinitions(final AnnotationMetadata importingClassMetadata, + final BeanDefinitionRegistry registry) { + AnnotationAttributes elasticJobScanAttrs = + AnnotationAttributes.fromMap(importingClassMetadata.getAnnotationAttributes(ElasticJobScan.class.getName())); + if (elasticJobScanAttrs != null) { + registerBeanDefinitions(importingClassMetadata, elasticJobScanAttrs, registry); + } + } + + private void registerBeanDefinitions(final AnnotationMetadata annoMeta, final AnnotationAttributes annoAttrs, + final BeanDefinitionRegistry registry) { + BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(JobScannerConfiguration.class); + + List basePackages = new ArrayList<>(); + basePackages.addAll(Arrays.stream(annoAttrs.getStringArray("value")).filter(StringUtils::hasText) + .collect(Collectors.toList())); + basePackages.addAll(Arrays.stream(annoAttrs.getStringArray("basePackages")).filter(StringUtils::hasText) + .collect(Collectors.toList())); + factory.addConstructorArgValue(basePackages); + registry.registerBeanDefinition(generateBaseBeanName(annoMeta), factory.getBeanDefinition()); + } + + private static String generateBaseBeanName(final AnnotationMetadata importingClassMetadata) { + return importingClassMetadata.getClassName() + "#" + ElasticJobScanRegistrar.class.getSimpleName(); + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/JobScannerConfiguration.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/JobScannerConfiguration.java new file mode 100644 index 0000000000..9cd890da40 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/JobScannerConfiguration.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.elasticjob.lite.spring.core.scanner; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; +import org.springframework.util.Assert; + +/** + * BeanDefinitionRegistryPostProcessor that searches recursively starting from a base package for interfaces. + * + */ +@Getter +@RequiredArgsConstructor +public class JobScannerConfiguration implements BeanDefinitionRegistryPostProcessor, InitializingBean { + + private final String[] basePackages; + + @Override + public void afterPropertiesSet() { + Assert.notNull(this.basePackages, "Property 'basePackage' is required"); + } + + @Override + public void postProcessBeanFactory(final ConfigurableListableBeanFactory beanFactory) throws BeansException { + // left intentionally blank + } + + @Override + public void postProcessBeanDefinitionRegistry(final BeanDefinitionRegistry registry) throws BeansException { + ClassPathJobScanner classPathJobScanner = new ClassPathJobScanner(registry); + classPathJobScanner.scan(basePackages); + } + +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/ElasticJobNamespaceHandler.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/ElasticJobNamespaceHandler.java index 374746bf52..d57ba6205d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/ElasticJobNamespaceHandler.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/ElasticJobNamespaceHandler.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner.parser.JobScannerBeanDefinitionParser; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.job.parser.JobBeanDefinitionParser; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.reg.parser.ZookeeperBeanDefinitionParser; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot.parser.SnapshotBeanDefinitionParser; @@ -34,5 +35,6 @@ public void init() { registerBeanDefinitionParser("zookeeper", new ZookeeperBeanDefinitionParser()); registerBeanDefinitionParser("snapshot", new SnapshotBeanDefinitionParser()); registerBeanDefinitionParser("rdb-tracing", new TracingBeanDefinitionParser()); + registerBeanDefinitionParser("job-scanner", new JobScannerBeanDefinitionParser()); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java new file mode 100644 index 0000000000..f7359d63a1 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java @@ -0,0 +1,40 @@ +/* + * 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.elasticjob.lite.spring.namespace.scanner.parser; + +import org.apache.shardingsphere.elasticjob.lite.spring.core.scanner.JobScannerConfiguration; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner.tag.JobScannerBeanDefinitionTag; +import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.w3c.dom.Element; + +/** + * Job scanner bean definition parser. + */ +public final class JobScannerBeanDefinitionParser extends AbstractBeanDefinitionParser { + + @Override + protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) { + BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(JobScannerConfiguration.class); + String attribute = element.getAttribute(JobScannerBeanDefinitionTag.BASE_PACKAGE); + factory.addConstructorArgValue(attribute); + return factory.getBeanDefinition(); + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java new file mode 100644 index 0000000000..859756eea4 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java @@ -0,0 +1,29 @@ +/* + * 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.elasticjob.lite.spring.namespace.scanner.tag; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +/** + * Job scanner bean definition tag. + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public class JobScannerBeanDefinitionTag { + public static final String BASE_PACKAGE = "base-package"; +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd index ef91aba382..308a8e4607 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd @@ -21,8 +21,19 @@ xmlns:beans="http://www.springframework.org/schema/beans" targetNamespace="http://shardingsphere.apache.org/schema/elasticjob" elementFormDefault="qualified"> - - + + + + + + + + + + + + @@ -57,7 +68,7 @@ - + @@ -74,7 +85,7 @@ - + @@ -84,7 +95,7 @@ - + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java new file mode 100644 index 0000000000..28da7b8154 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.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.elasticjob.lite.spring.namespace.fixture.job.annotation; + +import lombok.Getter; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; +import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; + +@Getter +@ElasticJobConfiguration( + jobName = "simpleJob", + registryCenter = "regCenter", + description = "desc", + shardingTotalCount = 3, + shardingItemParameters = "0=a,1=b,2=c", + cron = "*/1 * * * * ?", + props = { + @ElasticJobProp(key = "print.title", value = "test title"), + @ElasticJobProp(key = "print.content", value = "test content") + } +) +public final class AnnotationSimpleJob implements SimpleJob { + + @Getter + private static volatile boolean completed; + + @Override + public void execute(final ShardingContext shardingContext) { + completed = true; + } + + /** + * Set completed to false. + */ + public static void reset() { + completed = false; + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java new file mode 100644 index 0000000000..5cc4ffdf24 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -0,0 +1,65 @@ +/* + * 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.elasticjob.lite.spring.namespace.scanner; + +import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import static org.junit.Assert.assertTrue; + +@RequiredArgsConstructor +public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJUnit4SpringContextTests { + + private final String simpleJobName; + + @Autowired + private CoordinatorRegistryCenter regCenter; + + @Before + @After + public void reset() { + AnnotationSimpleJob.reset(); + } + + @After + public void tearDown() { + JobRegistry.getInstance().shutdown(simpleJobName); + } + + @Test + public void assertSpringJobBean() { + assertSimpleElasticJobBean(); + } + + private void assertSimpleElasticJobBean() { + while (!AnnotationSimpleJob.isCompleted()) { + BlockUtils.waitingShortTime(); + } + assertTrue(AnnotationSimpleJob.isCompleted()); + assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding")); + } + +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/JobScannerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/JobScannerTest.java new file mode 100644 index 0000000000..d61d106bfa --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/JobScannerTest.java @@ -0,0 +1,28 @@ +/* + * 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.elasticjob.lite.spring.namespace.scanner; + +import org.springframework.test.context.ContextConfiguration; + +@ContextConfiguration(locations = "classpath:META-INF/scanner/jobScannerContext.xml") +public final class JobScannerTest extends AbstractJobSpringIntegrateTest { + + public JobScannerTest() { + super("simpleJob"); + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml new file mode 100644 index 0000000000..fde581aaae --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml @@ -0,0 +1,36 @@ + + + + + + + + + + From 642c8c909015b405c4e276de272b3d873af2922e Mon Sep 17 00:00:00 2001 From: songxiulu Date: Thu, 22 Dec 2022 20:47:47 +0800 Subject: [PATCH 006/178] fix conflict job class check error (#2167) Co-authored-by: songxiulu --- .../elasticjob/lite/internal/config/ConfigurationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java index 07eade08bd..8b89be15d5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.config; +import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; @@ -85,7 +86,7 @@ private void checkConflictJob(final String newJobClassName, final JobConfigurati return; } String originalJobClassName = jobNodeStorage.getJobRootNodeData(); - if (null != originalJobClassName && !originalJobClassName.equals(newJobClassName)) { + if (StringUtils.isNotBlank(originalJobClassName) && !originalJobClassName.equals(newJobClassName)) { throw new JobConfigurationException( "Job conflict with register center. The job '%s' in register center's class is '%s', your job class is '%s'", jobConfig.getJobName(), originalJobClassName, newJobClassName); } From 8b54bba845c6c6e4a4e30a19c0cd222f704a2c3b Mon Sep 17 00:00:00 2001 From: songxiulu Date: Tue, 17 Jan 2023 18:49:12 +0800 Subject: [PATCH 007/178] [ISSUE #2142]add distributed lock to avoid onceListener invoke multi times (#2168) * add distributed lock to avoid onceListener invoke multi times * use execute in leader method * change Tests * remove unused log * add sleep time to avoid test server stop by other thread. * update test Co-authored-by: songxiulu --- ...tractDistributeOnceElasticJobListener.java | 6 +- .../internal/guarantee/GuaranteeNode.java | 4 + .../internal/guarantee/GuaranteeService.java | 94 ++++++++++++++++--- .../DistributeOnceElasticJobListenerTest.java | 6 +- .../guarantee/GuaranteeServiceTest.java | 41 ++++++++ .../boot/job/fixture/EmbedTestingServer.java | 6 +- 6 files changed, 137 insertions(+), 20 deletions(-) diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java index 4e72e3be64..e5f287fffd 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java @@ -61,8 +61,7 @@ public final void beforeJobExecuted(final ShardingContexts shardingContexts) { BlockUtils.waitingShortTime(); } if (guaranteeService.isAllStarted()) { - doBeforeJobExecutedAtLastStarted(shardingContexts); - guaranteeService.clearAllStartedInfo(); + guaranteeService.executeInLeaderForLastStarted(this, shardingContexts); return; } long before = timeService.getCurrentMillis(); @@ -90,8 +89,7 @@ public final void afterJobExecuted(final ShardingContexts shardingContexts) { BlockUtils.waitingShortTime(); } if (guaranteeService.isAllCompleted()) { - doAfterJobExecutedAtLastCompleted(shardingContexts); - guaranteeService.clearAllCompletedInfo(); + guaranteeService.executeInLeaderForLastCompleted(this, shardingContexts); return; } long before = timeService.getCurrentMillis(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNode.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNode.java index f4edb89880..e9efa9cd91 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNode.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNode.java @@ -29,6 +29,10 @@ public final class GuaranteeNode { static final String STARTED_ROOT = ROOT + "/started"; static final String COMPLETED_ROOT = ROOT + "/completed"; + + static final String STARTED_LATCH_ROOT = ROOT + "/started-latch"; + + static final String COMPLETED_LATCH_ROOT = ROOT + "/completed-latch"; private final JobNodePath jobNodePath; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeService.java index fe6b5a9036..0a9d94e52a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeService.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeService.java @@ -17,9 +17,13 @@ package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; +import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import java.util.Collection; @@ -27,16 +31,16 @@ * Guarantee service. */ public final class GuaranteeService { - + private final JobNodeStorage jobNodeStorage; - + private final ConfigurationService configService; - + public GuaranteeService(final CoordinatorRegistryCenter regCenter, final String jobName) { jobNodeStorage = new JobNodeStorage(regCenter, jobName); configService = new ConfigurationService(regCenter, jobName); } - + /** * Register start. * @@ -47,7 +51,7 @@ public void registerStart(final Collection shardingItems) { jobNodeStorage.createJobNodeIfNeeded(GuaranteeNode.getStartedNode(each)); } } - + /** * Judge whether current sharding items are all register start success. * @@ -62,7 +66,7 @@ public boolean isRegisterStartSuccess(final Collection shardingItems) { } return true; } - + /** * Judge whether job's sharding items are all started. * @@ -72,14 +76,14 @@ public boolean isAllStarted() { return jobNodeStorage.isJobNodeExisted(GuaranteeNode.STARTED_ROOT) && configService.load(false).getShardingTotalCount() == jobNodeStorage.getJobNodeChildrenKeys(GuaranteeNode.STARTED_ROOT).size(); } - + /** * Clear all started job's info. */ public void clearAllStartedInfo() { jobNodeStorage.removeJobNodeIfExisted(GuaranteeNode.STARTED_ROOT); } - + /** * Register complete. * @@ -90,7 +94,7 @@ public void registerComplete(final Collection shardingItems) { jobNodeStorage.createJobNodeIfNeeded(GuaranteeNode.getCompletedNode(each)); } } - + /** * Judge whether sharding items are register complete success. * @@ -105,7 +109,7 @@ public boolean isRegisterCompleteSuccess(final Collection shardingItems } return true; } - + /** * Judge whether job's sharding items are all completed. * @@ -115,11 +119,79 @@ public boolean isAllCompleted() { return jobNodeStorage.isJobNodeExisted(GuaranteeNode.COMPLETED_ROOT) && configService.load(false).getShardingTotalCount() <= jobNodeStorage.getJobNodeChildrenKeys(GuaranteeNode.COMPLETED_ROOT).size(); } - + /** * Clear all completed job's info. */ public void clearAllCompletedInfo() { jobNodeStorage.removeJobNodeIfExisted(GuaranteeNode.COMPLETED_ROOT); } + + /** + * Invoke doBeforeJobExecutedAtLastStarted method once after last started. + * + * @param listener AbstractDistributeOnceElasticJobListener instance + * @param shardingContexts sharding contexts + */ + public void executeInLeaderForLastStarted(final AbstractDistributeOnceElasticJobListener listener, + final ShardingContexts shardingContexts) { + jobNodeStorage.executeInLeader(GuaranteeNode.STARTED_LATCH_ROOT, + new LeaderExecutionCallbackForLastStarted(listener, shardingContexts)); + } + + /** + * Invoke doAfterJobExecutedAtLastCompleted method once after last completed. + * + * @param listener AbstractDistributeOnceElasticJobListener instance + * @param shardingContexts sharding contexts + */ + public void executeInLeaderForLastCompleted(final AbstractDistributeOnceElasticJobListener listener, + final ShardingContexts shardingContexts) { + jobNodeStorage.executeInLeader(GuaranteeNode.COMPLETED_LATCH_ROOT, + new LeaderExecutionCallbackForLastCompleted(listener, shardingContexts)); + } + + /** + * Inner class for last started callback. + */ + @RequiredArgsConstructor + class LeaderExecutionCallbackForLastStarted implements LeaderExecutionCallback { + private final AbstractDistributeOnceElasticJobListener listener; + + private final ShardingContexts shardingContexts; + + @Override + public void execute() { + try { + if (!isAllStarted()) { + return; + } + listener.doBeforeJobExecutedAtLastStarted(shardingContexts); + } finally { + clearAllStartedInfo(); + } + } + } + + /** + * Inner class for last completed callback. + */ + @RequiredArgsConstructor + class LeaderExecutionCallbackForLastCompleted implements LeaderExecutionCallback { + private final AbstractDistributeOnceElasticJobListener listener; + + private final ShardingContexts shardingContexts; + + @Override + public void execute() { + try { + if (!isAllCompleted()) { + return; + } + listener.doAfterJobExecutedAtLastCompleted(shardingContexts); + } finally { + clearAllCompletedInfo(); + } + } + } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java index 549daef62b..a8f778738a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java @@ -72,8 +72,7 @@ public void assertBeforeJobExecutedWhenIsAllStarted() { when(guaranteeService.isAllStarted()).thenReturn(true); distributeOnceElasticJobListener.beforeJobExecuted(shardingContexts); verify(guaranteeService).registerStart(Sets.newHashSet(0, 1)); - verify(elasticJobListenerCaller).before(); - verify(guaranteeService).clearAllStartedInfo(); + verify(guaranteeService).executeInLeaderForLastStarted(distributeOnceElasticJobListener, shardingContexts); } @Test @@ -102,8 +101,7 @@ public void assertAfterJobExecutedWhenIsAllCompleted() { when(guaranteeService.isAllCompleted()).thenReturn(true); distributeOnceElasticJobListener.afterJobExecuted(shardingContexts); verify(guaranteeService).registerComplete(Sets.newHashSet(0, 1)); - verify(elasticJobListenerCaller).after(); - verify(guaranteeService).clearAllCompletedInfo(); + verify(guaranteeService).executeInLeaderForLastCompleted(distributeOnceElasticJobListener, shardingContexts); } @Test diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java index dba900fd71..1e9c223cdf 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java @@ -18,6 +18,8 @@ package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; @@ -31,6 +33,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -42,6 +45,12 @@ public final class GuaranteeServiceTest { @Mock private ConfigurationService configService; + + @Mock + private AbstractDistributeOnceElasticJobListener listener; + + @Mock + private ShardingContexts shardingContexts; private final GuaranteeService guaranteeService = new GuaranteeService(null, "test_job"); @@ -143,4 +152,36 @@ public void assertClearAllCompletedInfo() { guaranteeService.clearAllCompletedInfo(); verify(jobNodeStorage).removeJobNodeIfExisted("guarantee/completed"); } + + @Test + public void assertExecuteInLeaderForLastCompleted() { + when(jobNodeStorage.isJobNodeExisted("guarantee/completed")).thenReturn(true); + when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); + when(jobNodeStorage.getJobNodeChildrenKeys("guarantee/completed")).thenReturn(Arrays.asList("0", "1", "2")); + guaranteeService.new LeaderExecutionCallbackForLastCompleted(listener, shardingContexts).execute(); + verify(listener).doAfterJobExecutedAtLastCompleted(shardingContexts); + } + + @Test + public void assertExecuteInLeaderForNotLastCompleted() { + when(jobNodeStorage.isJobNodeExisted("guarantee/completed")).thenReturn(false); + guaranteeService.new LeaderExecutionCallbackForLastCompleted(listener, shardingContexts).execute(); + verify(listener, never()).doAfterJobExecutedAtLastCompleted(shardingContexts); + } + + @Test + public void assertExecuteInLeaderForLastStarted() { + when(jobNodeStorage.isJobNodeExisted("guarantee/started")).thenReturn(true); + when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); + when(jobNodeStorage.getJobNodeChildrenKeys("guarantee/started")).thenReturn(Arrays.asList("0", "1", "2")); + guaranteeService.new LeaderExecutionCallbackForLastStarted(listener, shardingContexts).execute(); + verify(listener).doBeforeJobExecutedAtLastStarted(shardingContexts); + } + + @Test + public void assertExecuteInLeaderForNotLastStarted() { + when(jobNodeStorage.isJobNodeExisted("guarantee/started")).thenReturn(false); + guaranteeService.new LeaderExecutionCallbackForLastStarted(listener, shardingContexts).execute(); + verify(listener, never()).doBeforeJobExecutedAtLastStarted(shardingContexts); + } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java index 799202d30f..aa97974ea2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java @@ -20,6 +20,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.curator.test.TestingServer; +import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; import java.io.File; @@ -45,6 +46,9 @@ public static String getConnectionString() { * Start the server. */ public static void start() { + // sleep some time to avoid testServer intended stop. + long sleepTime = 1000L; + BlockUtils.sleep(sleepTime); if (null != testingServer) { return; } @@ -57,7 +61,7 @@ public static void start() { } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { - Thread.sleep(1000); + Thread.sleep(sleepTime); testingServer.close(); } catch (final IOException | InterruptedException ex) { RegExceptionHandler.handleException(ex); From bf9bf756c0c8c0a05d48d91e0907f4509a535741 Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sat, 28 Jan 2023 16:23:19 +0800 Subject: [PATCH 008/178] Remove when entries for mockito that are not used in unit tests (#2179) --- .../lite/internal/failover/FailoverServiceTest.java | 5 +++-- .../lite/internal/sharding/ExecutionServiceTest.java | 5 +++-- .../lite/internal/sharding/ShardingServiceTest.java | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java index a346a72bab..d946078d45 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java @@ -40,11 +40,12 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@RunWith(MockitoJUnitRunner.StrictStubs.class) public final class FailoverServiceTest { @Mock @@ -253,7 +254,7 @@ public void assertGetAllFailoveringItems() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).build()); String jobInstanceId = "127.0.0.1@-@1"; when(jobNodeStorage.getJobNodeData("sharding/0/failovering")).thenReturn(jobInstanceId); - when(jobNodeStorage.getJobNodeData("sharding/2/failovering")).thenReturn(jobInstanceId); + lenient().when(jobNodeStorage.getJobNodeData("sharding/2/failovering")).thenReturn(jobInstanceId); Map actual = failoverService.getAllFailoveringItems(); assertThat(actual.size(), is(2)); assertThat(actual.get(0), is(new JobInstance(jobInstanceId))); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java index 2f88cd353c..aeed473fa7 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java @@ -41,11 +41,12 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@RunWith(MockitoJUnitRunner.StrictStubs.class) public final class ExecutionServiceTest { @Mock @@ -181,7 +182,7 @@ public void assertGetAllRunningItems() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).build()); String jobInstanceId = "127.0.0.1@-@1"; when(jobNodeStorage.getJobNodeData("sharding/0/running")).thenReturn(jobInstanceId); - when(jobNodeStorage.getJobNodeData("sharding/2/running")).thenReturn(jobInstanceId); + lenient().when(jobNodeStorage.getJobNodeData("sharding/2/running")).thenReturn(jobInstanceId); Map actual = executionService.getAllRunningItems(); assertThat(actual.size(), is(2)); assertThat(actual.get(0), is(new JobInstance(jobInstanceId))); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java index 2a353669e9..75b38b9f18 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java @@ -44,11 +44,12 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.any; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@RunWith(MockitoJUnitRunner.StrictStubs.class) public final class ShardingServiceTest { @Mock @@ -252,7 +253,7 @@ public void assertGetCrashedShardingItemsWithEnabledServer() { when(jobNodeStorage.getJobNodeData("sharding/0/instance")).thenReturn("127.0.0.1@-@0"); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(true); when(jobNodeStorage.getJobNodeData("sharding/2/instance")).thenReturn("127.0.0.1@-@0"); - when(jobNodeStorage.isJobNodeExisted("sharding/2/running")).thenReturn(true); + lenient().when(jobNodeStorage.isJobNodeExisted("sharding/2/running")).thenReturn(true); assertThat(shardingService.getCrashedShardingItems("127.0.0.1@-@0"), is(Arrays.asList(0, 2))); JobRegistry.getInstance().shutdown("test_job"); } From f2a73a89e8290a04bcd4d9751a1948bd0e02e7dc Mon Sep 17 00:00:00 2001 From: davidChan3000 <5009523+davidChan3000@users.noreply.github.com> Date: Wed, 22 Feb 2023 15:37:19 +0800 Subject: [PATCH 009/178] feat:modify logo url (#2186) Co-authored-by: davidChan3000 --- docs/layouts/partials/logo.html | 2 +- docs/static/img/elasticjob-orange.png | Bin 0 -> 10125 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 docs/static/img/elasticjob-orange.png diff --git a/docs/layouts/partials/logo.html b/docs/layouts/partials/logo.html index 958ea9a80f..a4180e24a6 100644 --- a/docs/layouts/partials/logo.html +++ b/docs/layouts/partials/logo.html @@ -7,5 +7,5 @@ * @FilePath: /discourse/Users/david/Documents/expmle/shardingsphere-elasticjob/docs/layouts/partials/logo.html --> - + diff --git a/docs/static/img/elasticjob-orange.png b/docs/static/img/elasticjob-orange.png new file mode 100644 index 0000000000000000000000000000000000000000..a1007a54736c0e521c92fd3f55eebc2d51ea2f29 GIT binary patch literal 10125 zcmYLvcRbtQ_kR+xVvnE{p{Y$#iW*JTNNj3U&Dv_$s?|!B8b!q3wW(F3_AIqGHLLcj zS)*3VFW&n3{_@8wc|2bCZ}8n+tg>gI)_*y&$VGn-J zjp>pc1NagFm;j%+Nss33F;eAFR6!nOFH)XPG5QbLV)VCaMV~M3ncdu1bH?~nbHySY zz$4X{Ma7B3Ur7YBRJ-DOWTS+Mnv0vZcWHCfd!Kv81-MCnu$SGEaHK=SL$hilwi6bP2y~) zK?5d&1$qA(cIyk9dClRHs!@+Hk48YQjiO^bLEswNe)+q1r z-{Gxo1PPAAC7-1h^*@|8%(f}GJZY|ZngoICnVmIU*$+Y7t^lh+WEP*_dOOD(EUFYp zA=1YNU=dMRJxPD|V*V#{Xz`bx0d8{1Is|T~efHs6P)-S!kH|#W118CgJf_`) z0MdfFVzTRhP1bm41xp_QK|B~R>^U`V3f!_aBtfm<5!Ct4IcDY5gwrNQ-j$j7S2~?9(DW z{@ClaFVpN%BZ2KvN6a=)%T_2g(AwnIe?$KnRK7(ShH_ZR<3A_EOa3Vu+AGc_#)DZb zr0I{k9`Tm5g$~KtT;(y;!i(m6CB+0c5F&UM{ch`>WI$)fd@gVjA=n9c8EjM6>(u;; zlFR21m5&H*3Ka>sHYTM%05`*|sk*_j-W;<7K3BXamQFAGW(pZrQ3xWr`$Zl80ffTl z=H^_xvpd^7A7))^eE92L^zQ6)q7(aC*RgP_m;kN>pQz=Q#g9Bk0#yvfPY<%M#|wZ{ z@JDRxkB9-|Ml!;u_TKVDi@JTB&(f<5+$0LWq2`5rT5H@zPSYT8;?Sg^>qU))`$r@8 z!zI~WEL!Z_eG~b-y86EEsn3Lp06Gg(FVw3BC$=S^NcTda{!;21wfWcE^_!|KuSc5& zJkQR16md=>2^t55FzVxB8Wf96nA@qK?{5(ewPbnCqB|EdlCk`Iy6tkadO?(w#5RA!MvDNead{q(;AtFB!=dojVU)z0b{h#jQm$Y)4Iac z(!tO)973VxZ=2r6G{lcnrnld8712NCAu18WUn$Es3W%$Z02?lH7WndDe?I9=S}P}_ zg}^5gQVed0t*-Rcm)2WCyN)G!i0G7IIrYNt=$iov?(Mt1R0O88PI zNsmlie@zN-BcS(Dw9-t*i91Zwhorodw_W)=yDBNOu~~l##$nM?Z&x+>-w2a3nu8|G zqS5md7gOC+-%Sr-?RKf#nc+j8P~K|1V-adCbSnX?CWI!$rKd;;IbnB8mxVUn#oBg{ z5vVMYGL~yDcf;j_7n~}cL1Tt2357kHQye=YD=uu z=_*UeB1Q$xpkV6Mo`$`X@uq4~(809RR9|>L1TJRm?suOYz3g@LxL=k{b_S9+_ZVG? z0EH0H;;l;eQrdl=6eoLxul1b;UZ5OnH1p;Pw~l;e2++%$At`Gz@6B~mT&}>C7*4UP zDY8>m&e$R4DUcGu&cUJ+a;sb#icFz<((K7jh4cX+T-+N>!Z|-TfYzG7ZX9dF_=6Gq zLge-w$MKgwFB!hr^dh4l|4sm-MY8T6ba@0fVyw)PaUO12A{imz1vVDs8^7MQ4&h>f`v&{mmKyvPJDuNW$ zJ@Lb#{SW)M+B<_N-LQ7uU;~jtjcSiFmqF>w(egpU?&+(Te_sr)hF^#XRfnZk?OqW3 z+v!Yas&?js3VIl^ryiuB5TzH>j?5})1uGhLk-Vugn_TqooW_1?4v5d+)%*xeN$G>Q zgz3S`;%~27kR?BE#o-P$(wK=9?85^^z7f2o#zTj0Z@6>NI|b7(J#W{YmJ(m`hroY8 z`e+@6NZ`kb#|Kv>WNU_1fw5X8dg8G%G>I1%7HPHL2Lk#3E8233C)zlmydZ*bx-{V4%0 zV#(f=D_nM&c05fbY}=&IZOQ?mD6QI2U%4>s9Xeq}E*-!lSbrH|h#jSSqn1USkgK>h zH<9e|J@=(ns?!XHj|hnTy%L-*Uv*fiYZnfEcrdF^U_zdye)=1Syt7LD!wejw^CF~B zq^1|9!AUp1yub^Jtn@u-8^OfcH(e%m$IFLXYoeEbn5~Q7sA2dK8ufJN(DufseOBw6 z!4F}6cGWCuy^8vVfi?YxW?2lQ!gq9bC1jd&vUU z;tARzWr-xU2h8WLQ2znKe)kc1ueGhdnytd9L;WSpK0QZkCzvqZqTqA3HGLEiN!1-O zavAzc+Wdp{kT0Jr;-2`=i#SB-xz_%JeU#xrkn+nl349yJNew$_{Xg}#Gr|@MJW?bmXwD3!l$Hw zal(uex3fUJhed?)ug;Hl9-BM&z7XX7GI^K46BnfX_`E-DHAfQOFvpN9!JWkMMb<7H zt2~L(ZW1m1C(vMe;(ChVca}>%j{y}%A}{GFABYgtueB|!>YEw7*{D$&0fp?}lRcni zb4ZtImKNDl*iRs2bJPQMH@+5m7yPN>&+kn_R>39D$7r|x%|=y`RnJcFnxj{E&tSnk zWonqY5!k0eO-kI0A8S*nXJ$4OL1+Jm3C+*3;EZk`{5QpXjh$({|P*T>TQWBP;wnFegNylni`3F@(E`Mx+X%rg6cUf@ zIe|ooE6)@B5%&)|zvjn`BDiB-Jb>nH&-PU~5vs6Q2(C6R+c)R`&Altt5^tH-8Qswe zxL7bygCa-m;u{ny8#J|#wO)&v)~yBP#LM8F6*b^gklDU_z&PBV1M209)X&SSs|%JT z41P{sg1}NA-mD@zd4Jc7YLQMB2FxqH;e#=(Rv5JWLv@2X?~M+uKbs&)5( zCstPn6ymj`pKnD-x!y&o<|Dw94awepiwninih=c_VF{2wv$pfRXKC59H4u2W6MbyO z`fdq3iffk*pBg$ft&7Rh)}d@?BMNGP;WAQWsZr zSnwzQM|dmehW|4tGX5J~7~zXA!Q{I4{}NJH@l3_n5M}ekf3tFN4H2VTqo38<5*?+r@Pvm)qw*P z2`CG-2fVBp+3?x@jonhV$Jc`Q##Sf!E7zbYtLH%>5Zk+sx2y@m2v|@liKe4BV*irn zy>URq8<7|6ehVSwEY(VJ%%&;EWijlXQ|I26hq(19${*coFQ!GyS#s|`JpgOnt!3rm$jS%FUZ!4! zxsnMb9Vu~l`mVH0T4aV450=!ns&0DYaygmfV9%g%P@wKAe_GdgwuX1Fc)mw!xp9nR zDt?j(-o4umYe)_4*GkrqP@+M)$)nQt%!%R25DFbs#^{Q+v(6is2#Hej6?%}h3*JZ5 zo)^6?XMxATWtyfpca@NN%Y#t+237a^{7R57A+b5y z=oo9>u3%JxH-Q%8pOEl8Q-$P_dWD);{c&6@(uRE%z%Xn#6s_Jpl5C=X_Kt5i69V6t zO$u8`k7W#M>+~~=dP{I7QY{ZEkjbog@)F|0s}JjskY}gBZn8yH$5F6<-`N;?|A$ov zoeko)LemPfbT%LLAzSZ0NggiMr?=F^*XpuVwmTuGIQve|BQit}$*v1gZx;|k;s>dWKc84>iM zk&4Ov+xN&?;#9l@_#KjpoxvkI0L#X4wcANEhaxzA7L*R9E&orSEGpy|ycuhIj^v7n zlP&_Wq}mJi)>t1l518a+9xsISi;Fq9vDk?{UwRg;e*bZS0_eL-nupiRH)A|L*D#zY(r+#w8WFxJ_Wj5Q*^qF)c{sW)e3MX?PrNRc`Edq0fOOhZ~;V zOTDO+MUk!QPv321UUE`C3>dSr(iu{H=y4#yRzLVzKf?&47M~Jb^KQX8yvN{oYrCw9 zD?WBi%<#;h*6F`m((*?AZyKe!y36cH<(CWAs&d*eFEXa7-ZWqiwLVcSLFc>?W06IZ zgjejJ3%RG`WQLh8YqfiU1o!fKEposRJy=NWjrprgHP5nLN-~NPDc_szHAi25ZkQbV zX*8365k1Y$tIw8u3M%k(>h<>;?3q7~Pm#0c;6hGH{XX3(k}(cWcE3bfb`89gq}+S& zXSi`#%IyEsog6FIIsX_{*3i4%W#0YTacz*8y$C4?5gkYtx2oH9tr-@s{N|@Yji-JC z)a_oonLT^|_s*vTkL4PvyA_NMflYD`YKTDHdG9TcW3hhSMK4H*z1Hg2;2eTN#BlCm zLO}J~8_KY7$=*?qUW1T0hZD9Yy}Y2^r?1p*l_&`+c|51(9Y!We$}20CNIA)v(4dz^ zvU>0Hh05bA;#M$Uc{$=%>QP$s8-Vq?-#)unB zWRMg(c^POqMf72tTwk}{$jhA^aX`1DUVcvqM8sPjWHjCVrXlNBwB;sI;gUY^BhObh zJi2_(D`zx*S|4kWjZ0QjUafF&QJ|N-t7gXTm#3bjR2jT$64H}#Q0UqTfMnZNxTaUJ zoEZ_HGp`BdBg_nM-l=pk|Jc|ynR)(;l-jt=_ODDi>9a3K{WlPgm^}42W(Z2+V$&(- z7D(s67k_R#jkisyd^gr$=ymKqA@<?+49!NMSBm}*@vD<=VRgGfy7GO?4!-F92!#r zy-!y5)Pd1Ioy!}x*jjcT1T4D_-*ZZD!0o^rmp5tw21v9V-Xw)`+o51j?m*;d|C34IChi7-gGU1VVVcgnL<$rk?)OXBh9E?q5>8L0q5MYPgeNAUcB9g)e2poh ziM>)qZfnV1a_qa46d_gVXen_fc%)Sd{8a=IfT_GV>D)X0HtpL<}}U?Rz(C)2E~XbeG51OY{OYk#cTC2=F~ zFiMvjV>sYPeF*ORVjT36`|uBhWHe2vrv7Ya{T9@F3wjehCELPZpzuT_D*n@GLjxT@ zl$hVhN?-6@hiNr>h{>nvs`TI83rYA9%>_Nv3X;yX%nadRm=v{|s?=C(9RPfU} zCA_lxX=ML>peTPahtzPiAPAsmPwS4%P`>p&#K%&M5#27a6|KMTl6adS4T7(g@uVhX zt#UTApOM`Y2ka&t{@PEh3UX+2ZC#9cr7WL*QFFzo{x7ggR-`=(5^{dh)o5N8BES6M zN$t&T}$5fj<0LnCYREXu$07=8ld%Rf&DCLBxnmE zfC?4Tjjx@A{BD?MCM7aOrZv;Pm8DF7hk_qtzi9K5gTua|usp5Ilw)6d;f8|@6nVJR z*Wkd@{5Erg6GUk`K$lvbqGTe9v|O>!0#i30`uG8YoouuCTYnm3{APtofK43KtLRKJu^c7Y(YZ zOt7jIBF-+qUnD_^3{+OFc$y<8rN0F#5D2K-_{q*Thp`tzhoOqf4b}LVF6~)R_Pb^}wF1YafXA2TU zy6Y|HX-7Y^n>C$jUiB*_C$_8mrY>J1)Y~~QJ$vlm3}IfZFBrK91bEQ2KBi@=Tf;Tn zgtQ!iz(uionh-oX=6bHpPTSf&UrbSL8ZrG);q%nv2Es7=6(yJ^d!K1p&yt!P(w3bY zSfa7|otPHlbwjp=W4DYr+x|DJaKgz?8@v#7-j|5Y_<~q6Rab_7cR03Fey@nzcGXak$VVzlpylvTCY=l$E@e7#=wlNslPS{_Hga*R)On z<{L%Wbc6Xa7(lG%xGU)$HqdWbaNxK$EM%s1Ps_j!#9hhka)uW%!O=dyy&3Y}mQ!F& zpx)MenYcOT#l)E!;wFRKnW+<%=qTOA)$X_XLdRX&)_l+C%XvxO5CM~g zzw%&Y$sI*$k%5jL$#qSqDyz>jjHIaFDJpPdWT&HeU1xy1R(0QH?r^?lA9#b5!#kahsfk)EBgY!U>DMiBg-o|zyXbEoUK7|UvITx_;m8Dht^C$vD-g;a zkYGhJ1x$rwedF)qE^8TE`S}j27qgZvBzzb-=_qJe_7ye6y>S@)5MDdo!;fw^O47K4 zRgR9>)sIZnK74qlD|~U_SoHTV~Dqs!|3%S??py z&|ARvVjLfMXf!^UHCKPy2s1Mfd_C@KSbbo?nKD~@T$;mnB$h*PGShK$mamr|El1%T zYlr+K5c^@Uj_O0=&brx2h-+fTu6MnG+NruV9&|Q@_UHXzgT%rBM5czVY(5f2MZq4W*2nM~MBrkm8JWr{DQi-?+37+LP`8`{3uU>ktr z9nXk$gNLtWzdIas{SH!vB4rE?ehQmTV~yUf)x3Ga<6o-MQNVE1c+1(tu5PtL0JNc? zsL~1ev}DCjhdd{m;q8(YMrnI=Ydc zbAXNC9iowX;g~{^JcCt!E`NmKe;Cc+>OdinioCqQ2YUKW|ItRv6&z#@9Jx8nOouH< zM5cymSPQ8z4^Sx6ClmDHxEvy?ENwBg+wGX?<0{ewhX@UxM=*($i7JYYt!L$x)qmz5 zP5V-Ry<_LvKH-s=p$pmwVvd>^H{c5Y+I8wx&MOh@LzI1WF|nM9Jp@O-)x2f96Jr$7 z9hC5yu$+cFW10Vb$7wP*#+N{iY%(H~RiLkZrO0BB7%%~0ZTbs1FQVwEe$$NY;C^OK z)>1UuIn)yQezd)G-a1dfyYBW~Vr7g3}+ zF@dFsB-nbO$SKB!bSa|MJ^N3GAIM`{c}*JU_8Zh~OBxi9N>Kfc|42a?h8MFQkk+|+ z#Tco}S{RPvSVoD1^%rsP)P1YQ_gzbz{$t6nc=>mT48&qum|Lu$x$(!D#+07QQ>7}V zMT*Fir1e4R@`VqB*PORMb=NHoE{xWlk%Rgf|C6LJttFkB<>fg^hiVy@uT(}?yxIm`XW_l5d@M(j&S z2{Ri2BghgIEq7G%byUFvMb+Y;i{2bx(fj9rf{uU7S^3+q{nzcn2*fo-I%9FCiB&=oW8KRu;0Ym3$IIFi7t@ z!Fg>C(+lF4B-w)O-1yD!`j>Ok8eM0I9zTmAH3597LKF>uBP6}f=?nwWh){jWvCpE^MeVF(L<;JW|En0{D_3_q=e4=Ctk%IH(L8zB>PrZ%;K<$5zb zpCMF(4`9k@DqZBF)mPQK?!{O|BLvZM&g(<6c$I$}Vpy5Qa5z(8Qhnf~mNw_}o@^3e zj-)J(M{M4`7p)q;$%C$ZC3`LT9EEFTU}vBD40mfSo|ttYt#dQ^o+0E6@Fye_>7+Nk zD3O)Q5t37G>#fKfDhgMq2}1s0tKeX^cW6bGQk3~;M_wPd7BdB{-jH)4$>B0bdDkwE>sJsY!u4--oT^gDH870$UnFP-!Ad8; z+q|B3)J!u0cl(=X76^jY&F)U=lt$f>@-w{Nk(d@TkS0+!Z^mK6XCcsch*wK?G5+Lt zRgY=MVe*=fo~wR9bC1CwWuqN(DFcqPl>bwbjWQOIbjTGRL@()YMFYGrlD8ad38;+p zH)?!T4A~s|hoQKm9jpZl&&Yc?)NM*4*yype|KTh4)h$7a(5kOEis`EIsN6Gha+h_u zWoN%$#;f%3|1Sv)qx_6W;&Y~47L3}SX!3ya`T12u_E}r&Pa`nsWva`~ z|7ZD@z!pQIY+HPe;SrG&bDoqDNwWn-0PL5@MNa+T$Y?Iv&O^N4x^pbUelA6GD}j}` zY=x8`nA-`p=rwn Date: Tue, 28 Feb 2023 09:31:05 +0800 Subject: [PATCH 010/178] Adjust JobScheduler init sequence to avoid use wrong ElasticJobListener (#2187) * Adjust JobScheduler init sequence to avoid use wrong ElasticJobListener when the config overwrite is false * adjust code style * Remove unnecessary methods --- .../lite/internal/schedule/JobScheduler.java | 30 +++++++++++-------- .../lite/internal/setup/SetUpFacade.java | 16 ---------- .../lite/internal/setup/SetUpFacadeTest.java | 20 +------------ 3 files changed, 19 insertions(+), 47 deletions(-) diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java index 4629b38898..ffee2d7d87 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java @@ -30,6 +30,7 @@ import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListenerFactory; import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService; import org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProviderFactory; import org.apache.shardingsphere.elasticjob.lite.internal.setup.SetUpFacade; @@ -78,32 +79,37 @@ public final class JobScheduler { public JobScheduler(final CoordinatorRegistryCenter regCenter, final ElasticJob elasticJob, final JobConfiguration jobConfig) { Preconditions.checkArgument(null != elasticJob, "Elastic job cannot be null."); this.regCenter = regCenter; - Collection jobListeners = getElasticJobListeners(jobConfig); - setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), jobListeners); String jobClassName = JobClassNameProviderFactory.getProvider().getJobClassName(elasticJob); - this.jobConfig = setUpFacade.setUpJobConfiguration(jobClassName, jobConfig); - schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); - jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); + this.jobConfig = setUpJobConfiguration(regCenter, jobClassName, jobConfig); + Collection jobListeners = getElasticJobListeners(this.jobConfig); + setUpFacade = new SetUpFacade(regCenter, this.jobConfig.getJobName(), jobListeners); + schedulerFacade = new SchedulerFacade(regCenter, this.jobConfig.getJobName()); + jobFacade = new LiteJobFacade(regCenter, this.jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); validateJobProperties(); jobExecutor = new ElasticJobExecutor(elasticJob, this.jobConfig, jobFacade); setGuaranteeServiceForElasticJobListeners(regCenter, jobListeners); jobScheduleController = createJobScheduleController(); } - + public JobScheduler(final CoordinatorRegistryCenter regCenter, final String elasticJobType, final JobConfiguration jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(elasticJobType), "Elastic job type cannot be null or empty."); this.regCenter = regCenter; - Collection jobListeners = getElasticJobListeners(jobConfig); - setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), jobListeners); - this.jobConfig = setUpFacade.setUpJobConfiguration(elasticJobType, jobConfig); - schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); - jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); + this.jobConfig = setUpJobConfiguration(regCenter, elasticJobType, jobConfig); + Collection jobListeners = getElasticJobListeners(this.jobConfig); + setUpFacade = new SetUpFacade(regCenter, this.jobConfig.getJobName(), jobListeners); + schedulerFacade = new SchedulerFacade(regCenter, this.jobConfig.getJobName()); + jobFacade = new LiteJobFacade(regCenter, this.jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); validateJobProperties(); jobExecutor = new ElasticJobExecutor(elasticJobType, this.jobConfig, jobFacade); setGuaranteeServiceForElasticJobListeners(regCenter, jobListeners); jobScheduleController = createJobScheduleController(); } - + + private JobConfiguration setUpJobConfiguration(final CoordinatorRegistryCenter regCenter, final String jobClassName, final JobConfiguration jobConfig) { + ConfigurationService configService = new ConfigurationService(regCenter, jobConfig.getJobName()); + return configService.setUpJobConfiguration(jobClassName, jobConfig); + } + private Collection getElasticJobListeners(final JobConfiguration jobConfig) { return jobConfig.getJobListenerTypes().stream() .map(type -> ElasticJobListenerFactory.createListener(type).orElseThrow(() -> new IllegalArgumentException(String.format("Can not find job listener type '%s'.", type)))) diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java index 05ed51ff13..0479be2850 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java @@ -17,9 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.setup; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.lite.internal.listener.ListenerManager; @@ -34,8 +32,6 @@ */ public final class SetUpFacade { - private final ConfigurationService configService; - private final LeaderService leaderService; private final ServerService serverService; @@ -47,7 +43,6 @@ public final class SetUpFacade { private final ListenerManager listenerManager; public SetUpFacade(final CoordinatorRegistryCenter regCenter, final String jobName, final Collection elasticJobListeners) { - configService = new ConfigurationService(regCenter, jobName); leaderService = new LeaderService(regCenter, jobName); serverService = new ServerService(regCenter, jobName); instanceService = new InstanceService(regCenter, jobName); @@ -55,17 +50,6 @@ public SetUpFacade(final CoordinatorRegistryCenter regCenter, final String jobNa listenerManager = new ListenerManager(regCenter, jobName, elasticJobListeners); } - /** - * Set up job configuration. - * - * @param jobClassName job class name - * @param jobConfig job configuration to be updated - * @return accepted job configuration - */ - public JobConfiguration setUpJobConfiguration(final String jobClassName, final JobConfiguration jobConfig) { - return configService.setUpJobConfiguration(jobClassName, jobConfig); - } - /** * Register start up info. * diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java index 846a1c4e37..5cd521d253 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java @@ -17,10 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.setup; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.lite.internal.listener.ListenerManager; @@ -36,17 +33,12 @@ import java.util.Collections; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) public final class SetUpFacadeTest { - @Mock - private ConfigurationService configService; - @Mock private LeaderService leaderService; @@ -68,23 +60,13 @@ public final class SetUpFacadeTest { public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); setUpFacade = new SetUpFacade(null, "test_job", Collections.emptyList()); - ReflectionUtils.setFieldValue(setUpFacade, "configService", configService); ReflectionUtils.setFieldValue(setUpFacade, "leaderService", leaderService); ReflectionUtils.setFieldValue(setUpFacade, "serverService", serverService); ReflectionUtils.setFieldValue(setUpFacade, "instanceService", instanceService); ReflectionUtils.setFieldValue(setUpFacade, "reconcileService", reconcileService); ReflectionUtils.setFieldValue(setUpFacade, "listenerManager", listenerManager); } - - @Test - public void assertSetUpJobConfiguration() { - JobConfiguration jobConfig = JobConfiguration.newBuilder("test_job", 3) - .cron("0/1 * * * * ?").setProperty("streaming.process", Boolean.TRUE.toString()).build(); - when(configService.setUpJobConfiguration(ElasticJob.class.getName(), jobConfig)).thenReturn(jobConfig); - assertThat(setUpFacade.setUpJobConfiguration(ElasticJob.class.getName(), jobConfig), is(jobConfig)); - verify(configService).setUpJobConfiguration(ElasticJob.class.getName(), jobConfig); - } - + @Test public void assertRegisterStartUpInfo() { setUpFacade.registerStartUpInfo(true); From 5297e2f65c70bbf9ae3545d3142ed69bb34e14d4 Mon Sep 17 00:00:00 2001 From: wizhuo <46399833+wizhuo@users.noreply.github.com> Date: Wed, 15 Mar 2023 16:20:41 +0800 Subject: [PATCH 011/178] Make RDBJobEventStorage singleton(#2184) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * one dataSource just need one RDBJobEventStorage,start job faster * adjust code style * Update elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java Co-authored-by: 吴伟杰 * Update elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java Co-authored-by: 吴伟杰 * Update elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java Co-authored-by: 吴伟杰 --------- Co-authored-by: 吴伟杰 --- .../tracing/exception/WrapException.java | 28 ++++++++++ .../rdb/listener/RDBTracingListener.java | 2 +- .../rdb/storage/RDBJobEventStorage.java | 54 ++++++++++++++++--- .../rdb/storage/RDBJobEventStorageTest.java | 2 +- 4 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java new file mode 100644 index 0000000000..8e776a8d76 --- /dev/null +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java @@ -0,0 +1,28 @@ +/* + * 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.elasticjob.tracing.exception; + +/** + * Use to wrap Exception. + */ +public class WrapException extends RuntimeException { + + public WrapException(final Throwable cause) { + super(cause); + } +} diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java index 5369302262..3c518e8382 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java @@ -33,7 +33,7 @@ public final class RDBTracingListener implements TracingListener { private final RDBJobEventStorage repository; public RDBTracingListener(final DataSource dataSource) throws SQLException { - repository = new RDBJobEventStorage(dataSource); + repository = RDBJobEventStorage.getInstance(dataSource); } @Override diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index ab7d045f74..8c27715f0f 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -23,6 +23,7 @@ import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.tracing.exception.WrapException; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DefaultDatabaseType; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.ServiceLoader; import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Supplier; /** * RDB job event storage. @@ -55,26 +58,63 @@ public final class RDBJobEventStorage { private static final String TASK_ID_STATE_INDEX = "TASK_ID_STATE_INDEX"; private static final Map DATABASE_TYPES = new HashMap<>(); - + + private static final Map STORAGE_MAP = new ConcurrentHashMap<>(); + private final DataSource dataSource; - + private final DatabaseType databaseType; - + private final RDBStorageSQLMapper sqlMapper; - + static { for (DatabaseType each : ServiceLoader.load(DatabaseType.class)) { DATABASE_TYPES.put(each.getType(), each); } } - - public RDBJobEventStorage(final DataSource dataSource) throws SQLException { + + private RDBJobEventStorage(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; databaseType = getDatabaseType(dataSource); sqlMapper = new RDBStorageSQLMapper(databaseType.getSQLPropertiesFile()); initTablesAndIndexes(); } - + + /** + * The same dataSource always return the same RDBJobEventStorage instance. + * + * @param dataSource dataSource + * @return RDBJobEventStorage instance + * @throws SQLException SQLException + */ + public static RDBJobEventStorage getInstance(final DataSource dataSource) throws SQLException { + return wrapException(() -> STORAGE_MAP.computeIfAbsent(dataSource, ds -> { + try { + return new RDBJobEventStorage(ds); + } catch (SQLException e) { + throw new WrapException(e); + } + })); + } + + /** + * WrapException util method. + * + * @param supplier supplier + * @return RDBJobEventStorage + * @throws SQLException SQLException + */ + public static RDBJobEventStorage wrapException(final Supplier supplier) throws SQLException { + try { + return supplier.get(); + } catch (WrapException e) { + if (e.getCause() instanceof SQLException) { + throw new SQLException(e.getCause()); + } + throw e; + } + } + private DatabaseType getDatabaseType(final DataSource dataSource) throws SQLException { try (Connection connection = dataSource.getConnection()) { String databaseProductName = connection.getMetaData().getDatabaseProductName(); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index 15ac7d35c0..d649febf14 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -49,7 +49,7 @@ public void setup() throws SQLException { dataSource.setUrl("jdbc:h2:mem:job_event_storage"); dataSource.setUsername("sa"); dataSource.setPassword(""); - storage = new RDBJobEventStorage(dataSource); + storage = RDBJobEventStorage.getInstance(dataSource); } @After From 934ab326a0c5c9090b6d292b19c222c556213447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Tue, 21 Mar 2023 17:19:43 +0800 Subject: [PATCH 012/178] Update LICENSE for httpclient --- .../src/main/release-docs/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE index c2676230c0..d238d83271 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE @@ -232,7 +232,7 @@ The text of each license is the standard Apache 2.0 license. gson 2.6.1: https://github.com/google/gson, Apache 2.0 guava 29.0-jre: https://github.com/google/guava, Apache 2.0 HikariCP-java7 2.4.13: https://github.com/brettwooldridge/HikariCP, Apache 2.0 - httpclient 4.5.12: https://github.com/apache/httpcomponents-client, Apache 2.0 + httpclient 4.5.13: https://github.com/apache/httpcomponents-client, Apache 2.0 httpcore 4.4.13: https://github.com/apache/httpcomponents-core, Apache 2.0 jackson-annotations 2.4.0: https://github.com/FasterXML/jackson-annotations, Apache 2.0 jackson-core 2.4.5: https://github.com/FasterXML/jackson-core, Apache 2.0 From b60b51c5c9d0bc0519491cdce6f57042b9845221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Tue, 21 Mar 2023 17:31:44 +0800 Subject: [PATCH 013/178] Update Release Notes for 3.0.3 --- RELEASE-NOTES.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 5d6b79666a..7af6a918c3 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,22 @@ +## 3.0.3 + +### Bug Fixes + +1. Job class conflict error caused by empty String +1. Possible NPE in LegacyCrashedRunningItemListener +1. Possible NPE in InstanceService.getAvailableJobInstances +1. Job listeners configured in local configuration were used even if overwrite=false + +### Enhancements + +1. Add new job dump method in JobOperateAPI +1. Avoid once listener invoke multi times + +### Change Logs + +1. [MILESTONE 3.0.3](https://github.com/apache/shardingsphere-elasticjob/milestone/8) + + ## 3.0.2 ### Bug Fixes @@ -7,7 +26,7 @@ 1. NPE occur when job instance could not be unmarshalled. 1. Fix failover too sensitive. -## Enhancements +### Enhancements 1. Script Job exception's stack was ignored. 1. Support using different event trace data source when using Spring Boot. From b03f916c0c202d66ae29585c33c398877e2b0580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Tue, 21 Mar 2023 17:31:57 +0800 Subject: [PATCH 014/178] Update example version --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index 09f84f0fd9..2f9881ce4a 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -38,7 +38,7 @@ - 3.0.0 + 3.0.3 1.8 5.1.0 4.3.4.RELEASE From 2bfce1ebc39475e1b8eda456b673ab9431c0f270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Tue, 21 Mar 2023 17:43:05 +0800 Subject: [PATCH 015/178] [maven-release-plugin] prepare release 3.0.3 --- elasticjob-api/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-common/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-executor/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml | 2 +- elasticjob-cloud/pom.xml | 2 +- .../elasticjob-cloud-executor-distribution/pom.xml | 2 +- .../elasticjob-cloud-scheduler-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-lite-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-src-distribution/pom.xml | 2 +- elasticjob-distribution/pom.xml | 2 +- .../elasticjob-error-handler-spi/pom.xml | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 2 +- .../elasticjob-error-handler-email/pom.xml | 2 +- .../elasticjob-error-handler-general/pom.xml | 2 +- .../elasticjob-error-handler-wechat/pom.xml | 2 +- .../elasticjob-error-handler-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-error-handler/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-kernel/pom.xml | 2 +- .../elasticjob-dataflow-executor/pom.xml | 2 +- .../elasticjob-executor-type/elasticjob-http-executor/pom.xml | 2 +- .../elasticjob-script-executor/pom.xml | 2 +- .../elasticjob-simple-executor/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-executor/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-api/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-rdb/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-tracing/pom.xml | 2 +- elasticjob-ecosystem/pom.xml | 2 +- elasticjob-infra/elasticjob-infra-common/pom.xml | 2 +- .../elasticjob-registry-center-api/pom.xml | 2 +- .../elasticjob-registry-center-zookeeper-curator/pom.xml | 2 +- .../elasticjob-regitry-center-provider/pom.xml | 2 +- elasticjob-infra/elasticjob-registry-center/pom.xml | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 2 +- elasticjob-infra/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 2 +- .../elasticjob-lite-spring-boot-starter/pom.xml | 2 +- .../elasticjob-lite-spring-core/pom.xml | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-spring/pom.xml | 2 +- elasticjob-lite/pom.xml | 2 +- pom.xml | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index 2a682168f8..1e204792d4 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-api ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index 23736afa0c..316cb9f223 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-cloud-common ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index 5652751c18..7f67dd2477 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-cloud-executor ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index b37a790372..7f28486c2a 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-cloud-scheduler ${project.artifactId} diff --git a/elasticjob-cloud/pom.xml b/elasticjob-cloud/pom.xml index 0a44944cda..ce8330590c 100644 --- a/elasticjob-cloud/pom.xml +++ b/elasticjob-cloud/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-cloud pom diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index 38abef0617..022abb9244 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-cloud-executor-distribution pom diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index 7e2a65c7ef..12d0a491db 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-cloud-scheduler-distribution pom diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index 485fabb115..6d378fc0d8 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite-distribution pom diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index 5eb0c3ffa0..c3189da7b6 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-src-distribution pom diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index be5f997bab..40ac76b36c 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-distribution pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml index 42dff33886..6fee5eee2e 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-error-handler-spi diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index 97856fbb02..0c7249f9aa 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-error-handler-dingtalk diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index fbc031bcfa..9a66c7c948 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-error-handler-email diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 83863d7d2c..fe2d90358a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-error-handler-general diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index d2ef6e8415..362fa3529c 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-error-handler-wechat diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml index 0fb1b6c4dd..a85ea8a2af 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-error-handler-type pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml index e2a1ad3324..cbe6e2fb70 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-error-handler pom diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index aba4fb377a..6211bee958 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-executor-kernel ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml index ca7d15387b..91e0712a7c 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-dataflow-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index 4c3cd4e58e..882ed99dcc 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-http-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml index 3ce051f9b5..1edf2e46dc 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-script-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml index 41933e3ba8..5f2fb5661c 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-simple-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index 4a9947a43a..c9a4ffa10d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-executor-type pom diff --git a/elasticjob-ecosystem/elasticjob-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/pom.xml index e6a014877e..227dd02865 100644 --- a/elasticjob-ecosystem/elasticjob-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-executor pom diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index fb73c3c862..6bc73f49a1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-tracing-api ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index d94fd3b328..23901b64c1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-tracing-rdb ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/pom.xml index cb3660a4e5..dadc875a60 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-tracing pom diff --git a/elasticjob-ecosystem/pom.xml b/elasticjob-ecosystem/pom.xml index 8f9e1bfe73..6f55d7152b 100644 --- a/elasticjob-ecosystem/pom.xml +++ b/elasticjob-ecosystem/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-ecosystem pom diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 6f7e0f54bc..7b6dbaa326 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-infra-common ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index 6ffc503cfc..ca18d0d14b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -20,7 +20,7 @@ elasticjob-registry-center org.apache.shardingsphere.elasticjob - 3.1.0-SNAPSHOT + 3.0.3 4.0.0 elasticjob-registry-center-api diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index af5ef7dbdd..0db7ca8616 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -20,7 +20,7 @@ elasticjob-regitry-center-provider org.apache.shardingsphere.elasticjob - 3.1.0-SNAPSHOT + 3.0.3 4.0.0 elasticjob-registry-center-zookeeper-curator diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index ea5f73588d..35b6f3133b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -20,7 +20,7 @@ elasticjob-registry-center org.apache.shardingsphere.elasticjob - 3.1.0-SNAPSHOT + 3.0.3 4.0.0 elasticjob-regitry-center-provider diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index 11272ee7a3..501faf2db8 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-registry-center ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index f78e7d7209..ee5e9ca7ad 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -20,7 +20,7 @@ elasticjob-infra org.apache.shardingsphere.elasticjob - 3.1.0-SNAPSHOT + 3.0.3 4.0.0 diff --git a/elasticjob-infra/pom.xml b/elasticjob-infra/pom.xml index 0cc6395f77..88bf88ded4 100644 --- a/elasticjob-infra/pom.xml +++ b/elasticjob-infra/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-infra pom diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 32ff0c09a3..19fea7a343 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -20,7 +20,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index d736066763..e11a8a6120 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite-lifecycle ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index f84984c182..2a71caaf3b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite-spring-boot-starter ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index b48d41b71d..fdce894b06 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite-spring-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index de79e7f6e0..e0df547a76 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -20,7 +20,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite-spring-namespace ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml index f8ae0283d0..7d698584e2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite-spring pom diff --git a/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml index 025f6a9ec9..7bb8a9d7aa 100644 --- a/elasticjob-lite/pom.xml +++ b/elasticjob-lite/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.3 elasticjob-lite pom diff --git a/pom.xml b/pom.xml index 12503b41f8..58e2445b9e 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.3 pom ${project.artifactId} @@ -790,7 +790,7 @@ scm:git:https://github.com/apache/shardingsphere-elasticjob.git scm:git:https://github.com/apache/shardingsphere-elasticjob.git https://github.com/apache/shardingsphere-elasticjob.git - HEAD + 3.0.3 From 229f5a23bbfdb0422fbee7409328a9ecf489562b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Tue, 21 Mar 2023 17:43:16 +0800 Subject: [PATCH 016/178] [maven-release-plugin] prepare for next development iteration --- elasticjob-api/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-common/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-executor/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml | 2 +- elasticjob-cloud/pom.xml | 2 +- .../elasticjob-cloud-executor-distribution/pom.xml | 2 +- .../elasticjob-cloud-scheduler-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-lite-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-src-distribution/pom.xml | 2 +- elasticjob-distribution/pom.xml | 2 +- .../elasticjob-error-handler-spi/pom.xml | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 2 +- .../elasticjob-error-handler-email/pom.xml | 2 +- .../elasticjob-error-handler-general/pom.xml | 2 +- .../elasticjob-error-handler-wechat/pom.xml | 2 +- .../elasticjob-error-handler-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-error-handler/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-kernel/pom.xml | 2 +- .../elasticjob-dataflow-executor/pom.xml | 2 +- .../elasticjob-executor-type/elasticjob-http-executor/pom.xml | 2 +- .../elasticjob-script-executor/pom.xml | 2 +- .../elasticjob-simple-executor/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-executor/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-api/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-rdb/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-tracing/pom.xml | 2 +- elasticjob-ecosystem/pom.xml | 2 +- elasticjob-infra/elasticjob-infra-common/pom.xml | 2 +- .../elasticjob-registry-center-api/pom.xml | 2 +- .../elasticjob-registry-center-zookeeper-curator/pom.xml | 2 +- .../elasticjob-regitry-center-provider/pom.xml | 2 +- elasticjob-infra/elasticjob-registry-center/pom.xml | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 2 +- elasticjob-infra/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 2 +- .../elasticjob-lite-spring-boot-starter/pom.xml | 2 +- .../elasticjob-lite-spring-core/pom.xml | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-spring/pom.xml | 2 +- elasticjob-lite/pom.xml | 2 +- pom.xml | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index 1e204792d4..2a682168f8 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-api ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index 316cb9f223..23736afa0c 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-cloud-common ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index 7f67dd2477..5652751c18 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-cloud-executor ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index 7f28486c2a..b37a790372 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-cloud-scheduler ${project.artifactId} diff --git a/elasticjob-cloud/pom.xml b/elasticjob-cloud/pom.xml index ce8330590c..0a44944cda 100644 --- a/elasticjob-cloud/pom.xml +++ b/elasticjob-cloud/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-cloud pom diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index 022abb9244..38abef0617 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-cloud-executor-distribution pom diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index 12d0a491db..7e2a65c7ef 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-cloud-scheduler-distribution pom diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index 6d378fc0d8..485fabb115 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite-distribution pom diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index c3189da7b6..5eb0c3ffa0 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-src-distribution pom diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index 40ac76b36c..be5f997bab 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-distribution pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml index 6fee5eee2e..42dff33886 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-error-handler-spi diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index 0c7249f9aa..97856fbb02 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-error-handler-dingtalk diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index 9a66c7c948..fbc031bcfa 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-error-handler-email diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index fe2d90358a..83863d7d2c 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-error-handler-general diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index 362fa3529c..d2ef6e8415 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-error-handler-wechat diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml index a85ea8a2af..0fb1b6c4dd 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-error-handler-type pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml index cbe6e2fb70..e2a1ad3324 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-error-handler pom diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index 6211bee958..aba4fb377a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-executor-kernel ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml index 91e0712a7c..ca7d15387b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-dataflow-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index 882ed99dcc..4c3cd4e58e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-http-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml index 1edf2e46dc..3ce051f9b5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-script-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml index 5f2fb5661c..41933e3ba8 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-simple-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index c9a4ffa10d..4a9947a43a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-executor-type pom diff --git a/elasticjob-ecosystem/elasticjob-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/pom.xml index 227dd02865..e6a014877e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-executor pom diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index 6bc73f49a1..fb73c3c862 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-tracing-api ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index 23901b64c1..d94fd3b328 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-tracing-rdb ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/pom.xml index dadc875a60..cb3660a4e5 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-tracing pom diff --git a/elasticjob-ecosystem/pom.xml b/elasticjob-ecosystem/pom.xml index 6f55d7152b..8f9e1bfe73 100644 --- a/elasticjob-ecosystem/pom.xml +++ b/elasticjob-ecosystem/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-ecosystem pom diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 7b6dbaa326..6f7e0f54bc 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-infra-common ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index ca18d0d14b..6ffc503cfc 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -20,7 +20,7 @@ elasticjob-registry-center org.apache.shardingsphere.elasticjob - 3.0.3 + 3.1.0-SNAPSHOT 4.0.0 elasticjob-registry-center-api diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index 0db7ca8616..af5ef7dbdd 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -20,7 +20,7 @@ elasticjob-regitry-center-provider org.apache.shardingsphere.elasticjob - 3.0.3 + 3.1.0-SNAPSHOT 4.0.0 elasticjob-registry-center-zookeeper-curator diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index 35b6f3133b..ea5f73588d 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -20,7 +20,7 @@ elasticjob-registry-center org.apache.shardingsphere.elasticjob - 3.0.3 + 3.1.0-SNAPSHOT 4.0.0 elasticjob-regitry-center-provider diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index 501faf2db8..11272ee7a3 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-registry-center ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index ee5e9ca7ad..f78e7d7209 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -20,7 +20,7 @@ elasticjob-infra org.apache.shardingsphere.elasticjob - 3.0.3 + 3.1.0-SNAPSHOT 4.0.0 diff --git a/elasticjob-infra/pom.xml b/elasticjob-infra/pom.xml index 88bf88ded4..0cc6395f77 100644 --- a/elasticjob-infra/pom.xml +++ b/elasticjob-infra/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-infra pom diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 19fea7a343..32ff0c09a3 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -20,7 +20,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index e11a8a6120..d736066763 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite-lifecycle ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index 2a71caaf3b..f84984c182 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite-spring-boot-starter ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index fdce894b06..b48d41b71d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite-spring-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index e0df547a76..de79e7f6e0 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -20,7 +20,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite-spring-namespace ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml index 7d698584e2..f8ae0283d0 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite-spring pom diff --git a/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml index 7bb8a9d7aa..025f6a9ec9 100644 --- a/elasticjob-lite/pom.xml +++ b/elasticjob-lite/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.3 + 3.1.0-SNAPSHOT elasticjob-lite pom diff --git a/pom.xml b/pom.xml index 58e2445b9e..12503b41f8 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.3 + 3.1.0-SNAPSHOT pom ${project.artifactId} @@ -790,7 +790,7 @@ scm:git:https://github.com/apache/shardingsphere-elasticjob.git scm:git:https://github.com/apache/shardingsphere-elasticjob.git https://github.com/apache/shardingsphere-elasticjob.git - 3.0.3 + HEAD From 5f82c4256b28411c84cdc7011bb05022bd1d7179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E4=BC=9F=E6=9D=B0?= Date: Fri, 31 Mar 2023 10:52:26 +0800 Subject: [PATCH 017/178] Update download links for 3.0.3 (#2206) --- docs/content/downloads/_index.cn.md | 10 +++++----- docs/content/downloads/_index.en.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/content/downloads/_index.cn.md b/docs/content/downloads/_index.cn.md index 7767ce5555..776de91a22 100644 --- a/docs/content/downloads/_index.cn.md +++ b/docs/content/downloads/_index.cn.md @@ -13,12 +13,12 @@ extracss = true ElasticJob 的发布版包括源码包及其对应的二进制包。 由于下载内容分布在镜像服务器上,所以下载后应该进行 GPG 或 SHA-512 校验,以此来保证内容没有被篡改。 -##### ElasticJob - 版本: 3.0.2 ( 发布日期: Oct 23, 2022 ) +##### ElasticJob - 版本: 3.0.3 ( 发布日期: Mar 31, 2023 ) -- 源码: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-src.zip.sha512) ] -- ElasticJob-Lite 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Scheduler 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-scheduler-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-scheduler-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-scheduler-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Executor 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-executor-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-executor-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-executor-bin.tar.gz.sha512) ] +- 源码: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.sha512) ] +- ElasticJob-Lite 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] +- ElasticJob-Cloud-Scheduler 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.sha512) ] +- ElasticJob-Cloud-Executor 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.sha512) ] ##### ElasticJob-UI - 版本: 3.0.2 ( 发布日期: Oct 31, 2022 ) diff --git a/docs/content/downloads/_index.en.md b/docs/content/downloads/_index.en.md index 67660c0f13..34cf23c79a 100644 --- a/docs/content/downloads/_index.en.md +++ b/docs/content/downloads/_index.en.md @@ -13,12 +13,12 @@ extracss = true ElasticJob is released as source code tarballs with corresponding binary tarballs for convenience. The downloads are distributed via mirror sites and should be checked for tampering using GPG or SHA-512. -##### ElasticJob - Version: 3.0.2 ( Release Date: Oct 23, 2022 ) +##### ElasticJob - Version: 3.0.3 ( Release Date: Mar 31, 2023 ) -- Source Codes: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-src.zip.sha512) ] -- ElasticJob-Lite Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Scheduler Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-scheduler-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-scheduler-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-scheduler-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Executor Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-executor-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-executor-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-executor-bin.tar.gz.sha512) ] +- Source Codes: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.sha512) ] +- ElasticJob-Lite Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] +- ElasticJob-Cloud-Scheduler Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.sha512) ] +- ElasticJob-Cloud-Executor Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.sha512) ] ##### ElasticJob-UI - Version: 3.0.2 ( Release Date: Oct 31, 2022 ) From d07320e23a04ca605e095e7bcc8bdf93cb021318 Mon Sep 17 00:00:00 2001 From: songxiulu Date: Thu, 20 Apr 2023 09:43:15 +0800 Subject: [PATCH 018/178] add zk listener remove to avoid memory leak. (#2211) * add zk listener remove to avoid memory leak. * reformat * reformat code * reformat code * remove unused Getter. --------- Co-authored-by: songxiulu --- .../reg/base/CoordinatorRegistryCenter.java | 19 ++- .../zookeeper/ZookeeperRegistryCenter.java | 48 +++++- .../ZookeeperRegistryCenterListenerTest.java | 152 ++++++++++++++++++ .../util/ZookeeperRegistryCenterTestUtil.java | 33 +++- .../lite/internal/setup/SetUpFacade.java | 14 ++ .../lite/internal/storage/JobNodeStorage.java | 2 +- .../lite/internal/setup/SetUpFacadeTest.java | 8 +- .../internal/storage/JobNodeStorageTest.java | 2 +- 8 files changed, 267 insertions(+), 11 deletions(-) create mode 100644 elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java index eefd43b492..574601406f 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java @@ -119,15 +119,28 @@ public interface CoordinatorRegistryCenter extends RegistryCenter { /** * Add connection state changed event listener to registry center. * + * @param key key to be watched. * @param listener connection state changed event listener */ - void addConnectionStateChangedEventListener(ConnectionStateChangedEventListener listener); - + void addConnectionStateChangedEventListener(String key, ConnectionStateChangedEventListener listener); + /** - * Execute oprations in transaction. + * Execute operations in transaction. * * @param transactionOperations operations * @throws Exception exception */ void executeInTransaction(List transactionOperations) throws Exception; + + /** + * Remove all data listeners that have been bound to the current key. + * @param key key to be watched + */ + void removeDataListeners(String key); + + /** + * Remove conn state listener that have been bound to the current key. + * @param key key to be watched + */ + void removeConnStateListener(String key); } diff --git a/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 b/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 index aa6c03d34d..ac4186e04e 100644 --- a/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 +++ b/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 @@ -31,6 +31,7 @@ import org.apache.curator.framework.recipes.cache.CuratorCache; import org.apache.curator.framework.recipes.cache.CuratorCacheListener; import org.apache.curator.framework.recipes.leader.LeaderLatch; +import org.apache.curator.framework.state.ConnectionStateListener; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.utils.CloseableUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; @@ -53,9 +54,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; +import java.util.Objects; import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; @@ -71,7 +74,17 @@ public final class ZookeeperRegistryCenter implements CoordinatorRegistryCenter private final ZookeeperConfiguration zkConfig; private final Map caches = new ConcurrentHashMap<>(); - + + /** + * Data listener list. + */ + private final Map> dataListeners = new ConcurrentHashMap<>(); + + /** + * Connections state listener list. + */ + private final Map> connStateListeners = new ConcurrentHashMap<>(); + @Getter private CuratorFramework client; @@ -311,9 +324,10 @@ public Object getRawClient() { } @Override - public void addConnectionStateChangedEventListener(final ConnectionStateChangedEventListener listener) { + public void addConnectionStateChangedEventListener(final String key, + final ConnectionStateChangedEventListener listener) { CoordinatorRegistryCenter coordinatorRegistryCenter = this; - client.getConnectionStateListenable().addListener((client, newState) -> { + ConnectionStateListener connStateListener = (client, newState) -> { State state; switch (newState) { case CONNECTED: @@ -331,7 +345,9 @@ public void addConnectionStateChangedEventListener(final ConnectionStateChangedE throw new IllegalStateException("Illegal registry center connection state: " + newState); } listener.onStateChanged(coordinatorRegistryCenter, state); - }); + }; + client.getConnectionStateListenable().addListener(connStateListener); + connStateListeners.computeIfAbsent(key, k -> new LinkedList<>()).add(connStateListener); } @Override @@ -428,6 +444,30 @@ public void watch(final String key, final DataChangedEventListener listener, fin } else { cache.listenable().addListener(cacheListener); } + dataListeners.computeIfAbsent(key, k -> new LinkedList<>()).add(cacheListener); + } + + @Override + public void removeDataListeners(final String key) { + final CuratorCache cache = caches.get(key + "/"); + if (Objects.isNull(cache)) { + dataListeners.remove(key); + return; + } + List cacheListenerList = dataListeners.remove(key); + if (Objects.isNull(cacheListenerList)) { + return; + } + cacheListenerList.forEach(listener -> cache.listenable().removeListener(listener)); + } + + @Override + public void removeConnStateListener(final String key) { + final List listenerList = connStateListeners.remove(key); + if (Objects.isNull(listenerList)) { + return; + } + listenerList.forEach(listener -> client.getConnectionStateListenable().removeListener(listener)); } private Type getTypeFromCuratorType(final CuratorCacheListener.Type curatorType) { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java new file mode 100644 index 0000000000..9b2d42b01d --- /dev/null +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java @@ -0,0 +1,152 @@ +/* + * 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.elasticjob.reg.zookeeper; + +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.listen.Listenable; +import org.apache.curator.framework.recipes.cache.CuratorCache; +import org.apache.curator.framework.recipes.cache.CuratorCacheListener; +import org.apache.curator.framework.state.ConnectionStateListener; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class ZookeeperRegistryCenterListenerTest { + + @Mock + private Map caches; + + @Mock + private CuratorFramework client; + + @Mock + private CuratorCache cache; + + @Mock + private Listenable connStateListenable; + + @Mock + private Listenable dataListenable; + + private ZookeeperRegistryCenter regCenter; + + private final String jobPath = "/test_job"; + + @Before + public void setUp() { + regCenter = new ZookeeperRegistryCenter(null); + ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "caches", caches); + ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "client", client); + } + + @Test + public void testAddConnectionStateChangedEventListener() throws Exception { + when(client.getConnectionStateListenable()).thenReturn(connStateListenable); + regCenter.addConnectionStateChangedEventListener(jobPath, null); + verify(client.getConnectionStateListenable()).addListener(any()); + assertEquals(1, getConnStateListeners().get(jobPath).size()); + } + + @Test + public void testWatch() throws Exception { + when(caches.get(jobPath + "/")).thenReturn(cache); + when(cache.listenable()).thenReturn(dataListenable); + regCenter.watch(jobPath, null, null); + verify(cache.listenable()).addListener(any()); + assertEquals(1, getDataListeners().get(jobPath).size()); + } + + @Test + public void testRemoveDataListenersNonCache() throws Exception { + when(cache.listenable()).thenReturn(dataListenable); + regCenter.removeDataListeners(jobPath); + verify(cache.listenable(), never()).removeListener(any()); + assertNull(getDataListeners().get(jobPath)); + } + + @Test + public void testRemoveDataListenersHasCache() throws Exception { + when(caches.get(jobPath + "/")).thenReturn(cache); + when(cache.listenable()).thenReturn(dataListenable); + List list = new ArrayList<>(); + list.add(null); + list.add(null); + getDataListeners().put(jobPath, list); + regCenter.removeDataListeners(jobPath); + assertNull(getDataListeners().get(jobPath)); + verify(cache.listenable(), times(2)).removeListener(null); + } + + @Test + public void testRemoveDataListenersHasCacheEmptyListeners() throws Exception { + when(caches.get(jobPath + "/")).thenReturn(cache); + when(cache.listenable()).thenReturn(dataListenable); + regCenter.removeDataListeners(jobPath); + assertNull(getDataListeners().get(jobPath)); + verify(cache.listenable(), never()).removeListener(null); + } + + @Test + public void testRemoveConnStateListener() throws Exception { + when(client.getConnectionStateListenable()).thenReturn(connStateListenable); + List list = new ArrayList<>(); + list.add(null); + list.add(null); + getConnStateListeners().put(jobPath, list); + assertEquals(2, getConnStateListeners().get(jobPath).size()); + regCenter.removeConnStateListener(jobPath); + assertNull(getConnStateListeners().get(jobPath)); + verify(client.getConnectionStateListenable(), times(2)).removeListener(null); + } + + @Test + public void testRemoveConnStateListenerEmptyListeners() throws Exception { + when(client.getConnectionStateListenable()).thenReturn(connStateListenable); + regCenter.removeConnStateListener(jobPath); + assertNull(getConnStateListeners().get(jobPath)); + verify(client.getConnectionStateListenable(), never()).removeListener(null); + } + + @SuppressWarnings("unchecked") + private Map> getConnStateListeners() { + return (Map>) ZookeeperRegistryCenterTestUtil + .getFieldValue(regCenter, "connStateListeners"); + } + + @SuppressWarnings("unchecked") + private Map> getDataListeners() { + return (Map>) ZookeeperRegistryCenterTestUtil + .getFieldValue(regCenter, "dataListeners"); + } +} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java index fa73998731..2dfcbb5e38 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java @@ -19,8 +19,11 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import java.lang.reflect.Field; + @NoArgsConstructor(access = AccessLevel.PRIVATE) public class ZookeeperRegistryCenterTestUtil { @@ -33,5 +36,33 @@ public static void persist(final ZookeeperRegistryCenter zookeeperRegistryCenter zookeeperRegistryCenter.persist("/test", "test"); zookeeperRegistryCenter.persist("/test/deep/nested", "deepNested"); zookeeperRegistryCenter.persist("/test/child", "child"); - } + } + + /** + * Set field value use reflection. + * + * @param target target object + * @param fieldName field name + * @param fieldValue field value + */ + @SneakyThrows + public static void setFieldValue(final Object target, final String fieldName, final Object fieldValue) { + Field field = target.getClass().getDeclaredField(fieldName); + field.setAccessible(true); + field.set(target, fieldValue); + } + + /** + * Get field value use reflection. + * + * @param target target object + * @param fieldName field name + * @return field value + */ + @SneakyThrows + public static Object getFieldValue(final Object target, final String fieldName) { + Field field = target.getClass().getDeclaredField(fieldName); + field.setAccessible(true); + return field.get(target); + } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java index 0479be2850..f0d3fa83b4 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java @@ -41,6 +41,16 @@ public final class SetUpFacade { private final ReconcileService reconcileService; private final ListenerManager listenerManager; + + /** + * JobName. + */ + private final String jobName; + + /** + * Registry center. + */ + private final CoordinatorRegistryCenter regCenter; public SetUpFacade(final CoordinatorRegistryCenter regCenter, final String jobName, final Collection elasticJobListeners) { leaderService = new LeaderService(regCenter, jobName); @@ -48,6 +58,8 @@ public SetUpFacade(final CoordinatorRegistryCenter regCenter, final String jobNa instanceService = new InstanceService(regCenter, jobName); reconcileService = new ReconcileService(regCenter, jobName); listenerManager = new ListenerManager(regCenter, jobName, elasticJobListeners); + this.jobName = jobName; + this.regCenter = regCenter; } /** @@ -69,6 +81,8 @@ public void registerStartUpInfo(final boolean enabled) { * Tear down. */ public void tearDown() { + regCenter.removeConnStateListener("/" + this.jobName); + regCenter.removeDataListeners("/" + this.jobName); if (reconcileService.isRunning()) { reconcileService.stopAsync(); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java index 1df239043c..bd3cc92123 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java @@ -211,7 +211,7 @@ public void executeInLeader(final String latchNode, final LeaderExecutionCallbac * @param listener connection state listener */ public void addConnectionStateListener(final ConnectionStateChangedEventListener listener) { - regCenter.addConnectionStateChangedEventListener(listener); + regCenter.addConnectionStateChangedEventListener("/" + jobName, listener); } /** diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java index 5cd521d253..e5093e06c5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java @@ -25,6 +25,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -53,13 +54,16 @@ public final class SetUpFacadeTest { @Mock private ListenerManager listenerManager; + + @Mock + private CoordinatorRegistryCenter regCenter; private SetUpFacade setUpFacade; @Before public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); - setUpFacade = new SetUpFacade(null, "test_job", Collections.emptyList()); + setUpFacade = new SetUpFacade(regCenter, "test_job", Collections.emptyList()); ReflectionUtils.setFieldValue(setUpFacade, "leaderService", leaderService); ReflectionUtils.setFieldValue(setUpFacade, "serverService", serverService); ReflectionUtils.setFieldValue(setUpFacade, "instanceService", instanceService); @@ -80,5 +84,7 @@ public void assertTearDown() { when(reconcileService.isRunning()).thenReturn(true); setUpFacade.tearDown(); verify(reconcileService).stopAsync(); + verify(regCenter).removeDataListeners("/test_job"); + verify(regCenter).removeConnStateListener("/test_job"); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java index cb84a7014d..bc2b28b8b5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java @@ -172,7 +172,7 @@ public void assertExecuteInTransactionFailure() throws Exception { public void assertAddConnectionStateListener() { ConnectionStateChangedEventListener listener = mock(ConnectionStateChangedEventListener.class); jobNodeStorage.addConnectionStateListener(listener); - verify(regCenter).addConnectionStateChangedEventListener(listener); + verify(regCenter).addConnectionStateChangedEventListener("/test_job", listener); } @Test From a7042cf4872d784d619e4560cdfa0f92b0311965 Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Thu, 20 Apr 2023 09:43:41 +0800 Subject: [PATCH 019/178] Fix the integration problem of `Spring Boot Starter` and `SpringBoot OSS 3.0.0-M5+` (#2209) --- ...oot.autoconfigure.AutoConfiguration.imports | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 0000000000..de1aa72835 --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1,18 @@ +# +# 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. +# + +org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobLiteAutoConfiguration From 9afe466837e9e0751a8cd3898bca80d60548f0d1 Mon Sep 17 00:00:00 2001 From: Zheng Feng Date: Mon, 24 Jul 2023 14:11:00 +0800 Subject: [PATCH 020/178] Upgrade snakeyaml to 2.0 and springboot to 2.7.10 (#2216) --- .../elasticjob/infra/yaml/YamlEngine.java | 11 +++++++++-- .../yaml/representer/ElasticJobYamlRepresenter.java | 4 ++++ elasticjob-lite/elasticjob-lite-spring/pom.xml | 4 ++-- pom.xml | 3 ++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java index d0d264cb1b..8bfc91791f 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java @@ -20,7 +20,12 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.yaml.representer.ElasticJobYamlRepresenter; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.inspector.TrustedPrefixesTagInspector; + +import java.util.Collections; /** * YAML engine. @@ -35,7 +40,7 @@ public final class YamlEngine { * @return YAML content */ public static String marshal(final Object value) { - return new Yaml(new ElasticJobYamlRepresenter()).dumpAsMap(value); + return new Yaml(new ElasticJobYamlRepresenter(new DumperOptions())).dumpAsMap(value); } /** @@ -47,6 +52,8 @@ public static String marshal(final Object value) { * @return object from YAML */ public static T unmarshal(final String yamlContent, final Class classType) { - return new Yaml().loadAs(yamlContent, classType); + LoaderOptions loaderOptions = new LoaderOptions(); + loaderOptions.setTagInspector(new TrustedPrefixesTagInspector(Collections.singletonList("org.apache.shardingsphere.elasticjob"))); + return new Yaml(loaderOptions).loadAs(yamlContent, classType); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java index 2cede6bcfa..233f9ff304 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.yaml.representer; +import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.introspector.Property; import org.yaml.snakeyaml.nodes.NodeTuple; import org.yaml.snakeyaml.nodes.Tag; @@ -26,6 +27,9 @@ * ElasticJob YAML representer. */ public final class ElasticJobYamlRepresenter extends Representer { + public ElasticJobYamlRepresenter(final DumperOptions options) { + super(options); + } @Override protected NodeTuple representJavaBeanProperty(final Object javaBean, final Property property, final Object propertyValue, final Tag customTag) { diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml index f8ae0283d0..35804b4a2b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml @@ -34,8 +34,8 @@ - 2.3.12.RELEASE - [3.1.0.RELEASE,5.2.16.RELEASE] + 2.7.10 + 5.3.26 diff --git a/pom.xml b/pom.xml index 12503b41f8..20200706cf 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 1.3 4.5.13 4.4.13 - 1.26 + 2.0 2.6.1 4.1.59.Final 1.1.0 @@ -801,4 +801,5 @@ dev-unsubscribe@shardingsphere.apache.org + From 73f420e38e622af0f0e88dc3be10d1da1dc7a341 Mon Sep 17 00:00:00 2001 From: songxiaosheng Date: Mon, 4 Sep 2023 08:14:08 +0800 Subject: [PATCH 021/178] remove offline server ip (#2251) * remove offline server ip * :memo: doc remove offline server * :memo: doc remove offline server --- .../lite/internal/server/ServerService.java | 63 +++++++++++++++---- .../lite/internal/setup/SetUpFacade.java | 1 + 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java index b2bb8a223e..011e4c17c8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java @@ -18,6 +18,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.server; import com.google.common.base.Strings; +import org.apache.commons.lang.StringUtils; import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; @@ -25,27 +26,30 @@ import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import java.util.List; +import java.util.Set; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** * Server service. */ public final class ServerService { - + private final String jobName; - + private final JobNodeStorage jobNodeStorage; - + private final ServerNode serverNode; - + public ServerService(final CoordinatorRegistryCenter regCenter, final String jobName) { this.jobName = jobName; jobNodeStorage = new JobNodeStorage(regCenter, jobName); serverNode = new ServerNode(jobName); } - + /** * Persist online status of job server. - * + * * @param enabled enable server or not */ public void persistOnline(final boolean enabled) { @@ -53,10 +57,10 @@ public void persistOnline(final boolean enabled) { jobNodeStorage.fillJobNode(serverNode.getServerNode(JobRegistry.getInstance().getJobInstance(jobName).getServerIp()), enabled ? ServerStatus.ENABLED.name() : ServerStatus.DISABLED.name()); } } - + /** * Judge has available servers or not. - * + * * @return has available servers or not */ public boolean hasAvailableServers() { @@ -68,17 +72,17 @@ public boolean hasAvailableServers() { } return false; } - + /** * Judge is available server or not. - * + * * @param ip job server IP address * @return is available server or not */ public boolean isAvailableServer(final String ip) { return isEnableServer(ip) && hasOnlineInstances(ip); } - + private boolean hasOnlineInstances(final String ip) { for (String each : jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)) { if (each.startsWith(ip)) { @@ -87,7 +91,7 @@ private boolean hasOnlineInstances(final String ip) { } return false; } - + /** * Judge is server enabled or not. * @@ -102,4 +106,39 @@ public boolean isEnableServer(final String ip) { } return ServerStatus.ENABLED.name().equals(serverStatus); } + + /** + * Remove unuse serverIp. + * @return num of serverIp be remove + */ + public int removeOfflineServers() { + AtomicInteger affectNums = new AtomicInteger(); + List instances = jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT); + if (instances == null || instances.isEmpty()) { + return affectNums.get(); + } + Set instanceIps = instances.stream() + .map(instance -> instance.split("@-@")[0]) + .collect(Collectors.toSet()); + if (instanceIps == null || instanceIps.isEmpty()) { + return affectNums.get(); + } + List serverIps = jobNodeStorage.getJobNodeChildrenKeys(ServerNode.ROOT); + if (serverIps == null || serverIps.isEmpty()) { + return affectNums.get(); + } + + serverIps.forEach(serverIp -> { + if (instanceIps.contains(serverIp)) { + return; + } + String status = jobNodeStorage.getJobNodeData(serverNode.getServerNode(serverIp)); + if (StringUtils.isNotBlank(status)) { + return; + } + jobNodeStorage.removeJobNodeIfExisted(serverNode.getServerNode(serverIp)); + affectNums.getAndIncrement(); + }); + return affectNums.get(); + } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java index f0d3fa83b4..da154ec1e0 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java @@ -75,6 +75,7 @@ public void registerStartUpInfo(final boolean enabled) { if (!reconcileService.isRunning()) { reconcileService.startAsync(); } + serverService.removeOfflineServers(); } /** From 2dc90ee47b98f1dda789d8012bffe80e8f9844cb Mon Sep 17 00:00:00 2001 From: ira james <82498494+Tiane-ira@users.noreply.github.com> Date: Tue, 5 Sep 2023 08:03:29 +0800 Subject: [PATCH 022/178] Update Spring Boot Starter Documentation (#2225) * Update spring-boot-starter.cn.md * Update spring-boot-starter.en.md --- .../usage/job-api/spring-boot-starter.cn.md | 50 +++++++++---------- .../usage/job-api/spring-boot-starter.en.md | 50 +++++++++---------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md index 5156da93c6..fde7352292 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md +++ b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md @@ -176,19 +176,19 @@ elasticjob: jobs: ... jobErrorHandlerType: EMAIL - props: - email: - host: host - port: 465 - username: username - password: password - useSsl: true - subject: ElasticJob error message - from: from@xxx.xx - to: to1@xxx.xx,to2@xxx.xx - cc: cc@xxx.xx - bcc: bcc@xxx.xx - debug: false + props: + email: + host: host + port: 465 + username: username + password: password + useSsl: true + subject: ElasticJob error message + from: from@xxx.xx + to: to1@xxx.xx,to2@xxx.xx + cc: cc@xxx.xx + bcc: bcc@xxx.xx + debug: false ``` ### 企业微信通知策略 @@ -210,11 +210,11 @@ elasticjob: jobs: ... jobErrorHandlerType: WECHAT - props: - wechat: - webhook: you_webhook - connectTimeout: 3000 - readTimeout: 5000 + props: + wechat: + webhook: you_webhook + connectTimeout: 3000 + readTimeout: 5000 ``` @@ -237,11 +237,11 @@ elasticjob: jobs: ... jobErrorHandlerType: DINGTALK - props: - dingtalk: - webhook: you_webhook - keyword: you_keyword - secret: you_secret - connectTimeout: 3000 - readTimeout: 5000 + props: + dingtalk: + webhook: you_webhook + keyword: you_keyword + secret: you_secret + connectTimeout: 3000 + readTimeout: 5000 ``` diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md index 47f5fcbba8..f106a1e40d 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md +++ b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md @@ -176,19 +176,19 @@ elasticjob: jobs: ... jobErrorHandlerType: EMAIL - props: - email: - host: host - port: 465 - username: username - password: password - useSsl: true - subject: ElasticJob error message - from: from@xxx.xx - to: to1@xxx.xx,to2@xxx.xx - cc: cc@xxx.xx - bcc: bcc@xxx.xx - debug: false + props: + email: + host: host + port: 465 + username: username + password: password + useSsl: true + subject: ElasticJob error message + from: from@xxx.xx + to: to1@xxx.xx,to2@xxx.xx + cc: cc@xxx.xx + bcc: bcc@xxx.xx + debug: false ``` ### Wechat Enterprise Notification Strategy @@ -210,11 +210,11 @@ elasticjob: jobs: ... jobErrorHandlerType: WECHAT - props: - wechat: - webhook: you_webhook - connectTimeout: 3000 - readTimeout: 5000 + props: + wechat: + webhook: you_webhook + connectTimeout: 3000 + readTimeout: 5000 ``` ### Dingtalk Notification Strategy @@ -236,11 +236,11 @@ elasticjob: jobs: ... jobErrorHandlerType: DINGTALK - props: - dingtalk: - webhook: you_webhook - keyword: you_keyword - secret: you_secret - connectTimeout: 3000 - readTimeout: 5000 + props: + dingtalk: + webhook: you_webhook + keyword: you_keyword + secret: you_secret + connectTimeout: 3000 + readTimeout: 5000 ``` From 53cbc73edd06429450fef0cf3ff793120fc0b75d Mon Sep 17 00:00:00 2001 From: Alisha-0321 <110493364+Alisha-0321@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:08:21 -0500 Subject: [PATCH 023/178] Fix ElasticJobExecutorServiceTest Flakiness (#2242) Co-authored-by: other --- .../infra/concurrent/ElasticJobExecutorServiceTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index c7ffe38daf..e92c078fa9 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -28,6 +28,8 @@ public final class ElasticJobExecutorServiceTest { + private static boolean hasExecuted; + @Test public void assertCreateExecutorService() { ElasticJobExecutorService executorServiceObject = new ElasticJobExecutorService("executor-service-test", 1); @@ -48,6 +50,7 @@ public void assertCreateExecutorService() { executorService.shutdownNow(); assertThat(executorServiceObject.getWorkQueueSize(), is(0)); assertTrue(executorServiceObject.isShutdown()); + hasExecuted = true; } static class FooTask implements Runnable { @@ -55,6 +58,9 @@ static class FooTask implements Runnable { @Override public void run() { BlockUtils.sleep(1000L); + while (!hasExecuted) { + Thread.yield(); + } } } } From 3ef82d3bac5d84ab42ce6ed821a2b05fe554df78 Mon Sep 17 00:00:00 2001 From: HuaZai <30396030+YanAnHuaZai@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:11:46 +0800 Subject: [PATCH 024/178] Update the `Registry Center Configuration` doc (#2252) fixed `sessionTimeoutMilliseconds` and `connectionTimeoutMilliseconds` data types Co-authored-by: YanAnHuaZai --- .../user-manual/elasticjob-lite/configuration/_index.cn.md | 4 ++-- .../user-manual/elasticjob-lite/configuration/_index.en.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content/user-manual/elasticjob-lite/configuration/_index.cn.md b/docs/content/user-manual/elasticjob-lite/configuration/_index.cn.md index a330eee40e..8e007e613d 100644 --- a/docs/content/user-manual/elasticjob-lite/configuration/_index.cn.md +++ b/docs/content/user-manual/elasticjob-lite/configuration/_index.cn.md @@ -22,8 +22,8 @@ ElasticJob-Lite 提供了 3 种配置方式,用于不同的使用场景。 | baseSleepTimeMilliseconds | int | 1000 | 等待重试的间隔时间的初始毫秒数 | | maxSleepTimeMilliseconds | String | 3000 | 等待重试的间隔时间的最大毫秒数 | | maxRetries | String | 3 | 最大重试次数 | -| sessionTimeoutMilliseconds | boolean | 60000 | 会话超时毫秒数 | -| connectionTimeoutMilliseconds | boolean | 15000 | 连接超时毫秒数 | +| sessionTimeoutMilliseconds | int | 60000 | 会话超时毫秒数 | +| connectionTimeoutMilliseconds | int | 15000 | 连接超时毫秒数 | | digest | String | 无需验证 | 连接 ZooKeeper 的权限令牌 | ### 核心配置项说明 diff --git a/docs/content/user-manual/elasticjob-lite/configuration/_index.en.md b/docs/content/user-manual/elasticjob-lite/configuration/_index.en.md index 195e4e6218..860631f4b5 100644 --- a/docs/content/user-manual/elasticjob-lite/configuration/_index.en.md +++ b/docs/content/user-manual/elasticjob-lite/configuration/_index.en.md @@ -22,8 +22,8 @@ ElasticJob-Lite has provided 3 kinds of configuration methods for different situ | baseSleepTimeMilliseconds | int | 1000 | The initial value of milliseconds for the retry interval | | maxSleepTimeMilliseconds | String | 3000 | The maximum value of milliseconds for the retry interval | | maxRetries | String | 3 | Maximum number of retries | -| sessionTimeoutMilliseconds | boolean | 60000 | Session timeout in milliseconds | -| connectionTimeoutMilliseconds | boolean | 15000 | Connection timeout in milliseconds | +| sessionTimeoutMilliseconds | int | 60000 | Session timeout in milliseconds | +| connectionTimeoutMilliseconds | int | 15000 | Connection timeout in milliseconds | | digest | String | no need | Permission token to connect to ZooKeeper | ### Core Configuration Description From 26ef7ea7e9113b4ed3f2dfa54edda09455740e6c Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <3293172751@qq.com> Date: Mon, 11 Sep 2023 17:03:21 +0800 Subject: [PATCH 025/178] fix(sec): upgrade org.apache.commons:commons-dbcp2 to 2.9.0 (#2255) * update org.apache.commons:commons-dbcp2 2.7.0 to 2.9.0 * Docs: Update LICENSE about dbcp2 --- .../src/main/release-docs/LICENSE | 2 +- examples/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE index d238d83271..e7e7090f64 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE @@ -217,7 +217,7 @@ The text of each license is the standard Apache 2.0 license. audience-annotations 0.5.0: https://github.com/apache/yetus, Apache 2.0 commons-codec 1.10: https://github.com/apache/commons-codec, Apache 2.0 - commons-dbcp2 2.7.0: https://github.com/apache/commons-dbcp, Apache 2.0 + commons-dbcp2 2.9.0: https://github.com/apache/commons-dbcp, Apache 2.0 commons-exec 1.3: http://commons.apache.org/proper/commons-exec, Apache 2.0 commons-lang 2.6: https://github.com/apache/commons-lang, Apache 2.0 commons-lang3 3.4: https://github.com/apache/commons-lang, Apache 2.0 diff --git a/examples/pom.xml b/examples/pom.xml index 2f9881ce4a..f29315490c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -44,7 +44,7 @@ 4.3.4.RELEASE 1.7.7 1.2.0 - 2.7.0 + 2.9.0 1.4.184 8.0.28 3.3 diff --git a/pom.xml b/pom.xml index 20200706cf..e56be37d11 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 1.1.0 0.11.1 - 2.7.0 + 2.9.0 2.8.1 3.4.2 1.6.0 From 6c946cda64aef2d4aeb4ad20857523ef06a049db Mon Sep 17 00:00:00 2001 From: Gao Peng Date: Tue, 12 Sep 2023 15:42:07 +0800 Subject: [PATCH 026/178] Do not create tracingDatasource when elasticjob.tracing.type is not RDB (#2254) * Do not create tracingDatasource when elasticjob.tracing.type is not RDB * modify unit test of TracingConfigurationTest * modify unit test of TracingConfigurationTest --------- Co-authored-by: Gabry Co-authored-by: gaopeng <95430950@qq.com> --- .../pom.xml | 4 ++ .../ElasticJobTracingConfiguration.java | 68 ++++++++++--------- .../tracing/TracingConfigurationTest.java | 54 +++++++++++++++ .../test/resources/application-tracing.yml | 21 ++++++ 4 files changed, 116 insertions(+), 31 deletions(-) create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java create mode 100644 elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-tracing.yml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index f84984c182..f73b900060 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -50,6 +50,7 @@ org.projectlombok lombok + true @@ -74,14 +75,17 @@ junit junit + test org.apache.curator curator-test + test com.h2database h2 + test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java index 3dd0afe586..f50833f3b6 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -25,6 +25,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; import org.springframework.lang.Nullable; import javax.sql.DataSource; @@ -32,42 +33,47 @@ /** * ElasticJob tracing auto configuration. */ +@Configuration(proxyBeanMethods = false) @EnableConfigurationProperties(TracingProperties.class) public class ElasticJobTracingConfiguration { - /** - * Create a bean of tracing DataSource. - * - * @param tracingProperties tracing Properties - * @return tracing DataSource - */ - @Bean("tracingDataSource") - public DataSource tracingDataSource(final TracingProperties tracingProperties) { - DataSourceProperties dataSource = tracingProperties.getDataSource(); - if (dataSource == null) { - return null; + @Configuration(proxyBeanMethods = false) + @ConditionalOnProperty(name = "elasticjob.tracing.type", havingValue = "RDB") + static class RDBTracingConfiguration { + /** + * Create a bean of tracing DataSource. + * + * @param tracingProperties tracing Properties + * @return tracing DataSource + */ + @Bean("tracingDataSource") + public DataSource tracingDataSource(final TracingProperties tracingProperties) { + DataSourceProperties dataSource = tracingProperties.getDataSource(); + if (dataSource == null) { + return null; + } + HikariDataSource tracingDataSource = new HikariDataSource(); + tracingDataSource.setJdbcUrl(dataSource.getUrl()); + BeanUtils.copyProperties(dataSource, tracingDataSource); + return tracingDataSource; } - HikariDataSource tracingDataSource = new HikariDataSource(); - tracingDataSource.setJdbcUrl(dataSource.getUrl()); - BeanUtils.copyProperties(dataSource, tracingDataSource); - return tracingDataSource; - } - /** - * Create a bean of tracing configuration. - * - * @param dataSource required by constructor - * @param tracingDataSource tracing ataSource - * @return a bean of tracing configuration - */ - @Bean - @ConditionalOnBean(DataSource.class) - @ConditionalOnProperty(name = "elasticjob.tracing.type", havingValue = "RDB") - public TracingConfiguration tracingConfiguration(final DataSource dataSource, @Nullable final DataSource tracingDataSource) { - DataSource ds = tracingDataSource; - if (ds == null) { - ds = dataSource; + /** + * Create a bean of tracing configuration. + * + * @param dataSource required by constructor + * @param tracingDataSource tracing ataSource + * @return a bean of tracing configuration + */ + @Bean + @ConditionalOnBean(DataSource.class) + public TracingConfiguration tracingConfiguration(final DataSource dataSource, + @Nullable final DataSource tracingDataSource) { + DataSource ds = tracingDataSource; + if (ds == null) { + ds = dataSource; + } + return new TracingConfiguration<>("RDB", ds); } - return new TracingConfiguration<>("RDB", ds); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java new file mode 100644 index 0000000000..5785969edb --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java @@ -0,0 +1,54 @@ +/* + * 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.elasticjob.lite.spring.boot.tracing; + +import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.junit.BeforeClass; +import org.junit.Test; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.core.ResolvableType; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; + +import javax.sql.DataSource; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; + +@SpringBootTest +@SpringBootApplication +@ActiveProfiles("tracing") +public class TracingConfigurationTest extends AbstractJUnit4SpringContextTests { + + @BeforeClass + public static void init() { + EmbedTestingServer.start(); + } + + @Test + public void assertNotRDBConfiguration() { + assertNotNull(applicationContext); + assertFalse(applicationContext.containsBean("tracingDataSource")); + ObjectProvider provider = applicationContext.getBeanProvider(ResolvableType.forClassWithGenerics(TracingConfiguration.class, DataSource.class)); + assertNull(provider.getIfAvailable()); + } +} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-tracing.yml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-tracing.yml new file mode 100644 index 0000000000..3dbb97cd9f --- /dev/null +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-tracing.yml @@ -0,0 +1,21 @@ +# +# 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. +# + +elasticjob: + regCenter: + serverLists: localhost:18181 + namespace: elasticjob-lite-spring-boot-starter From 1a0db64d8d300dc8a04d36cd716b10564bbfe7c9 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Tue, 12 Sep 2023 07:06:09 +0800 Subject: [PATCH 027/178] Use Awaitility instead of BlockUtils in unit tests --- .../elasticjob-http-executor/pom.xml | 5 ++++ .../executor/fixture/InternalController.java | 10 +++++-- .../elasticjob-infra-common/pom.xml | 5 ++++ .../ElasticJobExecutorServiceTest.java | 28 +++++++++-------- elasticjob-lite/elasticjob-lite-core/pom.xml | 5 ++++ .../disable/DisabledJobIntegrateTest.java | 25 +++++++++------- .../OneOffDisabledJobIntegrateTest.java | 2 -- .../ScheduleDisabledJobIntegrateTest.java | 13 ++++---- .../enable/OneOffEnabledJobIntegrateTest.java | 12 +++++--- .../ScheduleEnabledJobIntegrateTest.java | 14 +++++---- .../integrate/OneOffEnabledJobTest.java | 20 +++++++------ .../integrate/ScheduleEnabledJobTest.java | 20 +++++++------ .../pom.xml | 5 ++++ .../job/ElasticJobSpringBootScannerTest.java | 12 +++++--- .../boot/job/ElasticJobSpringBootTest.java | 16 +++++----- .../boot/job/fixture/EmbedTestingServer.java | 30 ++++++++++++++----- .../elasticjob-lite-spring-namespace/pom.xml | 5 ++++ .../job/AbstractJobSpringIntegrateTest.java | 20 ++++++++----- .../AbstractOneOffJobSpringIntegrateTest.java | 18 ++++++----- .../job/JobSpringNamespaceWithRefTest.java | 14 +++++---- .../job/JobSpringNamespaceWithTypeTest.java | 23 ++++++++------ .../OneOffJobSpringNamespaceWithRefTest.java | 14 +++++---- .../OneOffJobSpringNamespaceWithTypeTest.java | 9 ++++-- .../AbstractJobSpringIntegrateTest.java | 12 +++++--- .../EmbedZookeeperTestExecutionListener.java | 27 +++++++++++++---- pom.xml | 7 +++++ 26 files changed, 247 insertions(+), 124 deletions(-) diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index 4c3cd4e58e..9b2bec4b23 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -58,5 +58,10 @@ true test + + org.awaitility + awaitility + test + diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java index 6a289e8761..63d209eef3 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java @@ -18,14 +18,18 @@ package org.apache.shardingsphere.elasticjob.http.executor.fixture; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.restful.Http; import org.apache.shardingsphere.elasticjob.restful.RestfulController; import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; import org.apache.shardingsphere.elasticjob.restful.annotation.Param; import org.apache.shardingsphere.elasticjob.restful.annotation.ParamSource; +import org.awaitility.Awaitility; import java.util.Objects; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; @Slf4j public final class InternalController implements RestfulController { @@ -71,7 +75,9 @@ public String postName(@Param(name = "updateName", source = ParamSource.PATH) fi */ @Mapping(method = Http.POST, path = "/postWithTimeout") public String postWithTimeout() { - BlockUtils.waitingShortTime(); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.SECONDS).untilAsserted(() -> + assertThat(Boolean.TRUE, is(Boolean.TRUE)) + ); return "ejob"; } } diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 6f7e0f54bc..005d783eb6 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -87,5 +87,10 @@ logback-classic test + + org.awaitility + awaitility + test + diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index e92c078fa9..b3a4e94319 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -17,9 +17,11 @@ package org.apache.shardingsphere.elasticjob.infra.concurrent; +import org.awaitility.Awaitility; import org.junit.Test; import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; @@ -38,15 +40,17 @@ public void assertCreateExecutorService() { assertFalse(executorServiceObject.isShutdown()); ExecutorService executorService = executorServiceObject.createExecutorService(); executorService.submit(new FooTask()); - BlockUtils.waitingShortTime(); - assertThat(executorServiceObject.getActiveThreadCount(), is(1)); - assertThat(executorServiceObject.getWorkQueueSize(), is(0)); - assertFalse(executorServiceObject.isShutdown()); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> { + assertThat(executorServiceObject.getActiveThreadCount(), is(1)); + assertThat(executorServiceObject.getWorkQueueSize(), is(0)); + assertFalse(executorServiceObject.isShutdown()); + }); executorService.submit(new FooTask()); - BlockUtils.waitingShortTime(); - assertThat(executorServiceObject.getActiveThreadCount(), is(1)); - assertThat(executorServiceObject.getWorkQueueSize(), is(1)); - assertFalse(executorServiceObject.isShutdown()); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> { + assertThat(executorServiceObject.getActiveThreadCount(), is(1)); + assertThat(executorServiceObject.getWorkQueueSize(), is(1)); + assertFalse(executorServiceObject.isShutdown()); + }); executorService.shutdownNow(); assertThat(executorServiceObject.getWorkQueueSize(), is(0)); assertTrue(executorServiceObject.isShutdown()); @@ -54,13 +58,11 @@ public void assertCreateExecutorService() { } static class FooTask implements Runnable { - + @Override public void run() { - BlockUtils.sleep(1000L); - while (!hasExecuted) { - Thread.yield(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES) + .untilAsserted(() -> assertThat(hasExecuted, is(true))); } } } diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 32ff0c09a3..a4898adb53 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -125,5 +125,10 @@ logback-classic test + + org.awaitility + awaitility + test + diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java index 7124db006a..bca4a25ac7 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java @@ -17,16 +17,19 @@ package org.apache.shardingsphere.elasticjob.lite.integrate.disable; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.lite.integrate.BaseIntegrateTest; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.awaitility.Awaitility; +import org.hamcrest.core.IsNull; + +import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; @@ -39,8 +42,10 @@ public DisabledJobIntegrateTest(final TestType type) { } protected final void assertDisabledRegCenterInfo() { - assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); - assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> { + assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); + assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); + }); JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); assertThat(jobConfig.getShardingTotalCount(), is(3)); if (getJobBootstrap() instanceof ScheduleJobBootstrap) { @@ -50,8 +55,8 @@ protected final void assertDisabledRegCenterInfo() { } assertThat(jobConfig.getShardingItemParameters(), is("0=A,1=B,2=C")); assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.DISABLED.name())); - while (null != getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance")) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance"), is(IsNull.nullValue())) + ); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java index 77665b1b01..c9a04f18c3 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.lite.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.junit.Test; public final class OneOffDisabledJobIntegrateTest extends DisabledJobIntegrateTest { @@ -35,7 +34,6 @@ protected JobConfiguration getJobConfiguration(final String jobName) { @Test public void assertJobRunning() { - BlockUtils.waitingShortTime(); assertDisabledRegCenterInfo(); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java index bebc278945..53c90c65e0 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java @@ -21,9 +21,13 @@ import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.awaitility.Awaitility; import org.junit.Test; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; public final class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrateTest { @@ -40,12 +44,11 @@ protected JobConfiguration getJobConfiguration(final String jobName) { @Test public void assertJobRunning() { - BlockUtils.waitingShortTime(); assertDisabledRegCenterInfo(); setJobEnable(); - while (!((DetailedFooJob) getElasticJob()).isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> + assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true)) + ); assertEnabledRegCenterInfo(); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java index 2bcfedc310..eea60ebd7b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java @@ -19,9 +19,13 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.awaitility.Awaitility; import org.junit.Test; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; public final class OneOffEnabledJobIntegrateTest extends EnabledJobIntegrateTest { @@ -38,9 +42,9 @@ protected JobConfiguration getJobConfiguration(final String jobName) { @Test public void assertJobInit() { - while (!((DetailedFooJob) getElasticJob()).isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true)) + ); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java index 5ce9bf7c7c..de4a7ec691 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java @@ -19,9 +19,13 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.awaitility.Awaitility; import org.junit.Test; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; public final class ScheduleEnabledJobIntegrateTest extends EnabledJobIntegrateTest { @@ -35,12 +39,12 @@ protected JobConfiguration getJobConfiguration(final String jobName) { return JobConfiguration.newBuilder(jobName, 3).cron("0/1 * * * * ?").shardingItemParameters("0=A,1=B,2=C") .jobListenerTypes("INTEGRATE-TEST", "INTEGRATE-DISTRIBUTE").overwrite(true).build(); } - + @Test public void assertJobInit() { - while (!((DetailedFooJob) getElasticJob()).isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> + assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true)) + ); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java index 33bf40ef86..9be96c5cb0 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -17,22 +17,24 @@ package org.apache.shardingsphere.elasticjob.lite.internal.annotation.integrate; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationUnShardingJob; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.awaitility.Awaitility; import org.junit.Before; import org.junit.Test; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + public final class OneOffEnabledJobTest extends BaseAnnotationTest { public OneOffEnabledJobTest() { @@ -55,9 +57,9 @@ public void assertEnabledRegCenterInfo() { @Test public void assertJobInit() { - while (!((AnnotationUnShardingJob) getElasticJob()).isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(((AnnotationUnShardingJob) getElasticJob()).isCompleted(), is(true)) + ); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java index d250341e3f..3acfe26049 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -17,22 +17,24 @@ package org.apache.shardingsphere.elasticjob.lite.internal.annotation.integrate; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; - import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationSimpleJob; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.awaitility.Awaitility; import org.junit.Before; import org.junit.Test; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + public final class ScheduleEnabledJobTest extends BaseAnnotationTest { public ScheduleEnabledJobTest() { @@ -57,9 +59,9 @@ public void assertEnabledRegCenterInfo() { @Test public void assertJobInit() { - while (!((AnnotationSimpleJob) getElasticJob()).isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(((AnnotationSimpleJob) getElasticJob()).isCompleted(), is(true)) + ); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index f73b900060..b672142222 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -87,5 +87,10 @@ h2 test + + org.awaitility + awaitility + test + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java index 25b948701a..6d9db0bcb7 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -17,18 +17,22 @@ package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl.AnnotationCustomJob; import org.apache.shardingsphere.elasticjob.lite.spring.core.scanner.ElasticJobScan; +import org.awaitility.Awaitility; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @SpringBootTest @@ -44,9 +48,9 @@ public static void init() { @Test public void assertDefaultBeanNameWithTypeJob() { - while (!AnnotationCustomJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(AnnotationCustomJob.isCompleted(), is(true)) + ); assertTrue(AnnotationCustomJob.isCompleted()); assertNotNull(applicationContext); assertNotNull(applicationContext.getBean("annotationCustomJobSchedule", ScheduleJobBootstrap.class)); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java index 6ded070407..94e60f1d9c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java @@ -19,7 +19,6 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; @@ -30,6 +29,7 @@ import org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.awaitility.Awaitility; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -45,6 +45,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; @@ -131,12 +132,13 @@ public void assertElasticJobProperties() { @Test public void assertJobScheduleCreation() { - assertNotNull(applicationContext); - Map elasticJobBeans = applicationContext.getBeansOfType(ElasticJob.class); - assertFalse(elasticJobBeans.isEmpty()); - Map jobBootstrapBeans = applicationContext.getBeansOfType(JobBootstrap.class); - assertFalse(jobBootstrapBeans.isEmpty()); - BlockUtils.waitingShortTime(); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> { + assertNotNull(applicationContext); + Map elasticJobBeans = applicationContext.getBeansOfType(ElasticJob.class); + assertFalse(elasticJobBeans.isEmpty()); + Map jobBootstrapBeans = applicationContext.getBeansOfType(JobBootstrap.class); + assertFalse(jobBootstrapBeans.isEmpty()); + }); } @Test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java index aa97974ea2..40f6c48b73 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java @@ -19,12 +19,17 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import org.apache.curator.CuratorZookeeperClient; +import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; +import org.awaitility.Awaitility; +import org.hamcrest.Matchers; -import java.io.File; import java.io.IOException; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.assertThat; @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class EmbedTestingServer { @@ -46,14 +51,11 @@ public static String getConnectionString() { * Start the server. */ public static void start() { - // sleep some time to avoid testServer intended stop. - long sleepTime = 1000L; - BlockUtils.sleep(sleepTime); if (null != testingServer) { return; } try { - testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + testingServer = new TestingServer(PORT, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON @@ -61,12 +63,24 @@ public static void start() { } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { - Thread.sleep(sleepTime); testingServer.close(); - } catch (final IOException | InterruptedException ex) { + } catch (final IOException ex) { RegExceptionHandler.handleException(ex); } })); } + try (CuratorZookeeperClient client = new CuratorZookeeperClient(getConnectionString(), + 60 * 1000, 500, null, + new ExponentialBackoffRetry(500, 3, 500 * 3))) { + client.start(); + Awaitility.await() + .atLeast(100L, TimeUnit.MILLISECONDS) + .atMost(500 * 60L, TimeUnit.MILLISECONDS) + .untilAsserted(() -> assertThat(client.isConnected(), Matchers.is(true))); + // CHECKSTYLE:OFF + } catch (Exception e) { + // CHECKSTYLE:ON + throw new RuntimeException(e); + } } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index de79e7f6e0..9d8ae8adda 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -114,5 +114,10 @@ commons-dbcp2 test + + org.awaitility + awaitility + test + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java index 9d70f3e5cc..b9227793e5 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -19,16 +19,20 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.FooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @RequiredArgsConstructor @@ -61,17 +65,17 @@ public void assertSpringJobBean() { } private void assertSimpleElasticJobBean() { - while (!FooSimpleElasticJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(FooSimpleElasticJob.isCompleted(), is(true)) + ); assertTrue(FooSimpleElasticJob.isCompleted()); assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding")); } private void assertThroughputDataflowElasticJobBean() { - while (!DataflowElasticJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(DataflowElasticJob.isCompleted(), is(true)) + ); assertTrue(DataflowElasticJob.isCompleted()); assertTrue(regCenter.isExisted("/" + throughputDataflowJobName + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index f68dea1ff0..45142a5d39 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -18,18 +18,22 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.FooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @RequiredArgsConstructor @@ -64,9 +68,9 @@ public void assertSpringJobBean() { private void assertSimpleElasticJobBean() { OneOffJobBootstrap bootstrap = applicationContext.getBean(simpleJobName, OneOffJobBootstrap.class); bootstrap.execute(); - while (!FooSimpleElasticJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(10L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(FooSimpleElasticJob.isCompleted(), is(true)) + ); assertTrue(FooSimpleElasticJob.isCompleted()); assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding")); } @@ -74,9 +78,9 @@ private void assertSimpleElasticJobBean() { private void assertThroughputDataflowElasticJobBean() { OneOffJobBootstrap bootstrap = applicationContext.getBean(throughputDataflowJobName, OneOffJobBootstrap.class); bootstrap.execute(); - while (!DataflowElasticJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(10L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(DataflowElasticJob.isCompleted(), is(true)) + ); assertTrue(DataflowElasticJob.isCompleted()); assertTrue(regCenter.isExisted("/" + throughputDataflowJobName + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 834b9771b0..109647dd1c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -18,16 +18,20 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/withJobRef.xml") @@ -55,9 +59,9 @@ public void assertSpringJobBean() { } private void assertSimpleElasticJobBean() { - while (!RefFooSimpleElasticJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(RefFooSimpleElasticJob.isCompleted(), is(true)) + ); assertTrue(RefFooSimpleElasticJob.isCompleted()); assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index 7b9ad4bc8b..7f556446a0 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -17,11 +17,10 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; -import static org.junit.Assert.assertTrue; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.awaitility.Awaitility; import org.junit.After; import org.junit.Test; import org.quartz.Scheduler; @@ -30,6 +29,12 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.util.ReflectionTestUtils; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; + @ContextConfiguration(locations = "classpath:META-INF/job/withJobType.xml") public final class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnit4SpringContextTests { @@ -41,18 +46,18 @@ public final class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnit private Scheduler scheduler; @After - public void tearDown() throws SchedulerException { - while (!scheduler.getCurrentlyExecutingJobs().isEmpty()) { - BlockUtils.waitingShortTime(); - } + public void tearDown() { + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(scheduler.getCurrentlyExecutingJobs().isEmpty(), is(true)) + ); JobRegistry.getInstance().getJobScheduleController(scriptJobName).shutdown(); } @Test public void jobScriptWithJobTypeTest() throws SchedulerException { - while (!regCenter.isExisted("/" + scriptJobName + "/sharding")) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(regCenter.isExisted("/" + scriptJobName + "/sharding"), is(true)) + ); scheduler = (Scheduler) ReflectionTestUtils.getField(JobRegistry.getInstance().getJobScheduleController(scriptJobName), "scheduler"); assertTrue(scheduler.isStarted()); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index d014f74c6c..47976d08f4 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -19,16 +19,20 @@ import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobRef.xml") @@ -58,9 +62,9 @@ public void assertSpringJobBean() { } private void assertOneOffSimpleElasticJobBean() { - while (!RefFooSimpleElasticJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(RefFooSimpleElasticJob.isCompleted(), is(true)) + ); assertTrue(RefFooSimpleElasticJob.isCompleted()); assertTrue(regCenter.isExisted("/" + oneOffSimpleJobName + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index fdc03bf695..c6f1f46dbb 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -17,16 +17,18 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.awaitility.Awaitility; import org.junit.After; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; +import java.util.concurrent.TimeUnit; + import static org.junit.Assert.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobType.xml") @@ -46,7 +48,8 @@ public void tearDown() { public void jobScriptWithJobTypeTest() { OneOffJobBootstrap bootstrap = applicationContext.getBean(scriptJobName, OneOffJobBootstrap.class); bootstrap.execute(); - BlockUtils.sleep(1000L); - assertTrue(regCenter.isExisted("/" + scriptJobName + "/sharding")); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertTrue(regCenter.isExisted("/" + scriptJobName + "/sharding")) + ); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index 5cc4ffdf24..76f461b52d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -18,16 +18,20 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.awaitility.Awaitility; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import java.util.concurrent.TimeUnit; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; @RequiredArgsConstructor @@ -55,9 +59,9 @@ public void assertSpringJobBean() { } private void assertSimpleElasticJobBean() { - while (!AnnotationSimpleJob.isCompleted()) { - BlockUtils.waitingShortTime(); - } + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + assertThat(AnnotationSimpleJob.isCompleted(), is(true)) + ); assertTrue(AnnotationSimpleJob.isCompleted()); assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java index 6bd6b56857..dfc432b280 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java @@ -17,14 +17,19 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.test; +import org.apache.curator.CuratorZookeeperClient; +import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.awaitility.Awaitility; +import org.hamcrest.Matchers; import org.springframework.test.context.TestContext; import org.springframework.test.context.support.AbstractTestExecutionListener; -import java.io.File; import java.io.IOException; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.assertThat; public final class EmbedZookeeperTestExecutionListener extends AbstractTestExecutionListener { @@ -34,13 +39,13 @@ public final class EmbedZookeeperTestExecutionListener extends AbstractTestExecu public void beforeTestClass(final TestContext testContext) { startEmbedTestingServer(); } - + private static void startEmbedTestingServer() { if (null != testingServer) { return; } try { - testingServer = new TestingServer(3181, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + testingServer = new TestingServer(3181, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON @@ -48,12 +53,24 @@ private static void startEmbedTestingServer() { } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { - BlockUtils.sleep(2000L); testingServer.close(); } catch (final IOException ex) { RegExceptionHandler.handleException(ex); } })); } + try (CuratorZookeeperClient client = new CuratorZookeeperClient(testingServer.getConnectString(), + 60 * 1000, 500, null, + new ExponentialBackoffRetry(500, 3, 500 * 3))) { + client.start(); + Awaitility.await() + .atLeast(100L, TimeUnit.MILLISECONDS) + .atMost(500 * 60L, TimeUnit.MILLISECONDS) + .untilAsserted(() -> assertThat(client.isConnected(), Matchers.is(true))); + // CHECKSTYLE:OFF + } catch (Exception e) { + // CHECKSTYLE:ON + throw new RuntimeException(e); + } } } diff --git a/pom.xml b/pom.xml index e56be37d11..9af552d722 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,7 @@ 4.12 2.2 4.8.0 + 4.2.0 0.15 3.8.0 @@ -347,6 +348,12 @@ ${aspectj.version} test + + org.awaitility + awaitility + ${awaitility.version} + test + From 095f5586fe61b12fdc5cdd44121466889c268c0f Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Wed, 13 Sep 2023 21:46:14 +0800 Subject: [PATCH 028/178] Migrate Junit4 to Junit Vintage and replace deprecated methods (#2259) --- elasticjob-api/pom.xml | 5 --- .../ElasticJobConfigurationTest.java | 2 +- .../elasticjob/api/JobConfigurationTest.java | 2 +- .../elasticjob-cloud-common/pom.xml | 4 --- .../pojo/CloudJobConfigurationPOJOTest.java | 2 +- .../rdb/StatisticRdbRepositoryTest.java | 2 +- .../elasticjob-cloud-executor/pom.xml | 4 --- .../executor/facade/CloudJobFacadeTest.java | 2 +- .../executor/local/LocalTaskExecutorTest.java | 2 +- .../cloud/executor/prod/TaskExecutorTest.java | 2 +- .../elasticjob-cloud-scheduler/pom.xml | 4 --- .../controller/CloudAppControllerTest.java | 2 +- .../controller/CloudJobControllerTest.java | 2 +- .../console/controller/CloudLoginTest.java | 2 +- .../CloudOperationControllerTest.java | 2 +- .../search/JobEventRdbSearchTest.java | 2 +- .../app/CloudAppConfigurationNodeTest.java | 2 +- .../app/CloudAppConfigurationServiceTest.java | 2 +- .../pojo/CloudAppConfigurationPOJOTest.java | 2 +- .../job/CloudJobConfigurationNodeTest.java | 2 +- .../job/CloudJobConfigurationServiceTest.java | 2 +- .../scheduler/context/JobContextTest.java | 2 +- .../env/BootstrapEnvironmentTest.java | 2 +- .../scheduler/ha/FrameworkIDServiceTest.java | 2 +- .../mesos/AppConstraintEvaluatorTest.java | 2 +- .../scheduler/mesos/FacadeServiceTest.java | 2 +- .../scheduler/mesos/JobTaskRequestTest.java | 2 +- .../scheduler/mesos/LaunchingTasksTest.java | 2 +- .../scheduler/mesos/LeasesQueueTest.java | 2 +- .../mesos/MesosStateServiceTest.java | 2 +- .../scheduler/mesos/ReconcileServiceTest.java | 2 +- .../scheduler/mesos/SchedulerEngineTest.java | 2 +- .../scheduler/mesos/TaskInfoDataTest.java | 2 +- .../mesos/TaskLaunchScheduledServiceTest.java | 2 +- .../TransientProducerRepositoryTest.java | 2 +- .../state/disable/app/DisableAppNodeTest.java | 2 +- .../state/disable/job/DisableJobNodeTest.java | 2 +- .../state/failover/FailoverNodeTest.java | 2 +- .../state/failover/FailoverServiceTest.java | 2 +- .../scheduler/state/ready/ReadyNodeTest.java | 2 +- .../state/ready/ReadyServiceTest.java | 2 +- .../state/running/RunningNodeTest.java | 2 +- .../state/running/RunningServiceTest.java | 2 +- .../statistics/StatisticManagerTest.java | 2 +- .../statistics/TaskResultMetaDataTest.java | 2 +- .../statistics/job/BaseStatisticJobTest.java | 2 +- .../job/JobRunningStatisticJobTest.java | 2 +- .../job/RegisteredJobStatisticJobTest.java | 2 +- .../job/TaskResultStatisticJobTest.java | 2 +- .../util/StatisticTimeUtilsTest.java | 2 +- .../cloud/scheduler/util/IOUtilsTest.java | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 4 --- ...obErrorHandlerPropertiesValidatorTest.java | 2 +- .../dingtalk/DingtalkJobErrorHandlerTest.java | 2 +- .../elasticjob-error-handler-email/pom.xml | 5 --- ...obErrorHandlerPropertiesValidatorTest.java | 2 +- .../email/EmailJobErrorHandlerTest.java | 2 +- .../elasticjob-error-handler-general/pom.xml | 5 --- .../handler/JobErrorHandlerFactoryTest.java | 2 +- .../JobErrorHandlerReloadableTest.java | 2 +- .../general/LogJobErrorHandlerTest.java | 2 +- .../elasticjob-error-handler-wechat/pom.xml | 4 --- ...obErrorHandlerPropertiesValidatorTest.java | 2 +- .../wechat/WechatJobErrorHandlerTest.java | 2 +- .../elasticjob-executor-kernel/pom.xml | 6 +--- .../item/JobItemExecutorFactoryTest.java | 2 +- .../executor/DataflowJobExecutorTest.java | 2 +- .../elasticjob-http-executor/pom.xml | 6 ---- .../http/executor/HttpJobExecutorTest.java | 2 +- .../executor/fixture/InternalController.java | 2 +- .../script/ScriptJobExecutorTest.java | 2 +- .../executor/SimpleJobExecutorTest.java | 2 +- .../elasticjob-executor-type/pom.xml | 4 --- .../elasticjob-tracing-api/pom.xml | 6 +--- .../tracing/JobTracingEventBusTest.java | 2 +- .../tracing/event/JobExecutionEventTest.java | 2 +- .../listener/TracingListenerFactoryTest.java | 2 +- ...YamlTracingConfigurationConverterTest.java | 2 +- .../elasticjob-tracing-rdb/pom.xml | 6 +--- .../DataSourceConfigurationTest.java | 2 +- .../datasource/DataSourceRegistryTest.java | 2 +- ...DataSourceTracingStorageConverterTest.java | 2 +- .../RDBTracingListenerConfigurationTest.java | 2 +- .../rdb/storage/RDBJobEventStorageTest.java | 2 +- ...lDataSourceConfigurationConverterTest.java | 2 +- .../elasticjob-infra-common/pom.xml | 6 +--- .../ElasticJobExecutorServiceTest.java | 2 +- .../ExecutorServiceReloadableTest.java | 2 +- .../context/ShardingItemParametersTest.java | 2 +- .../infra/context/TaskContextTest.java | 2 +- .../infra/env/HostExceptionTest.java | 2 +- .../elasticjob/infra/env/IpUtilsTest.java | 2 +- .../infra/exception/ExceptionUtilsTest.java | 2 +- .../JobConfigurationExceptionTest.java | 2 +- .../JobExecutionEnvironmentExceptionTest.java | 2 +- .../exception/JobStatisticExceptionTest.java | 2 +- .../exception/JobSystemExceptionTest.java | 2 +- .../handler/sharding/JobInstanceTest.java | 2 +- .../JobShardingStrategyFactoryTest.java | 2 +- ...rageAllocationJobShardingStrategyTest.java | 2 +- ...vitySortByNameJobShardingStrategyTest.java | 2 +- ...teServerByNameJobShardingStrategyTest.java | 2 +- .../JobExecutorServiceHandlerFactoryTest.java | 2 +- ...CPUUsageJobExecutorServiceHandlerTest.java | 2 +- ...leThreadJobExecutorServiceHandlerTest.java | 2 +- .../infra/json/GsonFactoryTest.java | 2 +- .../ElasticJobListenerFactoryTest.java | 2 +- .../infra/listener/ShardingContextsTest.java | 2 +- .../infra/pojo/JobConfigurationPOJOTest.java | 2 +- .../spi/ElasticJobServiceLoaderTest.java | 2 +- .../JobPropertiesValidateRuleTest.java | 2 +- .../elasticjob/infra/yaml/YamlEngineTest.java | 2 +- .../elasticjob-registry-center-api/pom.xml | 4 --- .../transaction/TransactionOperationTest.java | 2 +- .../pom.xml | 4 --- .../zookeeper/ZookeeperConfigurationTest.java | 2 +- .../ZookeeperRegistryCenterForAuthTest.java | 2 +- ...keeperRegistryCenterMiscellaneousTest.java | 2 +- .../ZookeeperRegistryCenterModifyTest.java | 2 +- ...eeperRegistryCenterQueryWithCacheTest.java | 2 +- ...erRegistryCenterQueryWithoutCacheTest.java | 2 +- ...ookeeperRegistryCenterTransactionTest.java | 2 +- .../ZookeeperRegistryCenterWatchTest.java | 2 +- ...erCuratorIgnoredExceptionProviderTest.java | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 5 --- .../restful/RegexPathMatcherTest.java | 2 +- .../restful/RegexUrlPatternMapTest.java | 2 +- .../pipeline/HandlerParameterDecoderTest.java | 2 +- .../pipeline/NettyRestfulServiceTest.java | 2 +- ...tfulServiceTrailingSlashSensitiveTest.java | 2 +- .../wrapper/QueryParameterMapTest.java | 2 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 4 --- .../impl/OneOffJobBootstrapTest.java | 2 +- .../disable/DisabledJobIntegrateTest.java | 2 +- .../ScheduleDisabledJobIntegrateTest.java | 2 +- .../enable/EnabledJobIntegrateTest.java | 2 +- .../enable/OneOffEnabledJobIntegrateTest.java | 2 +- .../ScheduleEnabledJobIntegrateTest.java | 2 +- .../annotation/JobAnnotationBuilderTest.java | 2 +- .../integrate/OneOffEnabledJobTest.java | 2 +- .../integrate/ScheduleEnabledJobTest.java | 2 +- .../config/ConfigurationServiceTest.java | 2 +- .../internal/failover/FailoverNodeTest.java | 2 +- .../failover/FailoverServiceTest.java | 2 +- .../internal/guarantee/GuaranteeNodeTest.java | 2 +- .../internal/instance/InstanceNodeTest.java | 2 +- .../instance/InstanceServiceTest.java | 2 +- .../listener/ListenerNotifierManagerTest.java | 2 +- .../internal/schedule/JobRegistryTest.java | 2 +- .../schedule/JobTriggerListenerTest.java | 2 +- .../internal/schedule/LiteJobFacadeTest.java | 2 +- .../lite/internal/server/ServerNodeTest.java | 2 +- .../DefaultJobClassNameProviderTest.java | 2 +- .../JobClassNameProviderFactoryTest.java | 2 +- .../sharding/ExecutionContextServiceTest.java | 2 +- .../sharding/ExecutionServiceTest.java | 2 +- .../internal/sharding/ShardingNodeTest.java | 2 +- .../sharding/ShardingServiceTest.java | 2 +- .../internal/storage/JobNodePathTest.java | 2 +- .../internal/storage/JobNodeStorageTest.java | 2 +- .../internal/util/SensitiveInfoUtilsTest.java | 2 +- .../elasticjob-lite-lifecycle/pom.xml | 4 --- .../lite/lifecycle/api/JobAPIFactoryTest.java | 2 +- .../lifecycle/domain/ShardingStatusTest.java | 2 +- .../reg/RegistryCenterFactoryTest.java | 2 +- .../settings/JobConfigurationAPIImplTest.java | 2 +- .../statistics/JobStatisticsAPIImplTest.java | 2 +- .../ServerStatisticsAPIImplTest.java | 2 +- .../ShardingStatisticsAPIImplTest.java | 2 +- .../pom.xml | 19 ------------ ...ElasticJobConfigurationPropertiesTest.java | 2 +- .../job/ElasticJobSpringBootScannerTest.java | 2 +- .../boot/job/ElasticJobSpringBootTest.java | 2 +- .../boot/job/fixture/EmbedTestingServer.java | 2 +- .../boot/reg/ZookeeperPropertiesTest.java | 2 +- .../elasticjob-lite-spring-core/pom.xml | 4 --- .../JobClassNameProviderFactoryTest.java | 2 +- .../spring/core/util/AopTargetUtilsTest.java | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 4 --- .../fixture/listener/SimpleCglibListener.java | 2 +- .../SimpleJdkDynamicProxyListener.java | 2 +- .../fixture/listener/SimpleListener.java | 2 +- .../fixture/listener/SimpleOnceListener.java | 2 +- .../job/AbstractJobSpringIntegrateTest.java | 2 +- .../AbstractOneOffJobSpringIntegrateTest.java | 6 ++-- .../job/JobSpringNamespaceWithRefTest.java | 2 +- .../job/JobSpringNamespaceWithTypeTest.java | 2 +- .../OneOffJobSpringNamespaceWithRefTest.java | 2 +- .../AbstractJobSpringIntegrateTest.java | 2 +- .../EmbedZookeeperTestExecutionListener.java | 2 +- pom.xml | 31 ++++++++++++++----- src/main/resources/checkstyle.xml | 2 +- src/main/resources/checkstyle_ci.xml | 2 +- 193 files changed, 200 insertions(+), 292 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index 2a682168f8..d9b5a29c63 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -36,10 +36,5 @@ org.projectlombok lombok - - - junit - junit - diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java index ecba0802e8..7e0f4ebca1 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import java.util.Arrays; import java.util.LinkedList; diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java index 5fdd70251d..700fdc798c 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java @@ -22,7 +22,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class JobConfigurationTest { diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index 23736afa0c..b7255cf6b4 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -102,10 +102,6 @@ org.apache.curator curator-test - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java index 5d69c13316..0d50aef213 100644 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class CloudJobConfigurationPOJOTest { diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java index 7b6b670a5f..97ba36e00f 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public class StatisticRdbRepositoryTest { diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index 5652751c18..0aec8a88b3 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -50,10 +50,6 @@ org.projectlombok lombok - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java index 475ac792b3..d7436915ba 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java @@ -38,7 +38,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java index cf6aba0be0..c62785d5a9 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java @@ -29,7 +29,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class LocalTaskExecutorTest { diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java index 06a915c0f8..ad486cd282 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java @@ -40,7 +40,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index b37a790372..e0443c16db 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -98,10 +98,6 @@ org.apache.curator curator-test - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java index 6cb3bfdf2c..e4f4e8c628 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java @@ -30,7 +30,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java index e7e861fbbd..9752437d55 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java @@ -43,7 +43,7 @@ import java.util.UUID; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java index 7ff522986a..957dbe38d1 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java @@ -34,7 +34,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; @RunWith(MockitoJUnitRunner.class) public class CloudLoginTest extends AbstractCloudControllerTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java index 2f4d5c7188..2dd6ceb86f 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java @@ -26,7 +26,7 @@ import org.mockito.junit.MockitoJUnitRunner; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java index 34287fd728..87d9b0fdca 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java @@ -36,7 +36,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java index 430b73d73f..ca8a814783 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class CloudAppConfigurationNodeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java index f5a84c37cf..d8e4d6694d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java index 0cd975d649..d5d64edcdf 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class CloudAppConfigurationPOJOTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java index bc32a10b54..c09ceb2460 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class CloudJobConfigurationNodeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java index 97428abed7..8895e71710 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java index 4e7990b7ed..1cc83e307d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobContextTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java index 79f3e1a07c..e95d6de01f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java @@ -29,7 +29,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class BootstrapEnvironmentTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java index 0995bbf661..8c1148b5b1 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java @@ -27,7 +27,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java index ac943c555c..d7e7dd8ed4 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java @@ -44,7 +44,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java index 30299bc3a4..0c3b321519 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java @@ -52,7 +52,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java index cc1a384487..accda6d870 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java @@ -28,7 +28,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobTaskRequestTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java index c87528a7ef..83f8c94b70 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java @@ -37,7 +37,7 @@ import java.util.List; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java index 3de8dcdc7e..2f388e4373 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class LeasesQueueTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java index c13a34dbb4..4e42760485 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java @@ -30,7 +30,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java index 9e4bece085..1842032da7 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java @@ -36,7 +36,7 @@ import java.util.Set; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java index d4122d221d..4ec2844af0 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java @@ -43,7 +43,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java index fef9188a1f..5f0491142d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java @@ -27,7 +27,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class TaskInfoDataTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java index 3ca33440d9..1c11bc7997 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java @@ -51,7 +51,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java index 85737b5e99..c88dde8162 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java index 54b84dd925..641d853849 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class DisableAppNodeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java index 709a90520a..d434f556fe 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class DisableJobNodeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java index f3d7fdcf3c..73e13bb11f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java @@ -22,7 +22,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class FailoverNodeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java index 2fddbf971d..640b0420ce 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java @@ -42,7 +42,7 @@ import java.util.UUID; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java index 34104f3e22..5996fdc56f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ReadyNodeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java index 6621a7d5a3..183266397e 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java @@ -39,7 +39,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java index 1590c5797a..db7887fe84 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class RunningNodeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java index 95e4e160e4..407bad820c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java @@ -38,7 +38,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java index b70a7d0ad7..5db25d65a7 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java @@ -41,7 +41,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.reset; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java index 0680293c7c..b2b9a83827 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import org.junit.Before; import org.junit.Test; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java index b1e71c68d1..8e36a745e2 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import java.util.Date; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java index 7095bcdc90..459da44d7c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java @@ -41,7 +41,7 @@ import java.util.Set; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java index 983ea1d373..13d286b5c2 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java @@ -34,7 +34,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java index cc07ad7c97..c260fb8d5b 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java @@ -32,7 +32,7 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java index 1076118f91..50d006a359 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java index f618b60f8d..eda0de8b2c 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java @@ -25,7 +25,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class IOUtilsTest { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index 97856fbb02..5fb576fede 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -63,10 +63,6 @@ org.mockito mockito-core - - junit - junit - ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index 5942484e27..b5e373c480 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -25,7 +25,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class DingtalkJobErrorHandlerPropertiesValidatorTest { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index 58f1685cf6..ec6dc3c8ed 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -36,7 +36,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class DingtalkJobErrorHandlerTest { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index fbc031bcfa..b5963a304e 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -49,11 +49,6 @@ javax.mail - - junit - junit - - org.mockito mockito-core diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index 7bd2a1e499..d2b32adee8 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -25,7 +25,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class EmailJobErrorHandlerPropertiesValidatorTest { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index dd3375932b..a22525f4e9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -40,7 +40,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 83863d7d2c..8886080229 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -47,11 +47,6 @@ lombok - - junit - junit - - org.mockito mockito-core diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java index 51f93ebff1..6ddb60a1a0 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java @@ -25,7 +25,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobErrorHandlerFactoryTest { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java index 48a7559f12..ddf7e2d6b4 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java index 4b2277de71..df1f7c93d9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java @@ -31,7 +31,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class LogJobErrorHandlerTest { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index d2ef6e8415..8c1dc0b579 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -63,10 +63,6 @@ org.mockito mockito-core - - junit - junit - ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index 3eff5759f6..fed5e7e735 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -25,7 +25,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class WechatJobErrorHandlerPropertiesValidatorTest { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index e30470c80e..82291aeb4e 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -36,7 +36,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class WechatJobErrorHandlerTest { diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index aba4fb377a..0752e94b35 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -52,11 +52,7 @@ org.projectlombok lombok - - - junit - junit - + org.mockito mockito-core diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java index c1607fd6be..6eeab3635e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java @@ -26,7 +26,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobItemExecutorFactoryTest { diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java index c73696154e..4cccb4244e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java @@ -33,7 +33,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index 9b2bec4b23..65ff59805b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -45,12 +45,6 @@ lombok provided - - - junit - junit - test - org.slf4j diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index c89b0fad2a..371c504370 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -39,7 +39,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java index 63d209eef3..16d56c19c9 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java @@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; @Slf4j public final class InternalController implements RestfulController { diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index 672bab53b1..c1ccb680fd 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -35,7 +35,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java index 5079409a15..e8152bd7ce 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java @@ -28,7 +28,7 @@ import org.mockito.junit.MockitoJUnitRunner; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index 4a9947a43a..2c6aecb8eb 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -39,10 +39,6 @@ org.projectlombok lombok - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index fb73c3c862..c405795ff0 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -56,11 +56,7 @@ org.projectlombok lombok - - - junit - junit - + org.mockito mockito-core diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java index 3d1cd73cb1..0bf72652aa 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java @@ -33,7 +33,7 @@ import java.lang.reflect.Field; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java index 12406435f3..a0b6740f89 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java @@ -23,7 +23,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class JobExecutionEventTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java index bc6c0fefb2..73ad659d0c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class TracingListenerFactoryTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java index 7f2993ef2b..69d3b142bf 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -23,7 +23,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class YamlTracingConfigurationConverterTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index d94fd3b328..70674988d2 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -37,11 +37,7 @@ org.projectlombok lombok - - - junit - junit - + org.mockito mockito-core diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java index 8a1439e399..347e7c4a51 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class DataSourceConfigurationTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java index bf311d6cf6..69ba1f6bd6 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java index 66639698d2..a2f6b3b7d3 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java @@ -34,7 +34,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.when; diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java index d67a191c2f..accf981ffd 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java @@ -22,7 +22,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class RDBTracingListenerConfigurationTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index d649febf14..73d4ed5bc4 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class RDBJobEventStorageTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java index 896509bc5e..e8343dece4 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java @@ -25,7 +25,7 @@ import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class YamlDataSourceConfigurationConverterTest { diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 005d783eb6..858eb77658 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -59,11 +59,7 @@ org.projectlombok lombok - - - junit - junit - + org.mockito mockito-core diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index b3a4e94319..9f847c3794 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -25,7 +25,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ElasticJobExecutorServiceTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java index 3a64c83f85..01f6ce92cd 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java @@ -31,7 +31,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java index 8d0bb22481..d3ff6ddae1 100755 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java @@ -25,7 +25,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ShardingItemParametersTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java index fdea68deee..b79085b9cf 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class TaskContextTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java index 4fdd7a1718..6b350ce261 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java @@ -22,7 +22,7 @@ import java.io.IOException; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class HostExceptionTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index dccd668fb6..158bd8bf1a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java index 32b0e534c4..bca6b78832 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ExceptionUtilsTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java index e5c0a281ca..dc05af367c 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobConfigurationExceptionTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java index e2c06f8f91..5064ea34fb 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobExecutionEnvironmentExceptionTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java index ae518a145c..e624b932a4 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class JobStatisticExceptionTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java index 12d1f0f0a7..363a1b6aca 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobSystemExceptionTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java index 8c223782e2..9b1f087206 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java @@ -22,7 +22,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobInstanceTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java index dfb3171778..f6eb14c32f 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobShardingStrategyFactoryTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java index 4ef47654c8..b4e6ab51a0 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java @@ -28,7 +28,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class AverageAllocationJobShardingStrategyTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java index cc4c055a10..b9dc84eab8 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java @@ -27,7 +27,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class OdevitySortByNameJobShardingStrategyTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java index 8dbae74190..04b3f7e198 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java @@ -27,7 +27,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class RotateServerByNameJobShardingStrategyTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java index fe8a33a03c..2dc51b2c51 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java @@ -23,7 +23,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobExecutorServiceHandlerFactoryTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java index a967a40442..49d1151c3e 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class CPUUsageJobExecutorServiceHandlerTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java index 0265f1d6c3..7e15268310 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class SingleThreadJobExecutorServiceHandlerTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java index bda969514e..40e4ae828f 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java @@ -26,7 +26,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class GsonFactoryTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java index 45795aa556..2e94d4992d 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java @@ -22,7 +22,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ElasticJobListenerFactoryTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java index bb0f29b1af..4c4cd7d3f2 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java @@ -24,7 +24,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ShardingContextsTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java index 8ae62a6819..5129280b87 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java @@ -27,7 +27,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class JobConfigurationPOJOTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java index ec1fea91b8..063ea3b2e4 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java @@ -25,7 +25,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ElasticJobServiceLoaderTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java index 399e6b34ed..ec652a6633 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java @@ -22,7 +22,7 @@ import java.util.Properties; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobPropertiesValidateRuleTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java index 53aaff61a2..fee915e059 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java @@ -22,7 +22,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class YamlEngineTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index 6ffc503cfc..46951a2acf 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -35,10 +35,6 @@ org.projectlombok lombok - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java index d788d99878..75be29dc20 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class TransactionOperationTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index af5ef7dbdd..c2f3614a9a 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -55,10 +55,6 @@ org.apache.curator curator-test - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java index 737e0407b9..c7f8e7b3c0 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperConfigurationTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index daf16cee26..6167856359 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -28,7 +28,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterForAuthTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java index fe698f9efe..7c79aaaf9b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterMiscellaneousTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index 81a4cc7b53..b2cfe34bcb 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ZookeeperRegistryCenterModifyTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index 3494ace785..fd66306e86 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -25,7 +25,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterQueryWithCacheTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index af0767c686..94e10906a2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -29,7 +29,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ZookeeperRegistryCenterQueryWithoutCacheTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index 072d9a63b0..dd619ef34e 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -30,7 +30,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterTransactionTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index 50b4c08e3f..58a08d60be 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -31,7 +31,7 @@ import java.util.concurrent.ThreadFactory; import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterWatchTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java index efb06c8964..1508ed4b07 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java @@ -26,7 +26,7 @@ import java.util.List; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperCuratorIgnoredExceptionProviderTest { diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index f78e7d7209..9d0b82509d 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -47,11 +47,6 @@ slf4j-jdk14 true - - junit - junit - test - org.mockito mockito-core diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java index 93ac5ce8c2..aa302c2a97 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class RegexPathMatcherTest { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java index fa677485ad..ea977967f5 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class RegexUrlPatternMapTest { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java index 85f6d82908..42ad6d0dcc 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java @@ -41,7 +41,7 @@ import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class HandlerParameterDecoderTest { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java index 0018b18af9..3cbf57eb6f 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java @@ -43,7 +43,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class NettyRestfulServiceTest { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java index 9caa2748d2..d089cad40c 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java @@ -32,7 +32,7 @@ import java.nio.charset.StandardCharsets; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class NettyRestfulServiceTrailingSlashSensitiveTest { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java index 4d8769b8cc..52d724150b 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java @@ -28,7 +28,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class QueryParameterMapTest { diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index a4898adb53..1307b5d137 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -98,10 +98,6 @@ org.apache.curator curator-test - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java index c76bf3af2d..38e0411e89 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -36,7 +36,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class OneOffJobBootstrapTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java index bca4a25ac7..3878df797d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java @@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public abstract class DisabledJobIntegrateTest extends BaseIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java index 53c90c65e0..99c6310f0e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java index 2c39eafb5e..1d50d84e54 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java @@ -30,7 +30,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public abstract class EnabledJobIntegrateTest extends BaseIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java index eea60ebd7b..411f6776cc 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java @@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class OneOffEnabledJobIntegrateTest extends EnabledJobIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java index de4a7ec691..9772b0ce19 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java @@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ScheduleEnabledJobIntegrateTest extends EnabledJobIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java index 25b73e555b..3986e8f518 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertTrue; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java index 9be96c5cb0..0d88da1869 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class OneOffEnabledJobTest extends BaseAnnotationTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java index 3acfe26049..f81530b3db 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ScheduleEnabledJobTest extends BaseAnnotationTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java index 396704d350..3db03b76ae 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java @@ -34,7 +34,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java index 0ef550f1ac..a545c59fd9 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class FailoverNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java index d946078d45..f581262cf7 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java @@ -38,7 +38,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java index 06cbc51acd..5c0c9fbde1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class GuaranteeNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java index cf946370fa..0d4433f251 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class InstanceNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java index 2e7cd55de1..0b056c6573 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java @@ -32,7 +32,7 @@ import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java index cdba0cc215..fea0bebf6e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java @@ -23,7 +23,7 @@ import java.util.concurrent.Executor; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.notNullValue; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java index 871b5eb4c8..428d902c3b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java index fb5787d763..e827358fc5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java @@ -30,7 +30,7 @@ import java.util.Date; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java index 1a4171a0da..cb6d9a679c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java @@ -40,7 +40,7 @@ import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java index dea0a442d1..742acdcbb8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; public final class ServerNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java index fc7cda6799..96e6c21d2a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java @@ -22,7 +22,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class DefaultJobClassNameProviderTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java index 66857f5519..0a76cf6633 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobClassNameProviderFactoryTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java index 77d04eab37..a99423e5e0 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java @@ -37,7 +37,7 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java index aeed473fa7..d05b8ebc5f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java @@ -38,7 +38,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.lenient; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java index 8f540f1dbc..9beb7687e8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ShardingNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java index 75b38b9f18..e52451003f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java @@ -41,7 +41,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.lenient; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java index 942843d386..6f3000d503 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobNodePathTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java index bc2b28b8b5..a7c4a04ac1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java @@ -36,7 +36,7 @@ import java.util.concurrent.Executor; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java index c739889fae..d8e2f4bd51 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java @@ -23,7 +23,7 @@ import java.util.List; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class SensitiveInfoUtilsTest { diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index d736066763..232b8c53ba 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -51,10 +51,6 @@ org.apache.curator curator-test - - junit - junit - org.mockito mockito-core diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java index 63eea654c9..1079997705 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java @@ -21,7 +21,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class JobAPIFactoryTest extends AbstractEmbedZookeeperBaseTest { diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java index fcabea55ea..30d0777fcd 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java @@ -20,7 +20,7 @@ import org.junit.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class ShardingStatusTest { diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java index 9305e8bca4..beadc1e69e 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java @@ -27,7 +27,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class RegistryCenterFactoryTest extends AbstractEmbedZookeeperBaseTest { diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java index 4e0fbb49d6..d4ccad8ca7 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java index d0d64973eb..f17b2b26ca 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java @@ -31,7 +31,7 @@ import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class) diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java index eaa1ed8ca0..4b4e8090d3 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java @@ -30,7 +30,7 @@ import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.fail; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java index 6a69e1a77a..c89b605c45 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java @@ -29,7 +29,7 @@ import java.util.Arrays; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index b672142222..c38fc92841 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -57,25 +57,6 @@ org.springframework.boot spring-boot-starter-test test - - - org.junit.vintage - junit-vintage-engine - - - org.junit.jupiter - junit-jupiter - - - org.mockito - mockito-junit-jupiter - - - - - junit - junit - test org.apache.curator diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java index 52f78a8c7c..4ed9da9ce4 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import java.util.Collections; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java index 6d9db0bcb7..2a3607daf8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @SpringBootTest diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java index 94e60f1d9c..59d9469c8e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java @@ -52,7 +52,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @SpringBootTest diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java index 40f6c48b73..c1f4e16e16 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java @@ -29,7 +29,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class EmbedTestingServer { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java index ed02fa0dd2..66432d9599 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.junit.Test; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index b48d41b71d..aef3f0fe58 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -56,10 +56,6 @@ org.projectlombok lombok - - junit - junit - org.springframework spring-test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java index a7370f361a..af4107db93 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.core.setup; import static org.hamcrest.CoreMatchers.instanceOf; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProviderFactory; import org.junit.Test; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java index 35e29575eb..9f7b6aea62 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index 9d8ae8adda..8dc4c821f8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -74,10 +74,6 @@ org.apache.curator curator-test - - junit - junit - org.springframework spring-test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleCglibListener.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleCglibListener.java index de63269bf2..3d3f8d6882 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleCglibListener.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleCglibListener.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class SimpleCglibListener implements ElasticJobListener { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java index fe883e1d61..1328b999c1 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class SimpleJdkDynamicProxyListener implements ElasticJobListener { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleListener.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleListener.java index 1d3b86573b..1b4609d57b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleListener.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleListener.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class SimpleListener implements ElasticJobListener { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleOnceListener.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleOnceListener.java index a697375fc9..ef30f50bf4 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -23,7 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public class SimpleOnceListener extends AbstractDistributeOnceElasticJobListener { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java index b9227793e5..879d953f94 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @RequiredArgsConstructor diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index 45142a5d39..8bb75a19f7 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @RequiredArgsConstructor @@ -68,7 +68,7 @@ public void assertSpringJobBean() { private void assertSimpleElasticJobBean() { OneOffJobBootstrap bootstrap = applicationContext.getBean(simpleJobName, OneOffJobBootstrap.class); bootstrap.execute(); - Awaitility.await().atMost(10L, TimeUnit.MINUTES).untilAsserted(() -> + Awaitility.await().atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(FooSimpleElasticJob.isCompleted(), is(true)) ); assertTrue(FooSimpleElasticJob.isCompleted()); @@ -78,7 +78,7 @@ private void assertSimpleElasticJobBean() { private void assertThroughputDataflowElasticJobBean() { OneOffJobBootstrap bootstrap = applicationContext.getBean(throughputDataflowJobName, OneOffJobBootstrap.class); bootstrap.execute(); - Awaitility.await().atMost(10L, TimeUnit.MINUTES).untilAsserted(() -> + Awaitility.await().atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(DataflowElasticJob.isCompleted(), is(true)) ); assertTrue(DataflowElasticJob.isCompleted()); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 109647dd1c..438b4046e2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/withJobRef.xml") diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index 7f556446a0..4b511053d8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/withJobType.xml") diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index 47976d08f4..d7c6af6323 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobRef.xml") diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index 76f461b52d..98f7d67cce 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertTrue; @RequiredArgsConstructor diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java index dfc432b280..1e8ff5988c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java @@ -29,7 +29,7 @@ import java.io.IOException; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertThat; +import static org.hamcrest.MatcherAssert.assertThat; public final class EmbedZookeeperTestExecutionListener extends AbstractTestExecutionListener { diff --git a/pom.xml b/pom.xml index 9af552d722..bf99960b2f 100644 --- a/pom.xml +++ b/pom.xml @@ -71,16 +71,17 @@ 8.0.16 1.4.184 - 4.12 + 4.13.2 + 5.10.0 2.2 - 4.8.0 + 4.11.0 4.2.0 0.15 3.8.0 2.7 3.3.0 - 2.22.2 + 3.1.2 2.18.1 3.4 1.0.0 @@ -354,8 +355,28 @@ ${awaitility.version} test + + org.junit + junit-bom + ${junit5.version} + pom + import + + + + + junit + junit + test + + + org.junit.vintage + junit-vintage-engine + test + + apache-shardingsphere-elasticjob-${project.version} @@ -386,9 +407,6 @@ org.apache.maven.plugins maven-surefire-plugin ${maven-surefire-plugin.version} - - false - org.apache.maven.plugins @@ -704,7 +722,6 @@ maven-surefire-plugin - false @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index 7a3b8baa85..496dca007c 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -117,7 +117,7 @@ - + diff --git a/src/main/resources/checkstyle_ci.xml b/src/main/resources/checkstyle_ci.xml index 4be80579a5..ba0e83d9ef 100644 --- a/src/main/resources/checkstyle_ci.xml +++ b/src/main/resources/checkstyle_ci.xml @@ -112,7 +112,7 @@ - + From caab1ea5be934b854b476ddec5ca6ed867d6e3e3 Mon Sep 17 00:00:00 2001 From: zjx990 <66360103+zjx990@users.noreply.github.com> Date: Thu, 14 Sep 2023 00:34:55 +0800 Subject: [PATCH 029/178] Update FAQ document about service fake death (#2262) * Update FAQ document about service fake death --------- Co-authored-by: zhaojiaxu3 --- docs/content/faq/_index.cn.md | 19 +++++++++++++++++++ docs/content/faq/_index.en.md | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docs/content/faq/_index.cn.md b/docs/content/faq/_index.cn.md index 8d54892615..18cd5dbe09 100644 --- a/docs/content/faq/_index.cn.md +++ b/docs/content/faq/_index.cn.md @@ -129,3 +129,22 @@ Mesos 相关请参考 [Apache Mesos](https://mesos.apache.org/)。 1. 指定网卡 eno1:`-Delasticjob.preferred.network.interface=eno1`。 1. 指定IP地址 192.168.0.100:`-Delasticjob.preferred.network.ip=192.168.0.100`。 1. 泛指IP地址(正则表达式) 192.168.*:`-Delasticjob.preferred.network.ip=192.168.*`。 + +## 15. zk授权升级,在滚动部署过程中出现实例假死,回退到历史版本也依然存在假死。 + +回答: + +在滚动部署过程中,会触发竞争选举leader,有密码的实例会给zk目录加密导致无密码的实例不可访问,最终导致整体选举阻塞。 + +例如: + +通过日志可以发现会抛出-102异常: + +```bash +xxxx-07-27 22:33:55.224 [DEBUG] [localhost-startStop-1-EventThread] [] [] [] - o.a.c.f.r.c.TreeCache : processResult: CuratorEventImpl{type=GET_DATA, resultCode=-102, path='/xxx/leader/election/latch/_c_bccccdcc-1134-4e0a-bb52-59a13836434a-latch-0000000047', name='null', children=null, context=null, stat=null, data=null, watchedEvent=null, aclList=null} +``` + +解决方案: + +1.如果您在升级的过程中出现回退历史版本也依然假死的问题,建议删除zk上所有作业目录,之后再重启历史版本。 +2.计算出合理的作业执行间隙,比如晚上21:00-21:30作业不会触发,在此期间先将实例全部停止,然后将带密码的版本全部部署上线。 \ No newline at end of file diff --git a/docs/content/faq/_index.en.md b/docs/content/faq/_index.en.md index 20d32efe95..976d2b8860 100644 --- a/docs/content/faq/_index.en.md +++ b/docs/content/faq/_index.en.md @@ -128,3 +128,20 @@ For example 1. specify the interface eno1: `-Delasticjob.preferred.network.interface=eno1`. 1. specify network addresses, 192.168.0.100: `-Delasticjob.preferred.network.ip=192.168.0.100`. 1. specify network addresses for regular expressions, 192.168.*: `-Delasticjob.preferred.network.ip=192.168.*`. + +## 15. During the zk authorization upgrade process, there was a false death of the instance during the rolling deployment process, and even if the historical version was rolled back, there was still false death. + +Answer: + +During the rolling deployment process, competitive election leaders will be triggered, and instances with passwords will encrypt the zk directory, making instances without passwords inaccessible, ultimately leading to overall election blocking. + +For example + +Through the logs, it can be found that an -102 exception will be thrown: + +```bash +xxxx-07-27 22:33:55.224 [DEBUG] [localhost-startStop-1-EventThread] [] [] [] - o.a.c.f.r.c.TreeCache : processResult: CuratorEventImpl{type=GET_DATA, resultCode=-102, path='/xxx/leader/election/latch/_c_bccccdcc-1134-4e0a-bb52-59a13836434a-latch-0000000047', name='null', children=null, context=null, stat=null, data=null, watchedEvent=null, aclList=null} +``` + +1.If you encounter the issue of returning to the historical version and still pretending to be dead during the upgrade process, it is recommended to delete all job directories on zk and restart the historical version afterwards. +2.Calculate a reasonable job execution gap, such as when the job will not trigger from 21:00 to 21:30 in the evening. During this period, first stop all instances, and then deploy all versions with passwords online. \ No newline at end of file From 2409b79d7fc470433c52f23f5df4ed4046f5c472 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Mon, 18 Sep 2023 13:53:03 +0800 Subject: [PATCH 030/178] Migrate from Junit Vintage to Junit Jupiter --- .../ElasticJobConfigurationTest.java | 13 +- .../elasticjob/api/JobConfigurationTest.java | 21 ++- .../elasticjob-cloud-common/pom.xml | 8 - .../pojo/CloudJobConfigurationPOJOTest.java | 8 +- .../rdb/StatisticRdbRepositoryTest.java | 10 +- .../elasticjob-cloud-executor/pom.xml | 8 - .../executor/facade/CloudJobFacadeTest.java | 14 +- .../executor/local/LocalTaskExecutorTest.java | 10 +- .../prod/DaemonTaskSchedulerTest.java | 16 +- .../cloud/executor/prod/TaskExecutorTest.java | 14 +- .../executor/prod/TaskExecutorThreadTest.java | 8 +- .../elasticjob-cloud-scheduler/pom.xml | 8 - .../console/AbstractCloudControllerTest.java | 18 +- .../controller/CloudAppControllerTest.java | 8 +- .../controller/CloudJobControllerTest.java | 8 +- .../console/controller/CloudLoginTest.java | 8 +- .../CloudOperationControllerTest.java | 10 +- .../search/JobEventRdbSearchTest.java | 12 +- .../CloudAppConfigurationListenerTest.java | 12 +- .../app/CloudAppConfigurationNodeTest.java | 2 +- .../app/CloudAppConfigurationServiceTest.java | 12 +- .../pojo/CloudAppConfigurationPOJOTest.java | 4 +- .../CloudJobConfigurationListenerTest.java | 12 +- .../job/CloudJobConfigurationNodeTest.java | 2 +- .../job/CloudJobConfigurationServiceTest.java | 12 +- .../scheduler/context/JobContextTest.java | 2 +- .../env/BootstrapEnvironmentTest.java | 4 +- .../scheduler/ha/FrameworkIDServiceTest.java | 14 +- .../mesos/AppConstraintEvaluatorTest.java | 16 +- .../scheduler/mesos/FacadeServiceTest.java | 16 +- .../scheduler/mesos/JobTaskRequestTest.java | 4 +- .../scheduler/mesos/LaunchingTasksTest.java | 12 +- .../scheduler/mesos/LeasesQueueTest.java | 4 +- .../mesos/MesosStateServiceTest.java | 8 +- .../scheduler/mesos/ReconcileServiceTest.java | 14 +- .../scheduler/mesos/SchedulerEngineTest.java | 12 +- .../scheduler/mesos/SchedulerServiceTest.java | 12 +- .../mesos/SupportedExtractionTypeTest.java | 6 +- .../scheduler/mesos/TaskInfoDataTest.java | 4 +- .../mesos/TaskLaunchScheduledServiceTest.java | 16 +- .../scheduler/producer/ProducerJobTest.java | 12 +- .../producer/ProducerManagerTest.java | 43 +++-- .../TransientProducerRepositoryTest.java | 12 +- .../TransientProducerSchedulerTest.java | 12 +- .../app/CloudAppDisableListenerTest.java | 12 +- .../state/disable/app/DisableAppNodeTest.java | 2 +- .../disable/app/DisableAppServiceTest.java | 16 +- .../job/CloudJobDisableListenerTest.java | 12 +- .../state/disable/job/DisableJobNodeTest.java | 2 +- .../disable/job/DisableJobServiceTest.java | 16 +- .../state/failover/FailoverNodeTest.java | 2 +- .../state/failover/FailoverServiceTest.java | 14 +- .../scheduler/state/ready/ReadyNodeTest.java | 2 +- .../state/ready/ReadyServiceTest.java | 14 +- .../state/running/RunningNodeTest.java | 2 +- .../state/running/RunningServiceTest.java | 22 +-- .../statistics/StatisticManagerTest.java | 18 +- .../statistics/StatisticsSchedulerTest.java | 12 +- .../statistics/TaskResultMetaDataTest.java | 8 +- .../statistics/job/BaseStatisticJobTest.java | 14 +- .../job/JobRunningStatisticJobTest.java | 14 +- .../job/RegisteredJobStatisticJobTest.java | 12 +- .../job/TaskResultStatisticJobTest.java | 12 +- .../util/StatisticTimeUtilsTest.java | 2 +- .../cloud/scheduler/util/IOUtilsTest.java | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 4 - ...obErrorHandlerPropertiesValidatorTest.java | 15 +- .../dingtalk/DingtalkJobErrorHandlerTest.java | 14 +- .../elasticjob-error-handler-email/pom.xml | 11 +- ...obErrorHandlerPropertiesValidatorTest.java | 15 +- .../email/EmailJobErrorHandlerTest.java | 16 +- .../elasticjob-error-handler-general/pom.xml | 10 - .../handler/JobErrorHandlerFactoryTest.java | 8 +- .../JobErrorHandlerReloadableTest.java | 14 +- .../general/IgnoreJobErrorHandlerTest.java | 2 +- .../general/LogJobErrorHandlerTest.java | 10 +- .../general/ThrowJobErrorHandlerTest.java | 13 +- .../elasticjob-error-handler-wechat/pom.xml | 4 - ...obErrorHandlerPropertiesValidatorTest.java | 15 +- .../wechat/WechatJobErrorHandlerTest.java | 14 +- .../elasticjob-executor-kernel/pom.xml | 9 - .../executor/ElasticJobExecutorTest.java | 77 ++++---- .../item/JobItemExecutorFactoryTest.java | 13 +- .../executor/DataflowJobExecutorTest.java | 12 +- .../http/executor/HttpJobExecutorTest.java | 55 +++--- .../script/ScriptJobExecutorTest.java | 31 ++-- .../executor/SimpleJobExecutorTest.java | 12 +- .../elasticjob-executor-type/pom.xml | 8 - .../elasticjob-tracing-api/pom.xml | 8 - .../tracing/JobTracingEventBusTest.java | 8 +- .../tracing/event/JobExecutionEventTest.java | 10 +- .../listener/TracingListenerFactoryTest.java | 19 +- .../TracingStorageConverterFactoryTest.java | 6 +- ...YamlTracingConfigurationConverterTest.java | 6 +- .../elasticjob-tracing-rdb/pom.xml | 8 - .../DataSourceConfigurationTest.java | 6 +- .../datasource/DataSourceRegistryTest.java | 8 +- ...DataSourceTracingStorageConverterTest.java | 23 ++- .../RDBTracingListenerConfigurationTest.java | 10 +- .../rdb/listener/RDBTracingListenerTest.java | 12 +- .../rdb/storage/RDBJobEventStorageTest.java | 16 +- ...lDataSourceConfigurationConverterTest.java | 4 +- .../elasticjob-infra-common/pom.xml | 8 - .../ElasticJobExecutorServiceTest.java | 6 +- .../ExecutorServiceReloadableTest.java | 14 +- .../context/ShardingItemParametersTest.java | 11 +- .../infra/context/TaskContextTest.java | 6 +- .../infra/env/HostExceptionTest.java | 2 +- .../elasticjob/infra/env/IpUtilsTest.java | 8 +- .../elasticjob/infra/env/TimeServiceTest.java | 4 +- .../infra/exception/ExceptionUtilsTest.java | 4 +- .../JobConfigurationExceptionTest.java | 2 +- .../JobExecutionEnvironmentExceptionTest.java | 2 +- .../exception/JobStatisticExceptionTest.java | 2 +- .../exception/JobSystemExceptionTest.java | 2 +- .../handler/sharding/JobInstanceTest.java | 2 +- .../JobShardingStrategyFactoryTest.java | 8 +- ...rageAllocationJobShardingStrategyTest.java | 2 +- ...vitySortByNameJobShardingStrategyTest.java | 2 +- ...teServerByNameJobShardingStrategyTest.java | 2 +- .../JobExecutorServiceHandlerFactoryTest.java | 8 +- ...CPUUsageJobExecutorServiceHandlerTest.java | 2 +- ...leThreadJobExecutorServiceHandlerTest.java | 2 +- .../infra/json/GsonFactoryTest.java | 12 +- .../ElasticJobListenerFactoryTest.java | 8 +- .../infra/listener/ShardingContextsTest.java | 2 +- .../infra/pojo/JobConfigurationPOJOTest.java | 8 +- .../spi/ElasticJobServiceLoaderTest.java | 27 +-- .../JobPropertiesValidateRuleTest.java | 2 +- .../elasticjob/infra/yaml/YamlEngineTest.java | 4 +- ...YamlConfigurationConverterFactoryTest.java | 4 +- .../elasticjob-registry-center-api/pom.xml | 8 - .../transaction/TransactionOperationTest.java | 2 +- .../exception/RegExceptionHandlerTest.java | 12 +- .../pom.xml | 8 - .../zookeeper/ZookeeperConfigurationTest.java | 2 +- .../ZookeeperElectionServiceTest.java | 12 +- ...eperRegistryCenterExecuteInLeaderTest.java | 15 +- .../ZookeeperRegistryCenterForAuthTest.java | 25 +-- ...ookeeperRegistryCenterInitFailureTest.java | 14 +- .../ZookeeperRegistryCenterListenerTest.java | 24 +-- ...keeperRegistryCenterMiscellaneousTest.java | 10 +- .../ZookeeperRegistryCenterModifyTest.java | 16 +- ...eeperRegistryCenterQueryWithCacheTest.java | 12 +- ...erRegistryCenterQueryWithoutCacheTest.java | 16 +- ...ookeeperRegistryCenterTransactionTest.java | 24 +-- .../ZookeeperRegistryCenterWatchTest.java | 28 +-- ...erCuratorIgnoredExceptionProviderTest.java | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 8 - .../restful/RegexPathMatcherTest.java | 8 +- .../restful/RegexUrlPatternMapTest.java | 19 +- .../RequestBodyDeserializerFactoryTest.java | 10 +- .../filter/DefaultFilterChainTest.java | 47 ++--- .../FilterChainInboundHandlerTest.java | 12 +- .../pipeline/HandlerParameterDecoderTest.java | 6 +- .../pipeline/HttpRequestDispatcherTest.java | 14 +- .../pipeline/NettyRestfulServiceTest.java | 35 ++-- ...ulServiceTrailingSlashInsensitiveTest.java | 18 +- ...tfulServiceTrailingSlashSensitiveTest.java | 18 +- .../ResponseBodySerializerFactoryTest.java | 10 +- .../wrapper/QueryParameterMapTest.java | 4 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 8 - .../impl/OneOffJobBootstrapTest.java | 24 +-- .../DistributeOnceElasticJobListenerTest.java | 49 ++--- .../api/registry/JobInstanceRegistryTest.java | 29 +-- .../lite/integrate/BaseIntegrateTest.java | 18 +- .../disable/DisabledJobIntegrateTest.java | 2 +- .../OneOffDisabledJobIntegrateTest.java | 2 +- .../ScheduleDisabledJobIntegrateTest.java | 4 +- .../enable/EnabledJobIntegrateTest.java | 16 +- .../enable/OneOffEnabledJobIntegrateTest.java | 4 +- .../ScheduleEnabledJobIntegrateTest.java | 4 +- .../annotation/JobAnnotationBuilderTest.java | 14 +- .../integrate/BaseAnnotationTest.java | 12 +- .../integrate/OneOffEnabledJobTest.java | 10 +- .../integrate/ScheduleEnabledJobTest.java | 10 +- .../config/ConfigurationNodeTest.java | 4 +- .../config/ConfigurationServiceTest.java | 57 +++--- .../config/RescheduleListenerManagerTest.java | 12 +- .../election/ElectionListenerManagerTest.java | 12 +- .../internal/election/LeaderNodeTest.java | 6 +- .../internal/election/LeaderServiceTest.java | 16 +- .../failover/FailoverListenerManagerTest.java | 12 +- .../internal/failover/FailoverNodeTest.java | 4 +- .../failover/FailoverServiceTest.java | 14 +- .../GuaranteeListenerManagerTest.java | 12 +- .../internal/guarantee/GuaranteeNodeTest.java | 6 +- .../guarantee/GuaranteeServiceTest.java | 16 +- .../internal/instance/InstanceNodeTest.java | 10 +- .../instance/InstanceServiceTest.java | 14 +- .../instance/ShutdownListenerManagerTest.java | 16 +- .../listener/ListenerManagerTest.java | 12 +- .../listener/ListenerNotifierManagerTest.java | 10 +- ...stryCenterConnectionStateListenerTest.java | 12 +- .../reconcile/ReconcileServiceTest.java | 12 +- .../internal/schedule/JobRegistryTest.java | 6 +- .../schedule/JobScheduleControllerTest.java | 171 ++++++++++-------- .../schedule/JobTriggerListenerTest.java | 12 +- .../internal/schedule/LiteJobFacadeTest.java | 12 +- .../schedule/SchedulerFacadeTest.java | 14 +- .../lite/internal/server/ServerNodeTest.java | 10 +- .../internal/server/ServerServiceTest.java | 18 +- .../DefaultJobClassNameProviderTest.java | 2 +- .../JobClassNameProviderFactoryTest.java | 2 +- .../lite/internal/setup/SetUpFacadeTest.java | 12 +- .../sharding/ExecutionContextServiceTest.java | 14 +- .../sharding/ExecutionServiceTest.java | 20 +- .../MonitorExecutionListenerManagerTest.java | 12 +- .../sharding/ShardingListenerManagerTest.java | 12 +- .../internal/sharding/ShardingNodeTest.java | 4 +- .../sharding/ShardingServiceTest.java | 16 +- .../snapshot/BaseSnapshotServiceTest.java | 16 +- .../snapshot/SnapshotServiceDisableTest.java | 19 +- .../snapshot/SnapshotServiceEnableTest.java | 16 +- .../internal/storage/JobNodePathTest.java | 2 +- .../internal/storage/JobNodeStorageTest.java | 25 +-- .../trigger/TriggerListenerManagerTest.java | 12 +- .../internal/util/SensitiveInfoUtilsTest.java | 2 +- .../elasticjob-lite-lifecycle/pom.xml | 9 - .../AbstractEmbedZookeeperBaseTest.java | 4 +- .../lite/lifecycle/api/JobAPIFactoryTest.java | 2 +- .../lifecycle/domain/ShardingStatusTest.java | 2 +- .../operate/JobOperateAPIImplTest.java | 16 +- .../operate/ShardingOperateAPIImplTest.java | 12 +- .../reg/RegistryCenterFactoryTest.java | 4 +- .../settings/JobConfigurationAPIImplTest.java | 55 +++--- .../statistics/JobStatisticsAPIImplTest.java | 12 +- .../ServerStatisticsAPIImplTest.java | 14 +- .../ShardingStatisticsAPIImplTest.java | 14 +- ...ElasticJobConfigurationPropertiesTest.java | 2 +- .../job/ElasticJobSpringBootScannerTest.java | 20 +- .../boot/job/ElasticJobSpringBootTest.java | 24 ++- .../boot/reg/ZookeeperPropertiesTest.java | 2 +- ...icJobSnapshotServiceConfigurationTest.java | 18 +- .../tracing/TracingConfigurationTest.java | 20 +- .../JobClassNameProviderFactoryTest.java | 2 +- .../spring/core/util/AopTargetUtilsTest.java | 12 +- .../elasticjob-lite-spring-namespace/pom.xml | 4 - .../fixture/aspect/SimpleAspect.java | 6 +- .../job/AbstractJobSpringIntegrateTest.java | 18 +- .../AbstractOneOffJobSpringIntegrateTest.java | 22 ++- .../job/JobSpringNamespaceWithRefTest.java | 18 +- .../job/JobSpringNamespaceWithTypeTest.java | 12 +- .../OneOffJobSpringNamespaceWithRefTest.java | 24 ++- .../OneOffJobSpringNamespaceWithTypeTest.java | 18 +- .../AbstractJobSpringIntegrateTest.java | 18 +- .../SnapshotSpringNamespaceDisableTest.java | 14 +- .../SnapshotSpringNamespaceEnableTest.java | 8 +- ...keeperJUnitJupiterSpringContextTests.java} | 6 +- pom.xml | 26 +++ src/main/resources/checkstyle.xml | 2 +- src/main/resources/checkstyle_ci.xml | 4 +- 252 files changed, 1626 insertions(+), 1532 deletions(-) rename elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/{AbstractZookeeperJUnit4SpringContextTests.java => AbstractZookeeperJUnitJupiterSpringContextTests.java} (81%) diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java index 7e0f4ebca1..e7dd40b40e 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java @@ -17,16 +17,17 @@ package org.apache.shardingsphere.elasticjob.annotation; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertArrayEquals; -import static org.hamcrest.MatcherAssert.assertThat; +import org.apache.shardingsphere.elasticjob.annotation.job.impl.SimpleTestJob; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; -import org.apache.shardingsphere.elasticjob.annotation.job.impl.SimpleTestJob; -import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; -import org.junit.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; public final class ElasticJobConfigurationTest { diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java index 700fdc798c..b275af4120 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java @@ -17,13 +17,14 @@ package org.apache.shardingsphere.elasticjob.api; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class JobConfigurationTest { @@ -81,13 +82,15 @@ public void assertBuildRequiredProperties() { assertFalse(actual.isOverwrite()); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertBuildWithEmptyJobName() { - JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build(); + assertThrows(IllegalArgumentException.class, () -> + JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build()); } - - @Test(expected = IllegalArgumentException.class) + + @Test public void assertBuildWithInvalidShardingTotalCount() { - JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build(); + assertThrows(IllegalArgumentException.class, () -> + JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index b7255cf6b4..2b5eb46e0f 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -102,14 +102,6 @@ org.apache.curator curator-test - - org.mockito - mockito-core - - - org.mockito - mockito-inline - org.slf4j diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java index 0d50aef213..eabc0dfe3a 100644 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java @@ -21,13 +21,13 @@ import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class CloudJobConfigurationPOJOTest { diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java index 97ba36e00f..e18977d85c 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java @@ -23,23 +23,23 @@ import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.sql.SQLException; import java.util.Date; import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class StatisticRdbRepositoryTest { private StatisticRdbRepository repository; - @Before + @BeforeEach public void setup() throws SQLException { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index 0aec8a88b3..f1d8ccb39e 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -50,14 +50,6 @@ org.projectlombok lombok - - org.mockito - mockito-core - - - org.mockito - mockito-inline - com.h2database h2 diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java index d7436915ba..eae59825fd 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java @@ -27,21 +27,21 @@ import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.HashMap; import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class CloudJobFacadeTest { private ShardingContexts shardingContexts; @@ -51,7 +51,7 @@ public final class CloudJobFacadeTest { private JobFacade jobFacade; - @Before + @BeforeEach public void setUp() { shardingContexts = getShardingContexts(); jobFacade = new CloudJobFacade(shardingContexts, getJobConfiguration(), jobTracingEventBus); diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java index c62785d5a9..c01e68fd4f 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java @@ -23,13 +23,14 @@ import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class LocalTaskExecutorTest { @@ -56,8 +57,9 @@ public void assertScriptJob() { .cron("*/2 * * * * ?").setProperty(ScriptJobProperties.SCRIPT_KEY, "echo test").build(), 1).execute(); } - @Test(expected = JobConfigurationException.class) + @Test public void assertNotExistsJobType() { - new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute(); + assertThrows(JobConfigurationException.class, () -> + new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java index e986d344b4..cd0a24a7df 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java @@ -29,22 +29,22 @@ import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.JobExecutionContext; import java.lang.reflect.Field; import java.util.concurrent.ConcurrentHashMap; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DaemonTaskSchedulerTest { @Mock @@ -69,7 +69,7 @@ public final class DaemonTaskSchedulerTest { private DaemonJob daemonJob; - @Before + @BeforeEach public void setUp() { daemonJob = new DaemonJob(); daemonJob.setJobFacade(jobFacade); diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java index ad486cd282..a623379b8f 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java @@ -28,22 +28,22 @@ import org.apache.mesos.Protos.TaskID; import org.apache.mesos.Protos.TaskInfo; import org.apache.shardingsphere.elasticjob.cloud.executor.fixture.TestSimpleJob; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; import java.util.HashMap; import java.util.concurrent.ExecutorService; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class TaskExecutorTest { @Mock @@ -60,7 +60,7 @@ public final class TaskExecutorTest { private TaskExecutor taskExecutor; - @Before + @BeforeEach public void setUp() { taskExecutor = new TaskExecutor(new TestSimpleJob()); setExecutorService(); diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java index b958696162..335ffab01b 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java @@ -32,17 +32,17 @@ import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import java.util.LinkedHashMap; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class TaskExecutorThreadTest { @Mock diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index e0443c16db..c2b9c0bb28 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -98,14 +98,6 @@ org.apache.curator curator-test - - org.mockito - mockito-core - - - org.mockito - mockito-inline - com.h2database h2 diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java index 6553ede101..7215f7a570 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java @@ -32,16 +32,16 @@ import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.reset; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public abstract class AbstractCloudControllerTest { @Getter(AccessLevel.PROTECTED) @@ -56,7 +56,7 @@ public abstract class AbstractCloudControllerTest { private static RestfulService slaveServer; - @BeforeClass + @BeforeAll public static void setUpClass() { initRestfulServer(); initMesosServer(); @@ -85,7 +85,7 @@ private static void initMesosServer() { slaveServer.startup(); } - @AfterClass + @AfterAll public static void tearDown() { consoleBootstrap.stop(); masterServer.shutdown(); @@ -93,7 +93,7 @@ public static void tearDown() { MesosStateService.deregister(); } - @Before + @BeforeEach public void setUp() { reset(regCenter); reset(jobEventRdbSearch); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java index e4f4e8c628..65873c4d80 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java @@ -21,9 +21,9 @@ import org.apache.shardingsphere.elasticjob.cloud.console.HttpTestUtil; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppJsonConstants; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import java.util.HashMap; @@ -34,7 +34,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class CloudAppControllerTest extends AbstractCloudControllerTest { private static final String YAML = "appCacheEnable: true\n" diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java index 9752437d55..bfa30436cb 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java @@ -32,9 +32,9 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collection; import java.util.Collections; @@ -48,7 +48,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class CloudJobControllerTest extends AbstractCloudControllerTest { private static final String YAML = "appName: test_app\n" diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java index 957dbe38d1..67197221ca 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java @@ -25,9 +25,9 @@ import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationConstants; import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationService; import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import java.io.IOException; import java.util.HashMap; @@ -36,7 +36,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class CloudLoginTest extends AbstractCloudControllerTest { @Test diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java index 2dd6ceb86f..d39f9cd0b8 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java @@ -19,17 +19,17 @@ import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; import org.apache.shardingsphere.elasticjob.cloud.console.AbstractCloudControllerTest; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.HANode; import org.apache.shardingsphere.elasticjob.cloud.console.HttpTestUtil; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.HANode; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class CloudOperationControllerTest extends AbstractCloudControllerTest { @Test diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java index 87d9b0fdca..41cfeed508 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java @@ -20,11 +20,11 @@ import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import javax.sql.DataSource; import java.sql.Connection; @@ -40,7 +40,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobEventRdbSearchTest { @Mock @@ -59,7 +59,7 @@ public final class JobEventRdbSearchTest { private JobEventRdbSearch jobEventRdbSearch; - @Before + @BeforeEach public void setUp() throws Exception { jobEventRdbSearch = new JobEventRdbSearch(dataSource); when(dataSource.getConnection()).thenReturn(conn); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java index 2a5a005871..91ae56658a 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java @@ -27,19 +27,19 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class CloudAppConfigurationListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -53,7 +53,7 @@ public final class CloudAppConfigurationListenerTest { @InjectMocks private CloudAppConfigurationListener cloudAppConfigurationListener; - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "producerManager", producerManager); ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "mesosStateService", mesosStateService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java index ca8a814783..fb4372febb 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java index d8e4d6694d..de655e58b8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java @@ -21,24 +21,24 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppJsonConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collection; import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class CloudAppConfigurationServiceTest { private static final String YAML = "appCacheEnable: true\n" diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java index d5d64edcdf..d9e39339c9 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo; import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class CloudAppConfigurationPOJOTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java index 71011aa59e..328e2c09e0 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java @@ -27,20 +27,20 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class CloudJobConfigurationListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -54,7 +54,7 @@ public final class CloudJobConfigurationListenerTest { @InjectMocks private CloudJobConfigurationListener cloudJobConfigurationListener; - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "producerManager", producerManager); ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "readyService", readyService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java index c09ceb2460..5045f5e471 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java index 8895e71710..fb7cb50034 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java @@ -21,24 +21,24 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collection; import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class CloudJobConfigurationServiceTest { private static final String YAML = "appName: test_app\n" diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java index 1cc83e307d..7d820a004c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java index e95d6de01f..1fb00a26a6 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java @@ -20,7 +20,7 @@ import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Map; import java.util.Optional; @@ -28,8 +28,8 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; public final class BootstrapEnvironmentTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java index 8c1148b5b1..db0cf36921 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java @@ -18,21 +18,21 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.ha; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Optional; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class FrameworkIDServiceTest { @Mock @@ -40,7 +40,7 @@ public class FrameworkIDServiceTest { private FrameworkIDService frameworkIDService; - @Before + @BeforeEach public void init() { frameworkIDService = new FrameworkIDService(registryCenter); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java index d7e7dd8ed4..c8db6d3e0f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java @@ -31,10 +31,10 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService.ExecutorStateInfo; import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.stubbing.Answer; import java.util.ArrayList; @@ -45,7 +45,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -63,19 +63,19 @@ public final class AppConstraintEvaluatorTest { private TaskScheduler taskScheduler; - @BeforeClass + @BeforeAll public static void init() { facadeService = mock(FacadeService.class); AppConstraintEvaluator.init(facadeService); } - @Before + @BeforeEach public void setUp() { taskScheduler = new TaskScheduler.Builder().withLeaseOfferExpirySecs(1000000000L).withLeaseRejectAction(virtualMachineLease -> { }).build(); } - @After + @AfterEach public void tearDown() { AppConstraintEvaluator.getInstance().clearAppRunningState(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java index 0c3b321519..21f72f1b59 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java @@ -39,11 +39,11 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collection; @@ -51,14 +51,14 @@ import java.util.Optional; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class FacadeServiceTest { @Mock @@ -90,7 +90,7 @@ public final class FacadeServiceTest { private FacadeService facadeService; - @Before + @BeforeEach public void setUp() { facadeService = new FacadeService(regCenter); ReflectionUtils.setFieldValue(facadeService, "jobConfigService", jobConfigService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java index accda6d870..7129fdf37e 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java @@ -22,13 +22,13 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; import org.hamcrest.core.StringStartsWith; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; public final class JobTaskRequestTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java index 83f8c94b70..290fe0b927 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java @@ -27,11 +27,11 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.List; @@ -40,7 +40,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class LaunchingTasksTest { @Mock @@ -60,7 +60,7 @@ public final class LaunchingTasksTest { private LaunchingTasks launchingTasks; - @Before + @BeforeEach public void setUp() { FacadeService facadeService = new FacadeService(regCenter); ReflectionUtils.setFieldValue(facadeService, "jobConfigService", jobConfigService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java index 2f388e4373..c7e379135e 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos; import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.OfferBuilder; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class LeasesQueueTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java index 4e42760485..54d887969b 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java @@ -21,10 +21,10 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.HANode; import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService.ExecutorStateInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collection; import java.util.Map; @@ -33,7 +33,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class MesosStateServiceTest extends AbstractCloudControllerTest { @Mock diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java index 1842032da7..ced647cba3 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java @@ -17,17 +17,17 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import com.google.common.collect.Sets; import org.apache.mesos.Protos; import org.apache.mesos.SchedulerDriver; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collection; import java.util.Collections; @@ -40,7 +40,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ReconcileServiceTest { @Mock @@ -54,7 +54,7 @@ public final class ReconcileServiceTest { @Captor private ArgumentCaptor> taskStatusCaptor; - @Before + @BeforeEach public void setUp() { reconcileService = new ReconcileService(schedulerDriver, facadeService); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java index 4ec2844af0..d2304e7e3a 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java @@ -31,12 +31,12 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.List; @@ -49,7 +49,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class SchedulerEngineTest { @Mock @@ -66,7 +66,7 @@ public final class SchedulerEngineTest { private SchedulerEngine schedulerEngine; - @Before + @BeforeEach public void setUp() { schedulerEngine = new SchedulerEngine(taskScheduler, facadeService, new JobTracingEventBus(), frameworkIDService, statisticManager); ReflectionUtils.setFieldValue(schedulerEngine, "facadeService", facadeService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java index adcf05cb14..d8e5f0854c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java @@ -28,19 +28,19 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.CloudAppDisableListener; import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.CloudJobDisableListener; import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InOrder; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class SchedulerServiceTest { @Mock @@ -81,7 +81,7 @@ public class SchedulerServiceTest { private SchedulerService schedulerService; - @Before + @BeforeEach public void setUp() { schedulerService = new SchedulerService(env, facadeService, schedulerDriver, producerManager, statisticManager, cloudJobConfigurationListener, diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java index 59333cd8d6..4ef76e04af 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java @@ -17,10 +17,10 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class SupportedExtractionTypeTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java index 5f0491142d..bf1dad3f6c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java @@ -20,14 +20,14 @@ import org.apache.commons.lang3.SerializationUtils; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNotNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; public final class TaskInfoDataTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java index 1c11bc7997..5a8665a0ae 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java @@ -36,13 +36,13 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import java.util.HashMap; @@ -57,7 +57,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class TaskLaunchScheduledServiceTest { @Mock @@ -74,14 +74,14 @@ public final class TaskLaunchScheduledServiceTest { private TaskLaunchScheduledService taskLaunchScheduledService; - @Before + @BeforeEach public void setUp() { when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"))); taskLaunchScheduledService = new TaskLaunchScheduledService(schedulerDriver, taskScheduler, facadeService, jobTracingEventBus); taskLaunchScheduledService.startUp(); } - @After + @AfterEach public void tearDown() { taskLaunchScheduledService.shutDown(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java index f890ffd902..f06957a58b 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.producer; import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.JobBuilder; import org.quartz.JobExecutionContext; import org.quartz.JobKey; @@ -30,7 +30,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ProducerJobTest { @Mock @@ -43,7 +43,7 @@ public final class ProducerJobTest { private TransientProducerScheduler.ProducerJob producerJob; - @Before + @BeforeEach public void setUp() { producerJob = new TransientProducerScheduler.ProducerJob(); producerJob.setRepository(repository); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java index fd3d441d05..8465f88fb7 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java @@ -22,10 +22,10 @@ import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.exception.AppConfigurationException; import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService; import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; +import org.apache.shardingsphere.elasticjob.cloud.scheduler.exception.AppConfigurationException; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobService; @@ -34,8 +34,8 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; @@ -45,6 +45,7 @@ import java.util.List; import java.util.Optional; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -84,7 +85,7 @@ public final class ProducerManagerTest { private final CloudJobConfigurationPOJO daemonJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("daemon_test_job", CloudJobExecutionType.DAEMON); - @Before + @BeforeEach public void setUp() { producerManager = new ProducerManager(schedulerDriver, regCenter); ReflectionUtils.setFieldValue(producerManager, "appConfigService", appConfigService); @@ -104,23 +105,29 @@ public void assertStartup() { verify(readyService).addDaemon("daemon_test_job"); } - @Test(expected = AppConfigurationException.class) + @Test public void assertRegisterJobWithoutApp() { - when(appConfigService.load("test_app")).thenReturn(Optional.empty()); - producerManager.register(transientJobConfig); + assertThrows(AppConfigurationException.class, () -> { + when(appConfigService.load("test_app")).thenReturn(Optional.empty()); + producerManager.register(transientJobConfig); + }); } - @Test(expected = JobConfigurationException.class) + @Test public void assertRegisterExistedJob() { - when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); - when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); - producerManager.register(transientJobConfig); + assertThrows(JobConfigurationException.class, () -> { + when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); + when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); + producerManager.register(transientJobConfig); + }); } - @Test(expected = JobConfigurationException.class) + @Test public void assertRegisterDisabledJob() { - when(disableJobService.isDisabled("transient_test_job")).thenReturn(true); - producerManager.register(transientJobConfig); + assertThrows(JobConfigurationException.class, () -> { + when(disableJobService.isDisabled("transient_test_job")).thenReturn(true); + producerManager.register(transientJobConfig); + }); } @Test @@ -141,10 +148,12 @@ public void assertRegisterDaemonJob() { verify(readyService).addDaemon("daemon_test_job"); } - @Test(expected = JobConfigurationException.class) + @Test public void assertUpdateNotExisted() { - when(configService.load("transient_test_job")).thenReturn(Optional.empty()); - producerManager.update(transientJobConfig); + assertThrows(JobConfigurationException.class, () -> { + when(configService.load("transient_test_job")).thenReturn(Optional.empty()); + producerManager.update(transientJobConfig); + }); } @Test diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java index c88dde8162..d5f9178a8d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java @@ -17,17 +17,17 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.producer; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.JobKey; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class TransientProducerRepositoryTest { private final JobKey jobKey = JobKey.jobKey("0/45 * * * * ?"); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java index ce93fe28d4..d3665ff472 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java @@ -21,11 +21,11 @@ import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.CronScheduleBuilder; import org.quartz.JobBuilder; import org.quartz.JobDetail; @@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class TransientProducerSchedulerTest { @Mock @@ -57,7 +57,7 @@ public final class TransientProducerSchedulerTest { .withSchedule(CronScheduleBuilder.cronSchedule(cloudJobConfig.getCron()) .withMisfireHandlingInstructionDoNothing()).build(); - @Before + @BeforeEach public void setUp() { transientProducerScheduler = new TransientProducerScheduler(readyService); ReflectionUtils.setFieldValue(transientProducerScheduler, "scheduler", scheduler); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java index cecf197c56..65656321c9 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java @@ -26,18 +26,18 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class CloudAppDisableListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -51,7 +51,7 @@ public final class CloudAppDisableListenerTest { @InjectMocks private CloudAppDisableListener cloudAppDisableListener; - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(cloudAppDisableListener, "producerManager", producerManager); initRegistryCenter(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java index 641d853849..e8eab8a26e 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java index 1c6da0d73a..46deb83616 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java @@ -18,18 +18,18 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DisableAppServiceTest { @Mock @@ -37,7 +37,7 @@ public final class DisableAppServiceTest { private DisableAppService disableAppService; - @Before + @BeforeEach public void setUp() { disableAppService = new DisableAppService(regCenter); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java index a0b51a46a9..22fd4773d6 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java @@ -25,19 +25,19 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class CloudJobDisableListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -48,7 +48,7 @@ public final class CloudJobDisableListenerTest { @InjectMocks private CloudJobDisableListener cloudJobDisableListener; - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(cloudJobDisableListener, "producerManager", producerManager); initRegistryCenter(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java index d434f556fe..bf62aad7ba 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java index fc9bdd762e..c0c7f41115 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java @@ -18,18 +18,18 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DisableJobServiceTest { @Mock @@ -37,7 +37,7 @@ public final class DisableJobServiceTest { private DisableJobService disableJobService; - @Before + @BeforeEach public void setUp() { disableJobService = new DisableJobService(regCenter); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java index 73e13bb11f..56c418729a 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java index 640b0420ce..c7fc2ecd8d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java @@ -28,11 +28,11 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collection; @@ -43,12 +43,12 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class FailoverServiceTest { @Mock @@ -62,7 +62,7 @@ public final class FailoverServiceTest { private FailoverService failoverService; - @Before + @BeforeEach public void setUp() { failoverService = new FailoverService(regCenter); ReflectionUtils.setFieldValue(failoverService, "configService", configService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java index 5996fdc56f..1f685a12f7 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java index 183266397e..9a60982c01 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java @@ -26,12 +26,12 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -40,13 +40,13 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ReadyServiceTest { @Mock @@ -60,7 +60,7 @@ public final class ReadyServiceTest { private ReadyService readyService; - @Before + @BeforeEach public void setUp() { readyService = new ReadyService(regCenter); ReflectionUtils.setFieldValue(readyService, "configService", configService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java index db7887fe84..320a806e50 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java index 407bad820c..9e209afe6d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java @@ -24,26 +24,26 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; import java.util.UUID; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class RunningServiceTest { private TaskContext taskContext; @@ -55,7 +55,7 @@ public final class RunningServiceTest { private RunningService runningService; - @Before + @BeforeEach public void setUp() { when(regCenter.get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson(CloudJobExecutionType.DAEMON)); when(regCenter.get("/config/job/test_job_t")).thenReturn(CloudJsonConstants.getJobJson("test_job_t")); @@ -71,7 +71,7 @@ public void setUp() { verify(regCenter).persist(path, taskContext.getId()); } - @After + @AfterEach public void tearDown() { runningService.clear(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java index 5db25d65a7..14e1af7c6f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java @@ -28,12 +28,12 @@ import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -42,14 +42,14 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class StatisticManagerTest { @Mock @@ -66,12 +66,12 @@ public final class StatisticManagerTest { private StatisticManager statisticManager; - @Before + @BeforeEach public void setUp() { statisticManager = StatisticManager.getInstance(regCenter, null); } - @After + @AfterEach public void tearDown() { statisticManager.shutdown(); ReflectionUtils.setStaticFieldValue(StatisticManager.class, "instance", null); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java index 926955fcea..039d60c9b5 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java @@ -20,18 +20,18 @@ import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.StatisticJob; import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.TestStatisticJob; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.Scheduler; import org.quartz.SchedulerException; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class StatisticsSchedulerTest { private StatisticsScheduler statisticsScheduler; @@ -39,7 +39,7 @@ public class StatisticsSchedulerTest { @Mock private Scheduler scheduler; - @Before + @BeforeEach public void setUp() { statisticsScheduler = new StatisticsScheduler(); ReflectionUtils.setFieldValue(statisticsScheduler, "scheduler", scheduler); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java index b2b9a83827..3477a731ea 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java @@ -17,17 +17,17 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import org.junit.Before; -import org.junit.Test; - public class TaskResultMetaDataTest { private TaskResultMetaData metaData; - @Before + @BeforeEach public void setUp() { metaData = new TaskResultMetaData(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java index 8e36a745e2..78fe5f9a6d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java @@ -17,21 +17,21 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; +import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Date; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.junit.Before; -import org.junit.Test; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; public class BaseStatisticJobTest { private TestStatisticJob testStatisticJob; - @Before + @BeforeEach public void setUp() { testStatisticJob = new TestStatisticJob(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java index 459da44d7c..82103b9b99 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java @@ -17,7 +17,6 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; @@ -25,12 +24,13 @@ import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.Trigger; import java.util.Collections; @@ -46,7 +46,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class JobRunningStatisticJobTest { @Mock @@ -57,7 +57,7 @@ public class JobRunningStatisticJobTest { private JobRunningStatisticJob jobRunningStatisticJob; - @Before + @BeforeEach public void setUp() { jobRunningStatisticJob = new JobRunningStatisticJob(); jobRunningStatisticJob.setRunningService(runningService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java index 13d286b5c2..db32d5eb90 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java @@ -23,11 +23,11 @@ import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.Trigger; import java.util.Collections; @@ -40,7 +40,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class RegisteredJobStatisticJobTest { @Mock @@ -51,7 +51,7 @@ public class RegisteredJobStatisticJobTest { private RegisteredJobStatisticJob registeredJobStatisticJob; - @Before + @BeforeEach public void setUp() { registeredJobStatisticJob = new RegisteredJobStatisticJob(); registeredJobStatisticJob.setConfigurationService(configurationService); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java index c260fb8d5b..c06375aeba 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java @@ -22,11 +22,11 @@ import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.Trigger; import java.util.Optional; @@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class TaskResultStatisticJobTest { private final StatisticInterval statisticInterval = StatisticInterval.MINUTE; @@ -50,7 +50,7 @@ public class TaskResultStatisticJobTest { private TaskResultStatisticJob taskResultStatisticJob; - @Before + @BeforeEach public void setUp() { taskResultStatisticJob = new TaskResultStatisticJob(); sharedData = new TaskResultMetaData(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java index 50d006a359..0e92ba7901 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java @@ -24,7 +24,7 @@ import java.util.Date; import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class StatisticTimeUtilsTest { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java index eda0de8b2c..79567d986c 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java @@ -22,7 +22,7 @@ import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index 5fb576fede..bcb712c4b9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -59,10 +59,6 @@ org.apache.httpcomponents httpcore - - org.mockito - mockito-core - ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index b5e373c480..ec384a48f3 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -19,17 +19,18 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Properties; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class DingtalkJobErrorHandlerPropertiesValidatorTest { - @Before + @BeforeEach public void startup() { ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); } @@ -44,10 +45,12 @@ public void assertValidateWithNormal() { actual.validate(properties); } - @Test(expected = NullPointerException.class) + @Test public void assertValidateWithPropsIsNull() { - DingtalkJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(null); + assertThrows(NullPointerException.class, () -> { + DingtalkJobErrorHandlerPropertiesValidator actual = getValidator(); + actual.validate(null); + }); } @Test diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index ec6dc3c8ed..2b78aa26e6 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -26,10 +26,10 @@ import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; import java.util.List; @@ -49,7 +49,7 @@ public final class DingtalkJobErrorHandlerTest { private static List appenderList; @SuppressWarnings({"unchecked", "rawtypes"}) - @BeforeClass + @BeforeAll public static void init() { NettyRestfulServiceConfiguration config = new NettyRestfulServiceConfiguration(PORT); config.setHost(HOST); @@ -61,12 +61,12 @@ public static void init() { appenderList = appender.list; } - @Before + @BeforeEach public void setUp() { appenderList.clear(); } - @AfterClass + @AfterAll public static void close() { if (null != restfulService) { restfulService.shutdown(); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index b5963a304e..e90ceb4cf9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -48,16 +48,7 @@ com.sun.mail javax.mail - - - org.mockito - mockito-core - - - - org.mockito - mockito-inline - + ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index d2b32adee8..adb0839a41 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -19,17 +19,18 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Properties; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class EmailJobErrorHandlerPropertiesValidatorTest { - @Before + @BeforeEach public void startup() { ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); } @@ -48,10 +49,12 @@ public void assertValidateWithNormal() { actual.validate(properties); } - @Test(expected = NullPointerException.class) + @Test public void assertValidateWithPropsIsNull() { - EmailJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(null); + assertThrows(NullPointerException.class, () -> { + EmailJobErrorHandlerPropertiesValidator actual = getValidator(); + actual.validate(null); + }); } @Test diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index a22525f4e9..bb2a4b5289 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -23,12 +23,12 @@ import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.slf4j.LoggerFactory; import javax.mail.Address; @@ -45,7 +45,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class EmailJobErrorHandlerTest { private static List appenderList; @@ -57,14 +57,14 @@ public final class EmailJobErrorHandlerTest { private Transport transport; @SuppressWarnings({"unchecked", "rawtypes"}) - @BeforeClass + @BeforeAll public static void init() { ch.qos.logback.classic.Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(EmailJobErrorHandler.class); ListAppender appender = (ListAppender) log.getAppender("EmailJobErrorHandlerTestAppender"); appenderList = appender.list; } - @Before + @BeforeEach public void setUp() { appenderList.clear(); } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 8886080229..9184609e4a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -46,16 +46,6 @@ org.projectlombok lombok - - - org.mockito - mockito-core - - - - org.mockito - mockito-inline - ch.qos.logback diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java index 6ddb60a1a0..7bf5b15b50 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java @@ -20,12 +20,13 @@ import org.apache.shardingsphere.elasticjob.error.handler.general.LogJobErrorHandler; import org.apache.shardingsphere.elasticjob.error.handler.general.ThrowJobErrorHandler; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Properties; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class JobErrorHandlerFactoryTest { @@ -34,9 +35,10 @@ public void assertGetDefaultHandler() { assertThat(JobErrorHandlerFactory.createHandler("", new Properties()).orElse(null), instanceOf(LogJobErrorHandler.class)); } - @Test(expected = JobConfigurationException.class) + @Test public void assertGetInvalidHandler() { - JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException("")); + assertThrows(JobConfigurationException.class, () -> + JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException(""))); } @Test diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java index ddf7e2d6b4..0456d27c48 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java @@ -21,23 +21,23 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.error.handler.general.IgnoreJobErrorHandler; import org.apache.shardingsphere.elasticjob.error.handler.general.LogJobErrorHandler; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; import java.util.Properties; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobErrorHandlerReloadableTest { @Mock diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java index e82a6b751b..3318cafcc0 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Properties; diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java index df1f7c93d9..a76aa3da5b 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java @@ -22,9 +22,9 @@ import ch.qos.logback.core.read.ListAppender; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; import java.util.List; @@ -38,14 +38,14 @@ public final class LogJobErrorHandlerTest { private static List appenderList; @SuppressWarnings({"unchecked", "rawtypes"}) - @BeforeClass + @BeforeAll public static void setupLogger() { ch.qos.logback.classic.Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(LogJobErrorHandler.class); ListAppender appender = (ListAppender) log.getAppender("LogJobErrorHandlerTestAppender"); appenderList = appender.list; } - @Before + @BeforeEach public void setUp() { appenderList.clear(); } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java index e0f8656b0c..7a8b0bbb1c 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java @@ -20,15 +20,18 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Properties; +import static org.junit.jupiter.api.Assertions.assertThrows; + public final class ThrowJobErrorHandlerTest { - - @Test(expected = JobSystemException.class) + + @Test public void assertHandleException() { - JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElseThrow( - () -> new JobConfigurationException("THROW error handler not found.")).handleException("test_job", new RuntimeException("test")); + assertThrows(JobSystemException.class, () -> + JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElseThrow(() -> + new JobConfigurationException("THROW error handler not found.")).handleException("test_job", new RuntimeException("test"))); } } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index 8c1dc0b579..5ee5fdd34e 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -59,10 +59,6 @@ org.apache.httpcomponents httpcore - - org.mockito - mockito-core - ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index fed5e7e735..20e3353f2b 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -19,17 +19,18 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Properties; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class WechatJobErrorHandlerPropertiesValidatorTest { - @Before + @BeforeEach public void startup() { ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); } @@ -44,10 +45,12 @@ public void assertValidateWithNormal() { actual.validate(properties); } - @Test(expected = NullPointerException.class) + @Test public void assertValidateWithPropsIsNull() { - WechatJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(null); + assertThrows(NullPointerException.class, () -> { + WechatJobErrorHandlerPropertiesValidator actual = getValidator(); + actual.validate(null); + }); } @Test diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index 82291aeb4e..790d19c6e4 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -26,10 +26,10 @@ import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; import java.util.List; @@ -49,7 +49,7 @@ public final class WechatJobErrorHandlerTest { private static List appenderList; @SuppressWarnings({"unchecked", "rawtypes"}) - @BeforeClass + @BeforeAll public static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); @@ -61,12 +61,12 @@ public static void init() { appenderList = appender.list; } - @Before + @BeforeEach public void setUp() { appenderList.clear(); } - @AfterClass + @AfterAll public static void close() { if (null != restfulService) { restfulService.shutdown(); diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index 0752e94b35..4e75e64214 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -52,15 +52,6 @@ org.projectlombok lombok - - - org.mockito - mockito-core - - - org.mockito - mockito-inline - ch.qos.logback diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java index 46082ab61d..5fdc2d9b07 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java @@ -25,17 +25,18 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; import java.util.Collections; import java.util.HashMap; import java.util.Map; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.eq; @@ -44,7 +45,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ElasticJobExecutorTest { @Mock @@ -60,7 +61,7 @@ public final class ElasticJobExecutorTest { private ElasticJobExecutor elasticJobExecutor; - @Before + @BeforeEach public void setUp() { jobConfig = createJobConfiguration(); when(jobFacade.loadJobConfiguration(anyBoolean())).thenReturn(jobConfig); @@ -80,14 +81,16 @@ private void setJobItemExecutor() { field.set(elasticJobExecutor, jobItemExecutor); } - @Test(expected = JobSystemException.class) - public void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() throws JobExecutionEnvironmentException { - doThrow(JobExecutionEnvironmentException.class).when(jobFacade).checkJobExecutionEnvironment(); - try { - elasticJobExecutor.execute(); - } finally { - verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); - } + @Test + public void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() { + assertThrows(JobSystemException.class, () -> { + doThrow(JobExecutionEnvironmentException.class).when(jobFacade).checkJobExecutionEnvironment(); + try { + elasticJobExecutor.execute(); + } finally { + verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + } + }); } @Test @@ -111,10 +114,10 @@ public void assertExecuteWhenShardingItemsIsEmpty() { verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "Sharding item for job 'test_job' is empty."); verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); } - - @Test(expected = JobSystemException.class) + + @Test public void assertExecuteFailureWhenThrowExceptionForSingleShardingItem() { - assertExecuteFailureWhenThrowException(createSingleShardingContexts()); + assertThrows(JobSystemException.class, () -> assertExecuteFailureWhenThrowException(createSingleShardingContexts())); } @Test @@ -195,28 +198,32 @@ public void assertExecuteWithMisfire() { verify(jobFacade, times(2)).registerJobCompleted(shardingContexts); } - @Test(expected = JobSystemException.class) + @Test public void assertBeforeJobExecutedFailure() { - ShardingContexts shardingContexts = createMultipleShardingContexts(); - when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); - doThrow(RuntimeException.class).when(jobFacade).beforeJobExecuted(shardingContexts); - try { - elasticJobExecutor.execute(); - } finally { - verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); - } + assertThrows(JobSystemException.class, () -> { + ShardingContexts shardingContexts = createMultipleShardingContexts(); + when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); + doThrow(RuntimeException.class).when(jobFacade).beforeJobExecuted(shardingContexts); + try { + elasticJobExecutor.execute(); + } finally { + verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + } + }); } - @Test(expected = JobSystemException.class) + @Test public void assertAfterJobExecutedFailure() { - ShardingContexts shardingContexts = createMultipleShardingContexts(); - when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); - doThrow(RuntimeException.class).when(jobFacade).afterJobExecuted(shardingContexts); - try { - elasticJobExecutor.execute(); - } finally { - verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); - } + assertThrows(JobSystemException.class, () -> { + ShardingContexts shardingContexts = createMultipleShardingContexts(); + when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); + doThrow(RuntimeException.class).when(jobFacade).afterJobExecuted(shardingContexts); + try { + elasticJobExecutor.execute(); + } finally { + verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + } + }); } private ShardingContexts createSingleShardingContexts() { diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java index 6eeab3635e..7bacb85b86 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java @@ -23,16 +23,18 @@ import org.apache.shardingsphere.elasticjob.executor.fixture.job.FailedJob; import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class JobItemExecutorFactoryTest { - @Test(expected = JobConfigurationException.class) + @Test public void assertGetExecutorByClassFailureWithInvalidType() { - JobItemExecutorFactory.getExecutor(FailedJob.class); + assertThrows(JobConfigurationException.class, () -> + JobItemExecutorFactory.getExecutor(FailedJob.class)); } @Test @@ -45,9 +47,10 @@ public void assertGetExecutorByClassSuccessWithSubClass() { assertThat(JobItemExecutorFactory.getExecutor(DetailedFooJob.class), instanceOf(ClassedFooJobExecutor.class)); } - @Test(expected = JobConfigurationException.class) + @Test public void assertGetExecutorByTypeFailureWithInvalidType() { - JobItemExecutorFactory.getExecutor("FAIL"); + assertThrows(JobConfigurationException.class, () -> + JobItemExecutorFactory.getExecutor("FAIL")); } @Test diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java index 4cccb4244e..7f1ed741f5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java @@ -22,11 +22,11 @@ import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.List; @@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DataflowJobExecutorTest { private DataflowJobExecutor jobExecutor; @@ -58,7 +58,7 @@ public final class DataflowJobExecutorTest { @Mock private Properties properties; - @Before + @BeforeEach public void createJobExecutor() { jobExecutor = new DataflowJobExecutor(); } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 371c504370..e056a81679 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -28,21 +28,22 @@ import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Properties; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class HttpJobExecutorTest { private static final int PORT = 9876; @@ -68,7 +69,7 @@ public final class HttpJobExecutorTest { private HttpJobExecutor jobExecutor; - @BeforeClass + @BeforeAll public static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); @@ -77,30 +78,34 @@ public static void init() { restfulService.startup(); } - @Before + @BeforeEach public void setUp() { when(jobConfig.getProps()).thenReturn(properties); jobExecutor = new HttpJobExecutor(); } - @AfterClass + @AfterAll public static void close() { if (null != restfulService) { restfulService.shutdown(); } } - @Test(expected = JobConfigurationException.class) + @Test public void assertUrlEmpty() { - when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(""); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + assertThrows(JobConfigurationException.class, () -> { + when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(""); + jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + }); } - @Test(expected = JobConfigurationException.class) + @Test public void assertMethodEmpty() { - when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/getName")); - when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn(""); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + assertThrows(JobConfigurationException.class, () -> { + when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/getName")); + when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn(""); + jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + }); } @Test @@ -143,14 +148,16 @@ public void assertProcessWithPost() { jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); } - @Test(expected = JobExecutionException.class) + @Test public void assertProcessWithIOException() { - when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/postWithTimeout")); - when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("POST"); - when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn("name=elasticjob"); - when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("1"); - when(jobConfig.getProps().getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")).thenReturn("1"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + assertThrows(JobExecutionException.class, () -> { + when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/postWithTimeout")); + when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("POST"); + when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn("name=elasticjob"); + when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("1"); + when(jobConfig.getProps().getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")).thenReturn("1"); + jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + }); } @Test diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index c1ccb680fd..d6e7366a8f 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -26,19 +26,20 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Properties; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ScriptJobExecutorTest { @Mock @@ -58,22 +59,26 @@ public final class ScriptJobExecutorTest { private ScriptJobExecutor jobExecutor; - @Before + @BeforeEach public void setUp() { jobExecutor = new ScriptJobExecutor(); } - @Test(expected = JobConfigurationException.class) + @Test public void assertProcessWithJobConfigurationException() { - when(jobConfig.getProps()).thenReturn(properties); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + assertThrows(JobConfigurationException.class, () -> { + when(jobConfig.getProps()).thenReturn(properties); + jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + }); } - @Test(expected = JobSystemException.class) + @Test public void assertProcessWithJobSystemException() { - when(jobConfig.getProps()).thenReturn(properties); - when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn("demo.sh"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + assertThrows(JobSystemException.class, () -> { + when(jobConfig.getProps()).thenReturn(properties); + when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn("demo.sh"); + jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + }); } @Test diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java index e8152bd7ce..a0cd5667a0 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java @@ -21,11 +21,11 @@ import org.apache.shardingsphere.elasticjob.executor.JobFacade; import org.apache.shardingsphere.elasticjob.simple.job.FooSimpleJob; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -33,7 +33,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class SimpleJobExecutorTest { @Mock @@ -47,7 +47,7 @@ public final class SimpleJobExecutorTest { private SimpleJobExecutor jobExecutor; - @Before + @BeforeEach public void setUp() { jobExecutor = new SimpleJobExecutor(); } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index 2c6aecb8eb..bf34d52d97 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -39,13 +39,5 @@ org.projectlombok lombok - - org.mockito - mockito-core - - - org.mockito - mockito-inline - diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index c405795ff0..a549e4f6f5 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -57,14 +57,6 @@ lombok - - org.mockito - mockito-core - - - org.mockito - mockito-inline - org.slf4j jcl-over-slf4j diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java index 0bf72652aa..b8a5d1f759 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java @@ -24,11 +24,11 @@ import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; import org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListener; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; @@ -37,7 +37,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobTracingEventBusTest { @Mock diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java index a0b6740f89..e14a49cf7b 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java @@ -17,14 +17,14 @@ package org.apache.shardingsphere.elasticjob.tracing.event; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class JobExecutionEventTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java index 73ad659d0c..56fa18eeca 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java @@ -21,21 +21,24 @@ import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCallerConfiguration; import org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListener; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class TracingListenerFactoryTest { - @Test(expected = TracingConfigurationException.class) - public void assertGetListenerWithNullType() throws TracingConfigurationException { - TracingListenerFactory.getListener(new TracingConfiguration<>("", null)); + @Test + public void assertGetListenerWithNullType() { + assertThrows(TracingConfigurationException.class, () -> + TracingListenerFactory.getListener(new TracingConfiguration<>("", null))); } - - @Test(expected = TracingConfigurationException.class) - public void assertGetInvalidListener() throws TracingConfigurationException { - TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null)); + + @Test + public void assertGetInvalidListener() { + assertThrows(TracingConfigurationException.class, () -> + TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null))); } @Test diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java index e4b4838c58..1c2c712da1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java @@ -18,10 +18,10 @@ package org.apache.shardingsphere.elasticjob.tracing.storage; import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class TracingStorageConverterFactoryTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java index 69d3b142bf..5cefd95961 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -19,12 +19,12 @@ import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNotNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class YamlTracingConfigurationConverterTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index 70674988d2..cd04ba62d5 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -38,14 +38,6 @@ lombok - - org.mockito - mockito-core - - - org.mockito - mockito-inline - org.slf4j jcl-over-slf4j diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java index 347e7c4a51..442ec49f34 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java @@ -19,7 +19,7 @@ import com.zaxxer.hikari.HikariDataSource; import org.apache.commons.dbcp2.BasicDataSource; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.sql.SQLException; import java.util.Arrays; @@ -31,9 +31,9 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; public final class DataSourceConfigurationTest { diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java index 69ba1f6bd6..f2e4e863b2 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java @@ -17,10 +17,10 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import javax.sql.DataSource; @@ -31,7 +31,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DataSourceRegistryTest { @Mock diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java index a2f6b3b7d3..5fcc05194b 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java @@ -22,10 +22,10 @@ import org.apache.shardingsphere.elasticjob.tracing.exception.TracingStorageUnavailableException; import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter; import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverterFactory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import javax.sql.DataSource; import java.sql.Connection; @@ -33,12 +33,13 @@ import java.sql.SQLException; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNotNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DataSourceTracingStorageConverterTest { @Mock @@ -60,11 +61,13 @@ public void assertConvert() throws SQLException { assertNotNull(configuration); } - @Test(expected = TracingStorageUnavailableException.class) - public void assertConvertFailed() throws SQLException { - DataSourceTracingStorageConverter converter = new DataSourceTracingStorageConverter(); - doThrow(SQLException.class).when(dataSource).getConnection(); - converter.convertObjectToConfiguration(dataSource); + @Test + public void assertConvertFailed() { + assertThrows(TracingStorageUnavailableException.class, () -> { + DataSourceTracingStorageConverter converter = new DataSourceTracingStorageConverter(); + doThrow(SQLException.class).when(dataSource).getConnection(); + converter.convertObjectToConfiguration(dataSource); + }); } @Test diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java index accf981ffd..47e7a79602 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java @@ -19,10 +19,11 @@ import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class RDBTracingListenerConfigurationTest { @@ -36,8 +37,9 @@ public void assertCreateTracingListenerSuccess() throws TracingConfigurationExce assertThat(new RDBTracingListenerConfiguration().createTracingListener(dataSource), instanceOf(RDBTracingListener.class)); } - @Test(expected = TracingConfigurationException.class) - public void assertCreateTracingListenerFailure() throws TracingConfigurationException { - new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource()); + @Test + public void assertCreateTracingListenerFailure() { + assertThrows(TracingConfigurationException.class, () -> + new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource())); } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index ef3ba055e9..3f67f4f355 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -26,11 +26,11 @@ import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import javax.sql.DataSource; import java.lang.reflect.Field; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.atMost; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class RDBTracingListenerTest { private static final String JOB_NAME = "test_rdb_event_listener"; @@ -49,7 +49,7 @@ public final class RDBTracingListenerTest { private JobTracingEventBus jobTracingEventBus; - @Before + @BeforeEach public void setUp() throws SQLException { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index 73d4ed5bc4..ce708f28a1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -22,19 +22,19 @@ import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.sql.SQLException; import java.util.List; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class RDBJobEventStorageTest { @@ -42,7 +42,7 @@ public final class RDBJobEventStorageTest { private BasicDataSource dataSource; - @Before + @BeforeEach public void setup() throws SQLException { dataSource = new BasicDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); @@ -52,7 +52,7 @@ public void setup() throws SQLException { storage = RDBJobEventStorage.getInstance(dataSource); } - @After + @AfterEach public void teardown() throws SQLException { dataSource.close(); } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java index e8343dece4..8113a08c08 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java @@ -19,14 +19,14 @@ import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; import org.apache.shardingsphere.elasticjob.tracing.yaml.YamlTracingStorageConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import javax.sql.DataSource; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class YamlDataSourceConfigurationConverterTest { diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 858eb77658..f352732a2c 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -60,14 +60,6 @@ lombok - - org.mockito - mockito-core - - - org.mockito - mockito-inline - org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index 9f847c3794..c58409256c 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -18,15 +18,15 @@ package org.apache.shardingsphere.elasticjob.infra.concurrent; import org.awaitility.Awaitility; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ElasticJobExecutorServiceTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java index 01f6ce92cd..6aa87e4856 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java @@ -19,22 +19,22 @@ import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; import java.util.concurrent.ExecutorService; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ExecutorServiceReloadableTest { @Mock diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java index d3ff6ddae1..ee6b5bc620 100755 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.infra.context; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import java.util.HashMap; @@ -26,17 +26,18 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class ShardingItemParametersTest { - @Test(expected = JobConfigurationException.class) + @Test public void assertNewWhenPairFormatInvalid() { - new ShardingItemParameters("xxx-xxx"); + assertThrows(JobConfigurationException.class, () -> new ShardingItemParameters("xxx-xxx")); } - @Test(expected = JobConfigurationException.class) + @Test public void assertNewWhenItemIsNotNumber() { - new ShardingItemParameters("xxx=xxx"); + assertThrows(JobConfigurationException.class, () -> new ShardingItemParameters("xxx=xxx")); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java index b79085b9cf..93803aa430 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java @@ -19,15 +19,15 @@ import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.infra.context.fixture.TaskNode; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class TaskContextTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java index 6b350ce261..45d1e478e4 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.env; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index 158bd8bf1a..d2ea13281e 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.infra.env; import lombok.SneakyThrows; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -30,10 +30,10 @@ import java.util.Vector; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java index 8f133a4ac1..55341edc51 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.infra.env; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TimeServiceTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java index bca6b78832..2d585f41e9 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java @@ -17,11 +17,11 @@ package org.apache.shardingsphere.elasticjob.infra.exception; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ExceptionUtilsTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java index dc05af367c..c94cecd137 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.exception; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java index 5064ea34fb..24c4bd19b4 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.exception; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java index e624b932a4..5e08bc50c9 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.exception; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java index 363a1b6aca..4596f0da32 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.exception; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java index 9b1f087206..1cd13ae37d 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java index f6eb14c32f..11a516c001 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java @@ -20,10 +20,11 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl.AverageAllocationJobShardingStrategy; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl.OdevitySortByNameJobShardingStrategy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class JobShardingStrategyFactoryTest { @@ -32,9 +33,10 @@ public void assertGetDefaultStrategy() { assertThat(JobShardingStrategyFactory.getStrategy(null), instanceOf(AverageAllocationJobShardingStrategy.class)); } - @Test(expected = JobConfigurationException.class) + @Test public void assertGetInvalidStrategy() { - JobShardingStrategyFactory.getStrategy("INVALID"); + assertThrows(JobConfigurationException.class, () -> + JobShardingStrategyFactory.getStrategy("INVALID")); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java index b4e6ab51a0..9d6525f7a9 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java index b9dc84eab8..b651b1f542 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java index 04b3f7e198..e1709e9ab6 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java index 2dc51b2c51..863cd9860e 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java @@ -20,10 +20,11 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl.CPUUsageJobExecutorServiceHandler; import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl.SingleThreadJobExecutorServiceHandler; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class JobExecutorServiceHandlerFactoryTest { @@ -32,9 +33,10 @@ public void assertGetDefaultHandler() { assertThat(JobExecutorServiceHandlerFactory.getHandler(""), instanceOf(CPUUsageJobExecutorServiceHandler.class)); } - @Test(expected = JobConfigurationException.class) + @Test public void assertGetInvalidHandler() { - JobExecutorServiceHandlerFactory.getHandler("INVALID"); + assertThrows(JobConfigurationException.class, () -> + JobExecutorServiceHandlerFactory.getHandler("INVALID")); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java index 49d1151c3e..b2a3e9720c 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandlerFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java index 7e15268310..f4b05ffc87 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandlerFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java index 40e4ae828f..23fc1a90e7 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java @@ -22,11 +22,13 @@ import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; +import org.junit.jupiter.api.Test; + import java.io.IOException; -import org.junit.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class GsonFactoryTest { @@ -66,10 +68,12 @@ public void assertParser() { assertThat(GsonFactory.getJsonParser().parse(json).getAsJsonObject().get("name").getAsString(), is("test")); } - @Test(expected = JsonParseException.class) + @Test public void assertParserWithException() { - String json = "{\"name\":\"test\""; - assertThat(GsonFactory.getJsonParser().parse(json).getAsJsonObject().get("name").getAsString(), is("test")); + assertThrows(JsonParseException.class, () -> { + String json = "{\"name\":\"test\""; + assertThat(GsonFactory.getJsonParser().parse(json).getAsJsonObject().get("name").getAsString(), is("test")); + }); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java index 2e94d4992d..f00a68bc87 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java @@ -19,16 +19,18 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.listener.fixture.FooElasticJobListener; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class ElasticJobListenerFactoryTest { - @Test(expected = JobConfigurationException.class) + @Test public void assertCreateInvalidJobListener() { - ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!")); + assertThrows(JobConfigurationException.class, () -> + ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!"))); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java index 4c4cd7d3f2..8eb20c5af0 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.infra.listener; import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java index 5129280b87..1fbdf14b07 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java @@ -19,16 +19,16 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Collections; import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class JobConfigurationPOJOTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java index 063ea3b2e4..fb0ad8b5cd 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java @@ -19,8 +19,9 @@ import org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService; import org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.Properties; @@ -29,7 +30,7 @@ public final class ElasticJobServiceLoaderTest { - @BeforeClass + @BeforeAll public static void register() { ElasticJobServiceLoader.registerTypedService(TypedFooService.class); } @@ -44,23 +45,27 @@ public void assertNewTypedServiceInstance() { assertThat(ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "typedFooServiceImpl").orElse(null), instanceOf(TypedFooService.class)); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertGetCacheTypedServiceFailureWithUnRegisteredServiceInterface() { - ElasticJobServiceLoader.getCachedTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new); + Assertions.assertThrows(IllegalArgumentException.class, () -> + ElasticJobServiceLoader.getCachedTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new)); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertGetCacheTypedServiceFailureWithInvalidType() { - ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new); + Assertions.assertThrows(IllegalArgumentException.class, () -> + ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new)); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertNewTypedServiceInstanceFailureWithUnRegisteredServiceInterface() { - ElasticJobServiceLoader.newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new); + Assertions.assertThrows(IllegalArgumentException.class, () -> + ElasticJobServiceLoader.newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new)); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertNewTypedServiceInstanceFailureWithInvalidType() { - ElasticJobServiceLoader.newTypedServiceInstance(TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new); + Assertions.assertThrows(IllegalArgumentException.class, () -> + ElasticJobServiceLoader.newTypedServiceInstance(TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java index ec652a6633..5f7e0e3c9c 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.validator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Properties; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java index fee915e059..9bebfef178 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.infra.yaml; import org.apache.shardingsphere.elasticjob.infra.yaml.fixture.FooYamlConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; public final class YamlEngineTest { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java index e6f4de178c..7c02c0ea57 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.infra.yaml.config; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; public final class YamlConfigurationConverterFactoryTest { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index 46951a2acf..6819cb1324 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -35,14 +35,6 @@ org.projectlombok lombok - - org.mockito - mockito-core - - - org.mockito - mockito-inline - org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java index 75be29dc20..bf382a5366 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.reg.base.transaction; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation.Type; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java index 4f3fde82bd..e619bf325b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java @@ -17,13 +17,15 @@ package org.apache.shardingsphere.elasticjob.reg.exception; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; public final class RegExceptionHandlerTest { @Test - @Ignore + @Disabled // TODO throw InterruptedException will cause zookeeper TestingServer break. Ignore first, fix it later. public void assertHandleExceptionWithInterruptedException() { RegExceptionHandler.handleException(new InterruptedException()); @@ -34,8 +36,8 @@ public void assertHandleExceptionWithNull() { RegExceptionHandler.handleException(null); } - @Test(expected = RegException.class) + @Test public void assertHandleExceptionWithOtherException() { - RegExceptionHandler.handleException(new RuntimeException()); + assertThrows(RegException.class, () -> RegExceptionHandler.handleException(new RuntimeException())); } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index c2f3614a9a..58210f29e2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -55,14 +55,6 @@ org.apache.curator curator-test - - org.mockito - mockito-core - - - org.mockito - mockito-inline - org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java index c7f8e7b3c0..4b11d653b4 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index a288292428..826ec40096 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -25,11 +25,11 @@ import org.apache.curator.test.KillSession; import org.apache.shardingsphere.elasticjob.reg.base.ElectionCandidate; import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; import java.util.concurrent.CountDownLatch; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class ZookeeperElectionServiceTest { private static final String HOST_AND_PORT = "localhost:8899"; @@ -49,7 +49,7 @@ public class ZookeeperElectionServiceTest { @Mock private ElectionCandidate electionCandidate; - @BeforeClass + @BeforeAll public static void init() { EmbedTestingServer.start(); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java index 7e58bddec1..bc8e215b14 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java @@ -20,13 +20,15 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; public final class ZookeeperRegistryCenterExecuteInLeaderTest { @@ -36,7 +38,7 @@ public final class ZookeeperRegistryCenterExecuteInLeaderTest { private static ZookeeperRegistryCenter zkRegCenter; - @BeforeClass + @BeforeAll public static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); @@ -44,12 +46,13 @@ public static void setUp() { zkRegCenter.init(); } - @AfterClass + @AfterAll public static void tearDown() { zkRegCenter.close(); } - @Test(timeout = 10000L) + @Test + @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) public void assertExecuteInLeader() throws InterruptedException { final int threads = 10; CountDownLatch countDownLatch = new CountDownLatch(threads); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index 6167856359..61626ceecb 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -23,12 +23,13 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; import org.apache.zookeeper.KeeperException.NoAuthException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class ZookeeperRegistryCenterForAuthTest { @@ -38,7 +39,7 @@ public final class ZookeeperRegistryCenterForAuthTest { private static ZookeeperRegistryCenter zkRegCenter; - @BeforeClass + @BeforeAll public static void setUp() { EmbedTestingServer.start(); ZOOKEEPER_CONFIGURATION.setDigest("digest:password"); @@ -49,7 +50,7 @@ public static void setUp() { ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - @AfterClass + @AfterAll public static void tearDown() { zkRegCenter.close(); } @@ -65,11 +66,13 @@ public void assertInitWithDigestSuccess() throws Exception { assertThat(client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"), is("deepNested".getBytes())); } - @Test(expected = NoAuthException.class) - public void assertInitWithDigestFailure() throws Exception { - CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); - client.start(); - client.blockUntilConnected(); - client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"); + @Test + public void assertInitWithDigestFailure() { + assertThrows(NoAuthException.class, () -> { + CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); + client.start(); + client.blockUntilConnected(); + client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"); + }); } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java index 7c18d224b2..9d301af581 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java @@ -18,13 +18,17 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; import org.apache.shardingsphere.elasticjob.reg.exception.RegException; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; public final class ZookeeperRegistryCenterInitFailureTest { - - @Test(expected = RegException.class) + + @Test public void assertInitFailure() { - ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("localhost:1", ZookeeperRegistryCenterInitFailureTest.class.getName())); - zkRegCenter.init(); + assertThrows(RegException.class, () -> { + ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("localhost:1", ZookeeperRegistryCenterInitFailureTest.class.getName())); + zkRegCenter.init(); + }); } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java index 9b2d42b01d..bd4f0a65ee 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java @@ -23,25 +23,25 @@ import org.apache.curator.framework.recipes.cache.CuratorCacheListener; import org.apache.curator.framework.state.ConnectionStateListener; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.ArrayList; import java.util.List; import java.util.Map; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.any; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class ZookeeperRegistryCenterListenerTest { @Mock @@ -63,7 +63,7 @@ public class ZookeeperRegistryCenterListenerTest { private final String jobPath = "/test_job"; - @Before + @BeforeEach public void setUp() { regCenter = new ZookeeperRegistryCenter(null); ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "caches", caches); @@ -79,7 +79,7 @@ public void testAddConnectionStateChangedEventListener() throws Exception { } @Test - public void testWatch() throws Exception { + public void testWatch() { when(caches.get(jobPath + "/")).thenReturn(cache); when(cache.listenable()).thenReturn(dataListenable); regCenter.watch(jobPath, null, null); @@ -88,7 +88,7 @@ public void testWatch() throws Exception { } @Test - public void testRemoveDataListenersNonCache() throws Exception { + public void testRemoveDataListenersNonCache() { when(cache.listenable()).thenReturn(dataListenable); regCenter.removeDataListeners(jobPath); verify(cache.listenable(), never()).removeListener(any()); @@ -96,7 +96,7 @@ public void testRemoveDataListenersNonCache() throws Exception { } @Test - public void testRemoveDataListenersHasCache() throws Exception { + public void testRemoveDataListenersHasCache() { when(caches.get(jobPath + "/")).thenReturn(cache); when(cache.listenable()).thenReturn(dataListenable); List list = new ArrayList<>(); @@ -118,7 +118,7 @@ public void testRemoveDataListenersHasCacheEmptyListeners() throws Exception { } @Test - public void testRemoveConnStateListener() throws Exception { + public void testRemoveConnStateListener() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); List list = new ArrayList<>(); list.add(null); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java index 7c79aaaf9b..332ed279a0 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java @@ -20,9 +20,9 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.CuratorCache; import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; @@ -35,7 +35,7 @@ public final class ZookeeperRegistryCenterMiscellaneousTest { private static ZookeeperRegistryCenter zkRegCenter; - @BeforeClass + @BeforeAll public static void setUp() { EmbedTestingServer.start(); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); @@ -44,7 +44,7 @@ public static void setUp() { zkRegCenter.addCacheData("/test"); } - @AfterClass + @AfterAll public static void tearDown() { zkRegCenter.close(); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index b2cfe34bcb..45756679d4 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -22,18 +22,18 @@ import org.apache.curator.retry.RetryOneTime; import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.List; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ZookeeperRegistryCenterModifyTest { @@ -41,7 +41,7 @@ public final class ZookeeperRegistryCenterModifyTest { private static ZookeeperRegistryCenter zkRegCenter; - @BeforeClass + @BeforeAll public static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); @@ -50,7 +50,7 @@ public static void setUp() { ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - @AfterClass + @AfterAll public static void tearDown() { zkRegCenter.close(); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index fd66306e86..9940b8228c 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -19,13 +19,13 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; public final class ZookeeperRegistryCenterQueryWithCacheTest { @@ -34,7 +34,7 @@ public final class ZookeeperRegistryCenterQueryWithCacheTest { private static ZookeeperRegistryCenter zkRegCenter; - @BeforeClass + @BeforeAll public static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); @@ -44,7 +44,7 @@ public static void setUp() { zkRegCenter.addCacheData("/test"); } - @AfterClass + @AfterAll public static void tearDown() { zkRegCenter.close(); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index 94e10906a2..d8407dd7e5 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -19,18 +19,18 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ZookeeperRegistryCenterQueryWithoutCacheTest { @@ -39,7 +39,7 @@ public final class ZookeeperRegistryCenterQueryWithoutCacheTest { private static ZookeeperRegistryCenter zkRegCenter; - @BeforeClass + @BeforeAll public static void setUp() { EmbedTestingServer.start(); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); @@ -49,7 +49,7 @@ public static void setUp() { zkRegCenter.addCacheData("/other"); } - @AfterClass + @AfterAll public static void tearDown() { zkRegCenter.close(); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index dd619ef34e..52aa4f0400 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -21,37 +21,37 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; import org.apache.zookeeper.KeeperException; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.List; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; public final class ZookeeperRegistryCenterTransactionTest { - + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); - + private static ZookeeperRegistryCenter zkRegCenter; - - @BeforeClass + + @BeforeAll public static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); } - - @Before + + @BeforeEach public void setup() { ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - + @Test public void assertExecuteInTransactionSucceeded() throws Exception { List operations = new ArrayList<>(3); @@ -62,7 +62,7 @@ public void assertExecuteInTransactionSucceeded() throws Exception { zkRegCenter.executeInTransaction(operations); assertThat(zkRegCenter.getDirectly("/test/transaction"), is("transaction")); } - + @Test public void assertExecuteInTransactionFailed() throws Exception { List operations = new ArrayList<>(3); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index 58a08d60be..1bf5a24edc 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -21,25 +21,27 @@ import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.startsWith; import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterWatchTest { - + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); - + private static ZookeeperRegistryCenter zkRegCenter; - - @BeforeClass + + @BeforeAll public static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); @@ -47,13 +49,14 @@ public static void setUp() { zkRegCenter.init(); ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - - @AfterClass + + @AfterAll public static void tearDown() { zkRegCenter.close(); } - @Test(timeout = 10000L) + @Test + @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) public void assertWatchWithoutExecutor() throws InterruptedException { CountDownLatch waitingForCountDownValue = new CountDownLatch(1); String key = "/test-watch-without-executor"; @@ -70,8 +73,9 @@ public void assertWatchWithoutExecutor() throws InterruptedException { zkRegCenter.update(key, "countDown"); waitingForCountDownValue.await(); } - - @Test(timeout = 10000L) + + @Test + @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) public void assertWatchWithExecutor() throws InterruptedException { CountDownLatch waitingForCountDownValue = new CountDownLatch(1); String key = "/test-watch-with-executor"; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java index 1508ed4b07..70109d83e0 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java @@ -20,7 +20,7 @@ import org.apache.zookeeper.KeeperException.ConnectionLossException; import org.apache.zookeeper.KeeperException.NoNodeException; import org.apache.zookeeper.KeeperException.NodeExistsException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.List; diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index 9d0b82509d..61705269dd 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -47,14 +47,6 @@ slf4j-jdk14 true - - org.mockito - mockito-core - - - org.mockito - mockito-inline - io.netty netty-common diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java index aa302c2a97..6770959ca9 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java @@ -19,15 +19,15 @@ import org.apache.shardingsphere.elasticjob.restful.mapping.PathMatcher; import org.apache.shardingsphere.elasticjob.restful.mapping.RegexPathMatcher; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class RegexPathMatcherTest { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java index ea977967f5..f124f4ab45 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java @@ -19,12 +19,13 @@ import org.apache.shardingsphere.elasticjob.restful.mapping.MappingContext; import org.apache.shardingsphere.elasticjob.restful.mapping.RegexUrlPatternMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class RegexUrlPatternMapTest { @@ -58,11 +59,13 @@ public void assertAmbiguous() { assertThat(mappingContext.payload(), is(11)); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertDuplicate() { - RegexUrlPatternMap urlPatternMap = new RegexUrlPatternMap<>(); - urlPatternMap.put("/app/{jobName}/enable", 0); - urlPatternMap.put("/app/{jobName}", 1); - urlPatternMap.put("/app/{appName}", 2); + assertThrows(IllegalArgumentException.class, () -> { + RegexUrlPatternMap urlPatternMap = new RegexUrlPatternMap<>(); + urlPatternMap.put("/app/{jobName}/enable", 0); + urlPatternMap.put("/app/{jobName}", 1); + urlPatternMap.put("/app/{appName}", 2); + }); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java index 956ec4d3bb..9c79763559 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java @@ -18,9 +18,10 @@ package org.apache.shardingsphere.elasticjob.restful.deserializer; import io.netty.handler.codec.http.HttpHeaderValues; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class RequestBodyDeserializerFactoryTest { @@ -30,8 +31,9 @@ public void assertGetJsonDefaultDeserializer() { assertNotNull(deserializer); } - @Test(expected = RequestBodyDeserializerNotFoundException.class) + @Test public void assertDeserializerNotFound() { - RequestBodyDeserializerFactory.getRequestBodyDeserializer("Unknown"); + assertThrows(RequestBodyDeserializerNotFoundException.class, () -> + RequestBodyDeserializerFactory.getRequestBodyDeserializer("Unknown")); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java index 85a25864c3..d3dc3f022c 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java @@ -24,25 +24,26 @@ import org.apache.shardingsphere.elasticjob.restful.Filter; import org.apache.shardingsphere.elasticjob.restful.handler.HandleContext; import org.apache.shardingsphere.elasticjob.restful.handler.Handler; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; import java.util.Arrays; import java.util.Collections; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DefaultFilterChainTest { @Mock @@ -56,7 +57,7 @@ public final class DefaultFilterChainTest { private HandleContext handleContext; - @Before + @BeforeEach public void setUp() { handleContext = new HandleContext<>(httpRequest, httpResponse); } @@ -127,23 +128,27 @@ public void assertWithThreeFiltersDoResponseByTheSecond() { verify(ctx).writeAndFlush(httpResponse); } - @Test(expected = IllegalStateException.class) + @Test public void assertInvokeFinishedFilterChainWithoutFilter() { - DefaultFilterChain filterChain = new DefaultFilterChain(Collections.emptyList(), ctx, handleContext); - filterChain.next(httpRequest); - filterChain.next(httpRequest); + assertThrows(IllegalStateException.class, () -> { + DefaultFilterChain filterChain = new DefaultFilterChain(Collections.emptyList(), ctx, handleContext); + filterChain.next(httpRequest); + filterChain.next(httpRequest); + }); } - @Test(expected = IllegalStateException.class) + @Test public void assertInvokePassedThroughFilterChainWithTwoFilters() { - Filter firstFilter = spy(new PassableFilter()); - Filter secondFilter = spy(new PassableFilter()); - DefaultFilterChain filterChain = new DefaultFilterChain(Arrays.asList(firstFilter, secondFilter), ctx, handleContext); - filterChain.next(httpRequest); - verify(firstFilter).doFilter(httpRequest, httpResponse, filterChain); - verify(secondFilter).doFilter(httpRequest, httpResponse, filterChain); - verify(ctx).fireChannelRead(handleContext); - filterChain.next(httpRequest); + assertThrows(IllegalStateException.class, () -> { + Filter firstFilter = spy(new PassableFilter()); + Filter secondFilter = spy(new PassableFilter()); + DefaultFilterChain filterChain = new DefaultFilterChain(Arrays.asList(firstFilter, secondFilter), ctx, handleContext); + filterChain.next(httpRequest); + verify(firstFilter).doFilter(httpRequest, httpResponse, filterChain); + verify(secondFilter).doFilter(httpRequest, httpResponse, filterChain); + verify(ctx).fireChannelRead(handleContext); + filterChain.next(httpRequest); + }); } private boolean isPassedThrough(final DefaultFilterChain filterChain) { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java index d25e444f4d..f3f95c3dbc 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java @@ -22,11 +22,11 @@ import org.apache.shardingsphere.elasticjob.restful.Filter; import org.apache.shardingsphere.elasticjob.restful.handler.HandleContext; import org.apache.shardingsphere.elasticjob.restful.handler.Handler; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.List; @@ -35,7 +35,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class FilterChainInboundHandlerTest { @Mock @@ -46,7 +46,7 @@ public final class FilterChainInboundHandlerTest { private EmbeddedChannel channel; - @Before + @BeforeEach public void setUp() { channel = new EmbeddedChannel(new FilterChainInboundHandler(filterInstances)); } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java index 42ad6d0dcc..94b56c67f8 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java @@ -35,8 +35,8 @@ import org.apache.shardingsphere.elasticjob.restful.annotation.Param; import org.apache.shardingsphere.elasticjob.restful.annotation.ParamSource; import org.apache.shardingsphere.elasticjob.restful.annotation.RequestBody; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.Collections; @@ -47,7 +47,7 @@ public final class HandlerParameterDecoderTest { private EmbeddedChannel channel; - @Before + @BeforeEach public void setUp() { ContextInitializationInboundHandler contextInitializationInboundHandler = new ContextInitializationInboundHandler(); HttpRequestDispatcher httpRequestDispatcher = new HttpRequestDispatcher(Collections.singletonList(new DecoderTestController()), false); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java index a893325e55..185bcf1a3c 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java @@ -26,14 +26,18 @@ import org.apache.shardingsphere.elasticjob.restful.controller.JobController; import org.apache.shardingsphere.elasticjob.restful.handler.HandleContext; import org.apache.shardingsphere.elasticjob.restful.handler.HandlerNotFoundException; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; public final class HttpRequestDispatcherTest { - @Test(expected = HandlerNotFoundException.class) + @Test public void assertDispatcherHandlerNotFound() { - EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestDispatcher(Lists.newArrayList(new JobController()), false)); - FullHttpRequest fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/hello/myJob/myCron"); - channel.writeInbound(new HandleContext<>(fullHttpRequest, null)); + assertThrows(HandlerNotFoundException.class, () -> { + EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestDispatcher(Lists.newArrayList(new JobController()), false)); + FullHttpRequest fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/hello/myJob/myCron"); + channel.writeInbound(new HandleContext<>(fullHttpRequest, null)); + }); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java index 3cbf57eb6f..253b013e80 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java @@ -34,16 +34,18 @@ import org.apache.shardingsphere.elasticjob.restful.controller.JobController; import org.apache.shardingsphere.elasticjob.restful.handler.CustomIllegalStateExceptionHandler; import org.apache.shardingsphere.elasticjob.restful.pojo.JobPojo; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertEquals; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; public final class NettyRestfulServiceTest { @@ -55,7 +57,7 @@ public final class NettyRestfulServiceTest { private static RestfulService restfulService; - @BeforeClass + @BeforeAll public static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); @@ -66,7 +68,8 @@ public static void init() { } @SneakyThrows - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertRequestWithParameters() { String cron = "0 * * * * ?"; String uri = String.format("/job/myGroup/myJob?cron=%s", URLEncoder.encode(cron, "UTF-8")); @@ -88,7 +91,8 @@ public void assertRequestWithParameters() { }, TESTCASE_TIMEOUT); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertCustomExceptionHandler() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/job/throw/IllegalState"); request.headers().set("Exception-Message", "An illegal state exception message."); @@ -98,7 +102,8 @@ public void assertCustomExceptionHandler() { }, TESTCASE_TIMEOUT); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertUsingDefaultExceptionHandler() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/job/throw/IllegalArgument"); request.headers().set("Exception-Message", "An illegal argument exception message."); @@ -108,7 +113,8 @@ public void assertUsingDefaultExceptionHandler() { }, TESTCASE_TIMEOUT); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertReturnStatusCode() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/job/code/204"); HttpClient.request(HOST, PORT, request, httpResponse -> { @@ -116,7 +122,8 @@ public void assertReturnStatusCode() { }, TESTCASE_TIMEOUT); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertHandlerNotFound() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/not/found"); HttpClient.request(HOST, PORT, request, httpResponse -> { @@ -124,7 +131,8 @@ public void assertHandlerNotFound() { }, TESTCASE_TIMEOUT); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertRequestIndexWithSlash() { DefaultFullHttpRequest requestWithSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/"); HttpClient.request(HOST, PORT, requestWithSlash, httpResponse -> { @@ -132,7 +140,8 @@ public void assertRequestIndexWithSlash() { }, TESTCASE_TIMEOUT); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertRequestIndexWithoutSlash() { DefaultFullHttpRequest requestWithoutSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, ""); HttpClient.request(HOST, PORT, requestWithoutSlash, httpResponse -> { @@ -140,7 +149,7 @@ public void assertRequestIndexWithoutSlash() { }, TESTCASE_TIMEOUT); } - @AfterClass + @AfterAll public static void tearDown() { if (null != restfulService) { restfulService.shutdown(); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java index cca5caac56..a0bf589597 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java @@ -21,7 +21,9 @@ import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; import org.apache.shardingsphere.elasticjob.restful.controller.TrailingSlashTestController; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; public final class NettyRestfulServiceTrailingSlashInsensitiveTest { @@ -29,12 +31,14 @@ public final class NettyRestfulServiceTrailingSlashInsensitiveTest { private static final int PORT = 18082; - @Test(expected = IllegalArgumentException.class) + @Test public void assertPathDuplicateWhenTrailingSlashInsensitive() { - NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); - configuration.setHost(HOST); - configuration.addControllerInstances(new TrailingSlashTestController()); - RestfulService restfulService = new NettyRestfulService(configuration); - restfulService.startup(); + assertThrows(IllegalArgumentException.class, () -> { + NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); + configuration.setHost(HOST); + configuration.addControllerInstances(new TrailingSlashTestController()); + RestfulService restfulService = new NettyRestfulService(configuration); + restfulService.startup(); + }); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java index d089cad40c..2146168e9c 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java @@ -25,11 +25,13 @@ import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; import org.apache.shardingsphere.elasticjob.restful.controller.TrailingSlashTestController; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -44,7 +46,7 @@ public final class NettyRestfulServiceTrailingSlashSensitiveTest { private static RestfulService restfulService; - @BeforeClass + @BeforeAll public static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); @@ -54,7 +56,8 @@ public static void init() { restfulService.startup(); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertWithoutTrailingSlash() { DefaultFullHttpRequest requestWithSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/trailing/slash"); HttpClient.request(HOST, PORT, requestWithSlash, httpResponse -> { @@ -65,7 +68,8 @@ public void assertWithoutTrailingSlash() { }, TESTCASE_TIMEOUT); } - @Test(timeout = TESTCASE_TIMEOUT) + @Test + @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) public void assertWithTrailingSlash() { DefaultFullHttpRequest requestWithoutSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/trailing/slash/"); HttpClient.request(HOST, PORT, requestWithoutSlash, httpResponse -> { @@ -76,7 +80,7 @@ public void assertWithTrailingSlash() { }, TESTCASE_TIMEOUT); } - @AfterClass + @AfterAll public static void tearDown() { if (null != restfulService) { restfulService.shutdown(); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java index 1ed054fa1b..860637ef04 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java @@ -18,9 +18,10 @@ package org.apache.shardingsphere.elasticjob.restful.serializer; import io.netty.handler.codec.http.HttpHeaderValues; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class ResponseBodySerializerFactoryTest { @@ -30,8 +31,9 @@ public void assertGetJsonDefaultSerializer() { assertNotNull(serializer); } - @Test(expected = ResponseBodySerializerNotFoundException.class) + @Test public void assertSerializerNotFound() { - ResponseBodySerializerFactory.getResponseBodySerializer("Unknown"); + assertThrows(ResponseBodySerializerNotFoundException.class, () -> + ResponseBodySerializerFactory.getResponseBodySerializer("Unknown")); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java index 52d724150b..a50a3a1182 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.restful.wrapper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.LinkedHashMap; @@ -27,8 +27,8 @@ import java.util.Set; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; public final class QueryParameterMapTest { diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 1307b5d137..8de1f04b5f 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -98,14 +98,6 @@ org.apache.curator curator-test - - org.mockito - mockito-core - - - org.mockito - mockito-inline - org.slf4j jcl-over-slf4j diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java index 38e0411e89..14b9089843 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -25,10 +25,10 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.quartz.Scheduler; import org.quartz.SchedulerException; @@ -37,7 +37,8 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class OneOffJobBootstrapTest { @@ -47,26 +48,27 @@ public final class OneOffJobBootstrapTest { private ZookeeperRegistryCenter zkRegCenter; - @BeforeClass + @BeforeAll public static void init() { EmbedTestingServer.start(); } - @Before + @BeforeEach public void setUp() { zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); zkRegCenter.init(); } - @After + @AfterEach public void teardown() { zkRegCenter.close(); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertConfigFailedWithCron() { - new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> { - }, JobConfiguration.newBuilder("test_one_off_job_execute_with_config_cron", SHARDING_TOTAL_COUNT).cron("0/5 * * * * ?").build()); + assertThrows(IllegalArgumentException.class, () -> + new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> { + }, JobConfiguration.newBuilder("test_one_off_job_execute_with_config_cron", SHARDING_TOTAL_COUNT).cron("0/5 * * * * ?").build())); } @Test diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java index a8f778738a..4d507c32be 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java @@ -18,28 +18,29 @@ package org.apache.shardingsphere.elasticjob.lite.api.listener; import com.google.common.collect.Sets; +import org.apache.shardingsphere.elasticjob.infra.env.TimeService; +import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.TestDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.infra.env.TimeService; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class DistributeOnceElasticJobListenerTest { @Mock @@ -55,7 +56,7 @@ public final class DistributeOnceElasticJobListenerTest { private TestDistributeOnceElasticJobListener distributeOnceElasticJobListener; - @Before + @BeforeEach public void setUp() { distributeOnceElasticJobListener = new TestDistributeOnceElasticJobListener(elasticJobListenerCaller); distributeOnceElasticJobListener.setGuaranteeService(guaranteeService); @@ -85,14 +86,16 @@ public void assertBeforeJobExecutedWhenIsNotAllStartedAndNotTimeout() { verify(guaranteeService, times(0)).clearAllStartedInfo(); } - @Test(expected = JobSystemException.class) + @Test public void assertBeforeJobExecutedWhenIsNotAllStartedAndTimeout() { - when(guaranteeService.isRegisterStartSuccess(Sets.newHashSet(0, 1))).thenReturn(true); - when(guaranteeService.isAllStarted()).thenReturn(false); - when(timeService.getCurrentMillis()).thenReturn(0L, 2L); - distributeOnceElasticJobListener.beforeJobExecuted(shardingContexts); - verify(guaranteeService).registerStart(Arrays.asList(0, 1)); - verify(guaranteeService, times(0)).clearAllStartedInfo(); + assertThrows(JobSystemException.class, () -> { + when(guaranteeService.isRegisterStartSuccess(Sets.newHashSet(0, 1))).thenReturn(true); + when(guaranteeService.isAllStarted()).thenReturn(false); + when(timeService.getCurrentMillis()).thenReturn(0L, 2L); + distributeOnceElasticJobListener.beforeJobExecuted(shardingContexts); + verify(guaranteeService).registerStart(Arrays.asList(0, 1)); + verify(guaranteeService, times(0)).clearAllStartedInfo(); + }); } @Test @@ -114,13 +117,15 @@ public void assertAfterJobExecutedWhenIsAllCompletedAndNotTimeout() { verify(guaranteeService, times(0)).clearAllCompletedInfo(); } - @Test(expected = JobSystemException.class) + @Test public void assertAfterJobExecutedWhenIsAllCompletedAndTimeout() { - when(guaranteeService.isRegisterCompleteSuccess(Sets.newHashSet(0, 1))).thenReturn(true); - when(guaranteeService.isAllCompleted()).thenReturn(false); - when(timeService.getCurrentMillis()).thenReturn(0L, 2L); - distributeOnceElasticJobListener.afterJobExecuted(shardingContexts); - verify(guaranteeService).registerComplete(Arrays.asList(0, 1)); - verify(guaranteeService, times(0)).clearAllCompletedInfo(); + assertThrows(JobSystemException.class, () -> { + when(guaranteeService.isRegisterCompleteSuccess(Sets.newHashSet(0, 1))).thenReturn(true); + when(guaranteeService.isAllCompleted()).thenReturn(false); + when(timeService.getCurrentMillis()).thenReturn(0L, 2L); + distributeOnceElasticJobListener.afterJobExecuted(shardingContexts); + verify(guaranteeService).registerComplete(Arrays.asList(0, 1)); + verify(guaranteeService, times(0)).clearAllCompletedInfo(); + }); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java index 7ab88a002f..23a7bcec7d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java @@ -24,15 +24,16 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobInstanceRegistryTest { @Mock @@ -53,18 +54,22 @@ public void assertListenLabelNotMatch() { verify(regCenter, times(0)).get("/jobName"); } - @Test(expected = RuntimeException.class) + @Test public void assertListenScheduleJob() { - JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id")); - String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).cron("0/1 * * * * ?").label("label").build()); - jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); + assertThrows(RuntimeException.class, () -> { + JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id")); + String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).cron("0/1 * * * * ?").label("label").build()); + jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); + }); } - @Test(expected = RuntimeException.class) + @Test public void assertListenOneOffJob() { - JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id", "label")); - String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).label("label").build()); - jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); + assertThrows(RuntimeException.class, () -> { + JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id", "label")); + String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).label("label").build()); + jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); + }); } private String toYaml(final JobConfiguration build) { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java index 77a483db19..a4b88435df 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java @@ -19,21 +19,21 @@ import lombok.AccessLevel; import lombok.Getter; +import org.apache.shardingsphere.elasticjob.api.ElasticJob; +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; @Getter(AccessLevel.PROTECTED) public abstract class BaseIntegrateTest { @@ -73,14 +73,14 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el } } - @BeforeClass + @BeforeAll public static void init() { EmbedTestingServer.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REGISTRY_CENTER.init(); } - @Before + @BeforeEach public void setUp() { if (jobBootstrap instanceof ScheduleJobBootstrap) { ((ScheduleJobBootstrap) jobBootstrap).schedule(); @@ -89,7 +89,7 @@ public void setUp() { } } - @After + @AfterEach public void tearDown() { jobBootstrap.shutdown(); ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java index 3878df797d..e03256e165 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java @@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.hamcrest.MatcherAssert.assertThat; public abstract class DisabledJobIntegrateTest extends BaseIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java index c9a04f18c3..1e72926fb2 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lite.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; public final class OneOffDisabledJobIntegrateTest extends DisabledJobIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java index 99c6310f0e..fc220082bd 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java @@ -22,13 +22,13 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; import org.awaitility.Awaitility; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java index 1d50d84e54..799cd16c21 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java @@ -17,21 +17,21 @@ package org.apache.shardingsphere.elasticjob.lite.integrate.enable; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.integrate.BaseIntegrateTest; +import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.lite.integrate.BaseIntegrateTest; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public abstract class EnabledJobIntegrateTest extends BaseIntegrateTest { @@ -39,7 +39,7 @@ protected EnabledJobIntegrateTest(final TestType type, final ElasticJob elasticJ super(type, elasticJob); } - @Before + @BeforeEach public final void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java index 411f6776cc..42562ef8a4 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java @@ -20,13 +20,13 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; import org.awaitility.Awaitility; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class OneOffEnabledJobIntegrateTest extends EnabledJobIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java index 9772b0ce19..20ae0c32d1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java @@ -20,13 +20,13 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; import org.awaitility.Awaitility; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ScheduleEnabledJobIntegrateTest extends EnabledJobIntegrateTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java index 3986e8f518..2fd08a95c3 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java @@ -17,15 +17,15 @@ package org.apache.shardingsphere.elasticjob.lite.internal.annotation; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertTrue; - import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationSimpleJob; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class JobAnnotationBuilderTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java index bbc3e46cd3..e77d74970b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java @@ -32,9 +32,9 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; @Getter(AccessLevel.PROTECTED) public abstract class BaseAnnotationTest { @@ -73,14 +73,14 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el } } - @BeforeClass + @BeforeAll public static void init() { EmbedTestingServer.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REGISTRY_CENTER.init(); } - @Before + @BeforeEach public void setUp() { if (jobBootstrap instanceof ScheduleJobBootstrap) { ((ScheduleJobBootstrap) jobBootstrap).schedule(); @@ -89,7 +89,7 @@ public void setUp() { } } - @After + @AfterEach public void tearDown() { jobBootstrap.shutdown(); ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java index 0d88da1869..a566736fff 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -25,15 +25,15 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; import org.awaitility.Awaitility; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class OneOffEnabledJobTest extends BaseAnnotationTest { @@ -41,7 +41,7 @@ public OneOffEnabledJobTest() { super(TestType.ONE_OFF, new AnnotationUnShardingJob()); } - @Before + @BeforeEach public void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(1)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java index f81530b3db..56c9f17ea9 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -25,15 +25,15 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; import org.awaitility.Awaitility; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ScheduleEnabledJobTest extends BaseAnnotationTest { @@ -41,7 +41,7 @@ public ScheduleEnabledJobTest() { super(TestType.SCHEDULE, new AnnotationSimpleJob()); } - @Before + @BeforeEach public void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java index 1fa4e06a96..96bfdc0d6a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.lite.internal.config; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ConfigurationNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java index 3db03b76ae..5ae1541aa7 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java @@ -21,24 +21,25 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ConfigurationServiceTest { @Mock @@ -46,7 +47,7 @@ public final class ConfigurationServiceTest { private final ConfigurationService configService = new ConfigurationService(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(configService, "jobNodeStorage", jobNodeStorage); } @@ -79,16 +80,18 @@ public void assertLoadFromCacheButNull() { assertThat(actual.getShardingTotalCount(), is(3)); } - @Test(expected = JobConfigurationException.class) + @Test public void assertSetUpJobConfigurationJobConfigurationForJobConflict() { - when(jobNodeStorage.isJobRootNodeExisted()).thenReturn(true); - when(jobNodeStorage.getJobRootNodeData()).thenReturn("org.apache.shardingsphere.elasticjob.lite.api.script.api.ScriptJob"); - try { - configService.setUpJobConfiguration(null, JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); - } finally { - verify(jobNodeStorage).isJobRootNodeExisted(); - verify(jobNodeStorage).getJobRootNodeData(); - } + assertThrows(JobConfigurationException.class, () -> { + when(jobNodeStorage.isJobRootNodeExisted()).thenReturn(true); + when(jobNodeStorage.getJobRootNodeData()).thenReturn("org.apache.shardingsphere.elasticjob.lite.api.script.api.ScriptJob"); + try { + configService.setUpJobConfiguration(null, JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); + } finally { + verify(jobNodeStorage).isJobRootNodeExisted(); + verify(jobNodeStorage).getJobRootNodeData(); + } + }); } @Test @@ -130,14 +133,16 @@ public void assertIsMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironment verify(jobNodeStorage).getRegistryCenterTime(); } - @Test(expected = JobExecutionEnvironmentException.class) - public void assertIsNotMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { - when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); - when(jobNodeStorage.getRegistryCenterTime()).thenReturn(0L); - try { - configService.checkMaxTimeDiffSecondsTolerable(); - } finally { - verify(jobNodeStorage).getRegistryCenterTime(); - } + @Test + public void assertIsNotMaxTimeDiffSecondsTolerable() { + assertThrows(JobExecutionEnvironmentException.class, () -> { + when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); + when(jobNodeStorage.getRegistryCenterTime()).thenReturn(0L); + try { + configService.checkMaxTimeDiffSecondsTolerable(); + } finally { + verify(jobNodeStorage).getRegistryCenterTime(); + } + }); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java index 51ba639231..61a02bdf52 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java @@ -25,18 +25,18 @@ import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class RescheduleListenerManagerTest { @Mock @@ -50,7 +50,7 @@ public final class RescheduleListenerManagerTest { private final RescheduleListenerManager rescheduleListenerManager = new RescheduleListenerManager(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setSuperclassFieldValue(rescheduleListenerManager, "jobNodeStorage", jobNodeStorage); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java index 692b58f5e2..390b2b0414 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java @@ -27,18 +27,18 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ElectionListenerManagerTest { @Mock @@ -58,7 +58,7 @@ public final class ElectionListenerManagerTest { private final ElectionListenerManager electionListenerManager = new ElectionListenerManager(null, "test_job"); - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); ReflectionUtils.setSuperclassFieldValue(electionListenerManager, "jobNodeStorage", jobNodeStorage); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java index 75bb74bdc0..3158ce5f7c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java @@ -17,10 +17,10 @@ package org.apache.shardingsphere.elasticjob.lite.internal.election; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class LeaderNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java index b469f8ccfd..8fe0bb3b8e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java @@ -25,21 +25,21 @@ import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class LeaderServiceTest { @Mock @@ -56,7 +56,7 @@ public final class LeaderServiceTest { private LeaderService leaderService; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); leaderService = new LeaderService(null, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java index d9f72c6625..14bc79dd1c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java @@ -32,12 +32,12 @@ import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -50,7 +50,7 @@ import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class FailoverListenerManagerTest { @Mock @@ -79,7 +79,7 @@ public final class FailoverListenerManagerTest { private final FailoverListenerManager failoverListenerManager = new FailoverListenerManager(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setSuperclassFieldValue(failoverListenerManager, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(failoverListenerManager, "configService", configService); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java index a545c59fd9..48c966724f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java @@ -17,11 +17,11 @@ package org.apache.shardingsphere.elasticjob.lite.internal.failover; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; public final class FailoverNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java index f581262cf7..139c065c0a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java @@ -24,14 +24,14 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -45,7 +45,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.StrictStubs.class) +@ExtendWith(MockitoExtension.class) public final class FailoverServiceTest { @Mock @@ -65,7 +65,7 @@ public final class FailoverServiceTest { private final FailoverService failoverService = new FailoverService(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(failoverService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(failoverService, "shardingService", shardingService); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java index 695f875652..52591a5803 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java @@ -24,11 +24,11 @@ import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; @@ -36,7 +36,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class GuaranteeListenerManagerTest { @Mock @@ -50,7 +50,7 @@ public final class GuaranteeListenerManagerTest { private GuaranteeListenerManager guaranteeListenerManager; - @Before + @BeforeEach public void setUp() { guaranteeListenerManager = new GuaranteeListenerManager(null, "test_job", Arrays.asList(elasticJobListener, distributeOnceElasticJobListener)); ReflectionUtils.setSuperclassFieldValue(guaranteeListenerManager, "jobNodeStorage", jobNodeStorage); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java index 5c0c9fbde1..bb45e46b60 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java @@ -17,12 +17,12 @@ package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class GuaranteeNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java index 1e9c223cdf..fa8d052abd 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java @@ -23,21 +23,21 @@ import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class GuaranteeServiceTest { @Mock @@ -54,7 +54,7 @@ public final class GuaranteeServiceTest { private final GuaranteeService guaranteeService = new GuaranteeService(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(guaranteeService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(guaranteeService, "configService", configService); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java index 0d4433f251..d218aa9617 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java @@ -19,19 +19,19 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class InstanceNodeTest { private static InstanceNode instanceNode; - @BeforeClass + @BeforeAll public static void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); instanceNode = new InstanceNode("test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java index 0b056c6573..3ab2b42d66 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java @@ -22,22 +22,22 @@ import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class InstanceServiceTest { @Mock @@ -48,7 +48,7 @@ public final class InstanceServiceTest { private InstanceService instanceService; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); instanceService = new InstanceService(null, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java index d33aff32da..e3c6e0fc03 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java @@ -26,19 +26,19 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ShutdownListenerManagerTest { @Mock @@ -58,7 +58,7 @@ public final class ShutdownListenerManagerTest { private ShutdownListenerManager shutdownListenerManager; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); shutdownListenerManager = new ShutdownListenerManager(null, "test_job"); @@ -67,7 +67,7 @@ public void setUp() { ReflectionUtils.setSuperclassFieldValue(shutdownListenerManager, "jobNodeStorage", jobNodeStorage); } - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown("test_job"); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java index 59f68c99ca..00386e42ad 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java @@ -27,17 +27,17 @@ import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.internal.trigger.TriggerListenerManager; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ListenerManagerTest { @Mock @@ -72,7 +72,7 @@ public final class ListenerManagerTest { private final ListenerManager listenerManager = new ListenerManager(null, "test_job", Collections.emptyList()); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(listenerManager, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(listenerManager, "electionListenerManager", electionListenerManager); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java index fea0bebf6e..8f322174e8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java @@ -17,16 +17,16 @@ package org.apache.shardingsphere.elasticjob.lite.internal.listener; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.concurrent.Executor; -import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.CoreMatchers.notNullValue; +import static org.hamcrest.MatcherAssert.assertThat; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public class ListenerNotifierManagerTest { @Test diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java index abb71b2b39..df2d796297 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java @@ -27,11 +27,11 @@ import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener.State; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class RegistryCenterConnectionStateListenerTest { @Mock @@ -62,7 +62,7 @@ public final class RegistryCenterConnectionStateListenerTest { private RegistryCenterConnectionStateListener regCenterConnectionStateListener; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); regCenterConnectionStateListener = new RegistryCenterConnectionStateListener(null, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java index 1d0ed12656..425b298161 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java @@ -25,17 +25,17 @@ import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ReconcileServiceTest { @Mock @@ -49,7 +49,7 @@ public final class ReconcileServiceTest { private ReconcileService reconcileService; - @Before + @BeforeEach public void setup() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); reconcileService = new ReconcileService(regCenter, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java index 428d902c3b..804c367c08 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java @@ -20,12 +20,12 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java index 459e0124e0..5d690953db 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java @@ -19,11 +19,11 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.JobDetail; import org.quartz.JobKey; import org.quartz.Scheduler; @@ -33,8 +33,9 @@ import org.quartz.impl.triggers.CronTriggerImpl; import org.quartz.impl.triggers.SimpleTriggerImpl; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doThrow; @@ -42,7 +43,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobScheduleControllerTest { @Mock @@ -53,20 +54,22 @@ public final class JobScheduleControllerTest { private JobScheduleController jobScheduleController; - @Before + @BeforeEach public void setUp() { jobScheduleController = new JobScheduleController(scheduler, jobDetail, "test_job_Trigger"); } - @Test(expected = JobSystemException.class) - public void assertIsPausedFailure() throws SchedulerException { - doThrow(SchedulerException.class).when(scheduler).getTriggerState(new TriggerKey("test_job_Trigger")); - ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); - try { - jobScheduleController.isPaused(); - } finally { - verify(scheduler).getTriggerState(new TriggerKey("test_job_Trigger")); - } + @Test + public void assertIsPausedFailure() { + assertThrows(JobSystemException.class, () -> { + doThrow(SchedulerException.class).when(scheduler).getTriggerState(new TriggerKey("test_job_Trigger")); + ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); + try { + jobScheduleController.isPaused(); + } finally { + verify(scheduler).getTriggerState(new TriggerKey("test_job_Trigger")); + } + }); } @Test @@ -98,15 +101,17 @@ public void assertPauseJobIfShutdown() throws SchedulerException { verify(scheduler, times(0)).pauseAll(); } - @Test(expected = JobSystemException.class) - public void assertPauseJobFailure() throws SchedulerException { - doThrow(SchedulerException.class).when(scheduler).pauseAll(); - ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); - try { - jobScheduleController.pauseJob(); - } finally { - verify(scheduler).pauseAll(); - } + @Test + public void assertPauseJobFailure() { + assertThrows(JobSystemException.class, () -> { + doThrow(SchedulerException.class).when(scheduler).pauseAll(); + ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); + try { + jobScheduleController.pauseJob(); + } finally { + verify(scheduler).pauseAll(); + } + }); } @Test @@ -124,15 +129,17 @@ public void assertResumeJobIfShutdown() throws SchedulerException { verify(scheduler, times(0)).resumeAll(); } - @Test(expected = JobSystemException.class) - public void assertResumeJobFailure() throws SchedulerException { - doThrow(SchedulerException.class).when(scheduler).resumeAll(); - ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); - try { - jobScheduleController.resumeJob(); - } finally { - verify(scheduler).resumeAll(); - } + @Test + public void assertResumeJobFailure() { + assertThrows(JobSystemException.class, () -> { + doThrow(SchedulerException.class).when(scheduler).resumeAll(); + ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); + try { + jobScheduleController.resumeJob(); + } finally { + verify(scheduler).resumeAll(); + } + }); } @Test @@ -152,20 +159,22 @@ public void assertTriggerJobIfShutdown() throws SchedulerException { verify(scheduler, times(0)).triggerJob(any()); } - @Test(expected = JobSystemException.class) - public void assertTriggerJobFailure() throws SchedulerException { - JobKey jobKey = new JobKey("test_job"); - when(jobDetail.getKey()).thenReturn(jobKey); - when(scheduler.checkExists(jobKey)).thenReturn(true); - doThrow(SchedulerException.class).when(scheduler).triggerJob(jobKey); - ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); - ReflectionUtils.setFieldValue(jobScheduleController, "jobDetail", jobDetail); - try { - jobScheduleController.triggerJob(); - } finally { - verify(jobDetail, times(2)).getKey(); - verify(scheduler).triggerJob(jobKey); - } + @Test + public void assertTriggerJobFailure() { + assertThrows(JobSystemException.class, () -> { + JobKey jobKey = new JobKey("test_job"); + when(jobDetail.getKey()).thenReturn(jobKey); + when(scheduler.checkExists(jobKey)).thenReturn(true); + doThrow(SchedulerException.class).when(scheduler).triggerJob(jobKey); + ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); + ReflectionUtils.setFieldValue(jobScheduleController, "jobDetail", jobDetail); + try { + jobScheduleController.triggerJob(); + } finally { + verify(jobDetail, times(2)).getKey(); + verify(scheduler).triggerJob(jobKey); + } + }); } @Test @@ -201,15 +210,17 @@ public void assertShutdownJobIfShutdown() throws SchedulerException { verify(scheduler, times(0)).shutdown(); } - @Test(expected = JobSystemException.class) - public void assertShutdownFailure() throws SchedulerException { - doThrow(SchedulerException.class).when(scheduler).shutdown(false); - ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); - try { - jobScheduleController.shutdown(); - } finally { - verify(scheduler).shutdown(false); - } + @Test + public void assertShutdownFailure() { + assertThrows(JobSystemException.class, () -> { + doThrow(SchedulerException.class).when(scheduler).shutdown(false); + ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); + try { + jobScheduleController.shutdown(); + } finally { + verify(scheduler).shutdown(false); + } + }); } @Test @@ -227,16 +238,18 @@ public void assertRescheduleJobIfShutdown() throws SchedulerException { verify(scheduler, times(0)).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); } - @Test(expected = JobSystemException.class) - public void assertRescheduleJobFailure() throws SchedulerException { - when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new CronTriggerImpl()); - doThrow(SchedulerException.class).when(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); - ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); - try { - jobScheduleController.rescheduleJob("0/1 * * * * ?", null); - } finally { - verify(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); - } + @Test + public void assertRescheduleJobFailure() { + assertThrows(JobSystemException.class, () -> { + when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new CronTriggerImpl()); + doThrow(SchedulerException.class).when(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); + ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); + try { + jobScheduleController.rescheduleJob("0/1 * * * * ?", null); + } finally { + verify(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); + } + }); } @Test @@ -262,16 +275,18 @@ public void assertRescheduleJobIfShutdownForOneOffJob() throws SchedulerExceptio verify(scheduler, times(0)).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); } - @Test(expected = JobSystemException.class) - public void assertRescheduleJobFailureForOneOffJob() throws SchedulerException { - when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new SimpleTriggerImpl()); - doThrow(SchedulerException.class).when(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); - ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); - try { - jobScheduleController.rescheduleJob(); - } finally { - verify(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); - } + @Test + public void assertRescheduleJobFailureForOneOffJob() { + assertThrows(JobSystemException.class, () -> { + when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new SimpleTriggerImpl()); + doThrow(SchedulerException.class).when(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); + ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); + try { + jobScheduleController.rescheduleJob(); + } finally { + verify(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); + } + }); } @Test diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java index e827358fc5..db1ead14fa 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java @@ -19,11 +19,11 @@ import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import org.quartz.Trigger; import java.util.Collections; @@ -35,7 +35,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobTriggerListenerTest { @Mock @@ -49,7 +49,7 @@ public final class JobTriggerListenerTest { private JobTriggerListener jobTriggerListener; - @Before + @BeforeEach public void setUp() { jobTriggerListener = new JobTriggerListener(executionService, shardingService); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java index cb6d9a679c..964c5ea24a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java @@ -30,11 +30,11 @@ import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -45,7 +45,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class LiteJobFacadeTest { @Mock @@ -73,7 +73,7 @@ public final class LiteJobFacadeTest { private StringBuilder orderResult; - @Before + @BeforeEach public void setUp() { orderResult = new StringBuilder(); TestElasticJobListener l1 = new TestElasticJobListener(caller, "l1", 2, orderResult); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java index f4d30bd590..1609fa9bca 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java @@ -20,19 +20,19 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class SchedulerFacadeTest { @Mock @@ -49,7 +49,7 @@ public final class SchedulerFacadeTest { private SchedulerFacade schedulerFacade; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); schedulerFacade = new SchedulerFacade(null, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java index 742acdcbb8..2613122f56 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java @@ -19,19 +19,19 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public final class ServerNodeTest { private final ServerNode serverNode = new ServerNode("test_job"); - @BeforeClass + @BeforeAll public static void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java index 272e5cafa8..d775045c6a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java @@ -21,24 +21,24 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ServerServiceTest { @Mock @@ -52,7 +52,7 @@ public final class ServerServiceTest { private ServerService serverService; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); serverService = new ServerService(null, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java index 96e6c21d2a..06e41d512f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java index 0a76cf6633..34f52ae760 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.setup; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java index e5093e06c5..4d3eb4e547 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java @@ -26,18 +26,18 @@ import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Collections; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class SetUpFacadeTest { @Mock @@ -60,7 +60,7 @@ public final class SetUpFacadeTest { private SetUpFacade setUpFacade; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); setUpFacade = new SetUpFacade(regCenter, "test_job", Collections.emptyList()); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java index a99423e5e0..637729706b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java @@ -25,11 +25,11 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -38,10 +38,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ExecutionContextServiceTest { @Mock @@ -52,7 +52,7 @@ public final class ExecutionContextServiceTest { private final ExecutionContextService executionContextService = new ExecutionContextService(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(executionContextService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(executionContextService, "configService", configService); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java index d05b8ebc5f..edde6c7f2e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java @@ -24,12 +24,12 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -37,16 +37,16 @@ import java.util.Map; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.StrictStubs.class) +@ExtendWith(MockitoExtension.class) public final class ExecutionServiceTest { @Mock @@ -57,13 +57,13 @@ public final class ExecutionServiceTest { private final ExecutionService executionService = new ExecutionService(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(executionService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(executionService, "configService", configService); } - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown("test_job"); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java index 01ffde949e..1b5b6388a6 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java @@ -22,16 +22,16 @@ import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class MonitorExecutionListenerManagerTest { @Mock @@ -42,7 +42,7 @@ public final class MonitorExecutionListenerManagerTest { private final MonitorExecutionListenerManager monitorExecutionListenerManager = new MonitorExecutionListenerManager(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setSuperclassFieldValue(monitorExecutionListenerManager, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(monitorExecutionListenerManager, "executionService", executionService); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java index e7b4e0a140..5ea835479f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java @@ -30,18 +30,18 @@ import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ShardingListenerManagerTest { @Mock @@ -61,7 +61,7 @@ public final class ShardingListenerManagerTest { private ShardingListenerManager shardingListenerManager; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); shardingListenerManager = new ShardingListenerManager(null, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java index 9beb7687e8..f8354560d9 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java @@ -17,11 +17,11 @@ package org.apache.shardingsphere.elasticjob.lite.internal.sharding; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; public final class ShardingNodeTest { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java index e52451003f..e15ea7eadc 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java @@ -29,27 +29,27 @@ import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; import java.util.List; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.any; import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.StrictStubs.class) +@ExtendWith(MockitoExtension.class) public final class ShardingServiceTest { @Mock @@ -78,7 +78,7 @@ public final class ShardingServiceTest { private final ShardingService shardingService = new ShardingService(null, "test_job"); - @Before + @BeforeEach public void setUp() { ReflectionUtils.setFieldValue(shardingService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(shardingService, "leaderService", leaderService); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java index b3568b3fe5..c099d6b036 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java @@ -19,18 +19,18 @@ import lombok.AccessLevel; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; public abstract class BaseSnapshotServiceTest { @@ -53,20 +53,20 @@ public BaseSnapshotServiceTest(final ElasticJob elasticJob) { bootstrap = new ScheduleJobBootstrap(REG_CENTER, elasticJob, JobConfiguration.newBuilder(jobName, 3).cron("0/1 * * * * ?").overwrite(true).build()); } - @BeforeClass + @BeforeAll public static void init() { EmbedTestingServer.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REG_CENTER.init(); } - @Before + @BeforeEach public final void setUp() { REG_CENTER.init(); bootstrap.schedule(); } - @After + @AfterEach public final void tearDown() { bootstrap.shutdown(); ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java index 33c56cf7ef..551988fc36 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java @@ -19,13 +19,14 @@ import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.lang.reflect.Field; import java.net.ServerSocket; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; public final class SnapshotServiceDisableTest extends BaseSnapshotServiceTest { @@ -33,15 +34,17 @@ public SnapshotServiceDisableTest() { super(new DetailedFooJob()); } - @Test(expected = IOException.class) - public void assertMonitorWithDumpCommand() throws IOException { - SocketUtils.sendCommand(SnapshotService.DUMP_COMMAND, DUMP_PORT - 1); + @Test + public void assertMonitorWithDumpCommand() { + assertThrows(IOException.class, () -> SocketUtils.sendCommand(SnapshotService.DUMP_COMMAND, DUMP_PORT - 1)); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertPortInvalid() { - SnapshotService snapshotService = new SnapshotService(getREG_CENTER(), -1); - snapshotService.listen(); + assertThrows(IllegalArgumentException.class, () -> { + SnapshotService snapshotService = new SnapshotService(getREG_CENTER(), -1); + snapshotService.listen(); + }); } @Test diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java index 74879562fc..9f17dffb12 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java @@ -18,14 +18,14 @@ package org.apache.shardingsphere.elasticjob.lite.internal.snapshot; import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public final class SnapshotServiceEnableTest extends BaseSnapshotServiceTest { @@ -33,12 +33,12 @@ public SnapshotServiceEnableTest() { super(new DetailedFooJob()); } - @Before + @BeforeEach public void listenMonitor() { getSnapshotService().listen(); } - @After + @AfterEach public void closeMonitor() { getSnapshotService().close(); } @@ -50,7 +50,7 @@ public void assertMonitorWithCommand() throws IOException { } @Test - public void assertDumpJobDirectly() throws IOException { + public void assertDumpJobDirectly() { assertNotNull(getSnapshotService().dumpJobDirectly(getJobName())); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java index 6f3000d503..fa2c17073b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.storage; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java index a7c4a04ac1..839a120f13 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java @@ -24,11 +24,11 @@ import org.apache.shardingsphere.elasticjob.reg.exception.RegException; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -37,7 +37,8 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; @@ -45,7 +46,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobNodeStorageTest { @Mock @@ -53,7 +54,7 @@ public final class JobNodeStorageTest { private JobNodeStorage jobNodeStorage; - @Before + @BeforeEach public void setUp() { jobNodeStorage = new JobNodeStorage(regCenter, "test_job"); ReflectionUtils.setFieldValue(jobNodeStorage, "regCenter", regCenter); @@ -162,10 +163,12 @@ public void assertExecuteInTransactionSuccess() throws Exception { verify(regCenter).executeInTransaction(any(List.class)); } - @Test(expected = RegException.class) - public void assertExecuteInTransactionFailure() throws Exception { - doThrow(RuntimeException.class).when(regCenter).executeInTransaction(any(List.class)); - jobNodeStorage.executeInTransaction(Collections.singletonList(TransactionOperation.opAdd("/test_transaction", ""))); + @Test + public void assertExecuteInTransactionFailure() { + assertThrows(RegException.class, () -> { + doThrow(RuntimeException.class).when(regCenter).executeInTransaction(any(List.class)); + jobNodeStorage.executeInTransaction(Collections.singletonList(TransactionOperation.opAdd("/test_transaction", ""))); + }); } @Test diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java index 079ab6c3e4..ec3bf90130 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java @@ -24,17 +24,17 @@ import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class TriggerListenerManagerTest { @Mock @@ -51,7 +51,7 @@ public final class TriggerListenerManagerTest { private TriggerListenerManager triggerListenerManager; - @Before + @BeforeEach public void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); triggerListenerManager = new TriggerListenerManager(null, "test_job"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java index d8e2f4bd51..42b494bc11 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.util; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Arrays; import java.util.List; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index 232b8c53ba..4ed6e1c08d 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -51,15 +51,6 @@ org.apache.curator curator-test - - org.mockito - mockito-core - - - org.mockito - mockito-inline - - org.slf4j jcl-over-slf4j diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java index 53c7189bce..cf5b37263c 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java @@ -19,7 +19,7 @@ import org.apache.curator.test.TestingServer; import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import java.io.File; import java.io.IOException; @@ -30,7 +30,7 @@ public abstract class AbstractEmbedZookeeperBaseTest { private static volatile TestingServer testingServer; - @BeforeClass + @BeforeAll public static void setUp() { startEmbedTestingServer(); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java index 1079997705..f80089be91 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; import org.apache.shardingsphere.elasticjob.lite.lifecycle.AbstractEmbedZookeeperBaseTest; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java index 30d0777fcd..3defc997b4 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.lite.lifecycle.domain; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java index f188757d4b..2ad236c2e6 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java @@ -19,21 +19,21 @@ import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobOperateAPIImplTest { static final int DUMP_PORT = 9000; @@ -43,7 +43,7 @@ public final class JobOperateAPIImplTest { @Mock private CoordinatorRegistryCenter regCenter; - @Before + @BeforeEach public void setUp() { jobOperateAPI = new JobOperateAPIImpl(regCenter); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java index 9fc3656d0f..53ef7d293f 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java @@ -19,15 +19,15 @@ import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.mockito.Mockito.verify; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ShardingOperateAPIImplTest { private ShardingOperateAPI shardingOperateAPI; @@ -35,7 +35,7 @@ public final class ShardingOperateAPIImplTest { @Mock private CoordinatorRegistryCenter regCenter; - @Before + @BeforeEach public void setUp() { shardingOperateAPI = new ShardingOperateAPIImpl(regCenter); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java index beadc1e69e..c4a4b10536 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java @@ -21,13 +21,13 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.lang.reflect.Method; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; public final class RegistryCenterFactoryTest extends AbstractEmbedZookeeperBaseTest { diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java index d4ccad8ca7..704d490a09 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java @@ -23,21 +23,22 @@ import org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture.LifecycleYamlConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobConfigurationAPIImplTest { private JobConfigurationAPI jobConfigAPI; @@ -45,7 +46,7 @@ public final class JobConfigurationAPIImplTest { @Mock private CoordinatorRegistryCenter regCenter; - @Before + @BeforeEach public void setUp() { jobConfigAPI = new JobConfigurationAPIImpl(regCenter); } @@ -109,28 +110,34 @@ public void assertUpdateJobConfig() { verify(regCenter).update("/test_job/config", LifecycleYamlConstants.getDataflowJobYaml()); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertUpdateJobConfigIfJobNameIsEmpty() { - JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); - jobConfiguration.setJobName(""); - jobConfigAPI.updateJobConfiguration(jobConfiguration); + assertThrows(IllegalArgumentException.class, () -> { + JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); + jobConfiguration.setJobName(""); + jobConfigAPI.updateJobConfiguration(jobConfiguration); + }); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertUpdateJobConfigIfCronIsEmpty() { - JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); - jobConfiguration.setJobName("test_job"); - jobConfiguration.setCron(""); - jobConfigAPI.updateJobConfiguration(jobConfiguration); + assertThrows(IllegalArgumentException.class, () -> { + JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); + jobConfiguration.setJobName("test_job"); + jobConfiguration.setCron(""); + jobConfigAPI.updateJobConfiguration(jobConfiguration); + }); } - @Test(expected = IllegalArgumentException.class) + @Test public void assertUpdateJobConfigIfShardingTotalCountLessThanOne() { - JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); - jobConfiguration.setJobName("test_job"); - jobConfiguration.setCron("0/1 * * * * ?"); - jobConfiguration.setShardingTotalCount(0); - jobConfigAPI.updateJobConfiguration(jobConfiguration); + assertThrows(IllegalArgumentException.class, () -> { + JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); + jobConfiguration.setJobName("test_job"); + jobConfiguration.setCron("0/1 * * * * ?"); + jobConfiguration.setShardingTotalCount(0); + jobConfigAPI.updateJobConfiguration(jobConfiguration); + }); } @Test diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java index f17b2b26ca..124805e021 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java @@ -21,11 +21,11 @@ import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.JobBriefInfo; import org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture.LifecycleYamlConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -34,7 +34,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class JobStatisticsAPIImplTest { private JobStatisticsAPI jobStatisticsAPI; @@ -42,7 +42,7 @@ public final class JobStatisticsAPIImplTest { @Mock private CoordinatorRegistryCenter regCenter; - @Before + @BeforeEach public void setUp() { jobStatisticsAPI = new JobStatisticsAPIImpl(regCenter); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java index 4b4e8090d3..f56c2b6226 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java @@ -20,21 +20,21 @@ import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ServerStatisticsAPI; import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ServerBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ServerStatisticsAPIImplTest { private ServerStatisticsAPI serverStatisticsAPI; @@ -42,7 +42,7 @@ public final class ServerStatisticsAPIImplTest { @Mock private CoordinatorRegistryCenter regCenter; - @Before + @BeforeEach public void setUp() { serverStatisticsAPI = new ServerStatisticsAPIImpl(regCenter); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java index c89b605c45..8ebc51bb5f 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java @@ -20,20 +20,20 @@ import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingStatisticsAPI; import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ShardingInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ShardingStatisticsAPIImplTest { private ShardingStatisticsAPI shardingStatisticsAPI; @@ -41,7 +41,7 @@ public final class ShardingStatisticsAPIImplTest { @Mock private CoordinatorRegistryCenter regCenter; - @Before + @BeforeEach public void setUp() { shardingStatisticsAPI = new ShardingStatisticsAPIImpl(regCenter); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java index 4ed9da9ce4..4415b7ece5 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java @@ -23,7 +23,7 @@ import java.util.Collections; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; public final class ElasticJobConfigurationPropertiesTest { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java index 2a3607daf8..b21302701c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -22,25 +22,29 @@ import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl.AnnotationCustomJob; import org.apache.shardingsphere.elasticjob.lite.spring.core.scanner.ElasticJobScan; import org.awaitility.Awaitility; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertNotNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @SpringBootTest @ActiveProfiles("elasticjob") @ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl") -public class ElasticJobSpringBootScannerTest extends AbstractJUnit4SpringContextTests { - - @BeforeClass +public class ElasticJobSpringBootScannerTest { + + @Autowired + private ApplicationContext applicationContext; + + @BeforeAll public static void init() { EmbedTestingServer.start(); AnnotationCustomJob.reset(); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java index 59d9469c8e..b0ce4781f3 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java @@ -30,12 +30,13 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import javax.sql.DataSource; import java.lang.reflect.Field; @@ -49,18 +50,21 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @SpringBootTest @SpringBootApplication @ActiveProfiles("elasticjob") -public class ElasticJobSpringBootTest extends AbstractJUnit4SpringContextTests { - - @BeforeClass +public class ElasticJobSpringBootTest { + + @Autowired + private ApplicationContext applicationContext; + + @BeforeAll public static void init() { EmbedTestingServer.start(); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java index 66432d9599..979e58375f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.junit.Test; +import org.junit.jupiter.api.Test; public final class ZookeeperPropertiesTest { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java index 547599bb36..8649f70cc5 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java @@ -17,23 +17,27 @@ package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.snapshot; -import static org.junit.Assert.assertNotNull; - import org.apache.shardingsphere.elasticjob.lite.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; + +import static org.junit.jupiter.api.Assertions.assertNotNull; @SpringBootTest @SpringBootApplication @ActiveProfiles("snapshot") -public class ElasticJobSnapshotServiceConfigurationTest extends AbstractJUnit4SpringContextTests { +public class ElasticJobSnapshotServiceConfigurationTest { + + @Autowired + private ApplicationContext applicationContext; - @BeforeClass + @BeforeAll public static void init() { EmbedTestingServer.start(); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java index 5785969edb..c1ed9ccb4c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java @@ -19,27 +19,31 @@ import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; import org.springframework.core.ResolvableType; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; import javax.sql.DataSource; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; @SpringBootTest @SpringBootApplication @ActiveProfiles("tracing") -public class TracingConfigurationTest extends AbstractJUnit4SpringContextTests { +public class TracingConfigurationTest { - @BeforeClass + @Autowired + private ApplicationContext applicationContext; + + @BeforeAll public static void init() { EmbedTestingServer.start(); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java index af4107db93..315be983cc 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProviderFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; public final class JobClassNameProviderFactoryTest { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java index 9f7b6aea62..8477180208 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java @@ -17,16 +17,16 @@ package org.apache.shardingsphere.elasticjob.lite.spring.core.util; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; - import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.aop.framework.ProxyFactory; import org.springframework.aop.support.AopUtils; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + public final class AopTargetUtilsTest { @Test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index 8dc4c821f8..ac84b90730 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -82,10 +82,6 @@ org.aspectj aspectjweaver - - org.mockito - mockito-core - org.slf4j jcl-over-slf4j diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/aspect/SimpleAspect.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/aspect/SimpleAspect.java index 3d4b82df9d..0554769c59 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/aspect/SimpleAspect.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/aspect/SimpleAspect.java @@ -33,7 +33,11 @@ public class SimpleAspect { @Pointcut("execution(* org.apache.shardingsphere.elasticjob.lite.spring.fixture..*(..))") public void aspect() { } - + + /** + * Before operator. + * @param joinPoint joinPoint + */ @Before("aspect()") public void before(final JoinPoint joinPoint) { } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java index 879d953f94..60024db4d7 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -21,22 +21,22 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; @RequiredArgsConstructor -public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJUnit4SpringContextTests { +public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String simpleJobName; @@ -45,14 +45,14 @@ public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJU @Autowired private CoordinatorRegistryCenter regCenter; - @Before - @After + @BeforeEach + @AfterEach public void reset() { FooSimpleElasticJob.reset(); DataflowElasticJob.reset(); } - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); JobRegistry.getInstance().shutdown(throughputDataflowJobName); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index 8bb75a19f7..325780ad08 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -22,38 +22,42 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; @RequiredArgsConstructor -public abstract class AbstractOneOffJobSpringIntegrateTest extends AbstractZookeeperJUnit4SpringContextTests { +public abstract class AbstractOneOffJobSpringIntegrateTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String simpleJobName; private final String throughputDataflowJobName; + + @Autowired + private ApplicationContext applicationContext; @Autowired private CoordinatorRegistryCenter regCenter; - @Before - @After + @BeforeEach + @AfterEach public void reset() { FooSimpleElasticJob.reset(); DataflowElasticJob.reset(); } - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); JobRegistry.getInstance().shutdown(throughputDataflowJobName); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 438b4046e2..09202f3e46 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -19,12 +19,12 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; @@ -32,23 +32,23 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/withJobRef.xml") -public final class JobSpringNamespaceWithRefTest extends AbstractZookeeperJUnit4SpringContextTests { +public final class JobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String simpleJobName = "simpleElasticJob_job_ref"; @Autowired private CoordinatorRegistryCenter regCenter; - @Before - @After + @BeforeEach + @AfterEach public void reset() { RefFooSimpleElasticJob.reset(); } - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index 4b511053d8..4c1684cfdd 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.springframework.beans.factory.annotation.Autowired; @@ -33,10 +33,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/withJobType.xml") -public final class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnit4SpringContextTests { +public final class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String scriptJobName = "scriptElasticJob_job_type"; @@ -45,7 +45,7 @@ public final class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnit private Scheduler scheduler; - @After + @AfterEach public void tearDown() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(scheduler.getCurrentlyExecutingJobs().isEmpty(), is(true)) diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index d7c6af6323..e182f8c4de 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -20,36 +20,40 @@ import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobRef.xml") -public final class OneOffJobSpringNamespaceWithRefTest extends AbstractZookeeperJUnit4SpringContextTests { +public final class OneOffJobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String oneOffSimpleJobName = "oneOffSimpleElasticJobRef"; - + + @Autowired + private ApplicationContext applicationContext; + @Autowired private CoordinatorRegistryCenter regCenter; - @Before - @After + @BeforeEach + @AfterEach public void reset() { RefFooSimpleElasticJob.reset(); } - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown(oneOffSimpleJobName); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index c6f1f46dbb..e0ae1ae17d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -19,27 +19,31 @@ import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobType.xml") -public final class OneOffJobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnit4SpringContextTests { +public final class OneOffJobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String scriptJobName = "oneOffScriptElasticJob_job_type"; - + + @Autowired + private ApplicationContext applicationContext; + @Autowired private CoordinatorRegistryCenter regCenter; - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown(scriptJobName); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index 98f7d67cce..ab6971a9f9 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -20,35 +20,35 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; @RequiredArgsConstructor -public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJUnit4SpringContextTests { +public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String simpleJobName; @Autowired private CoordinatorRegistryCenter regCenter; - @Before - @After + @BeforeEach + @AfterEach public void reset() { AnnotationSimpleJob.reset(); } - @After + @AfterEach public void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java index 883cc431e4..3f8943f1ec 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java @@ -18,17 +18,19 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot; import org.apache.shardingsphere.elasticjob.lite.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; -import org.junit.Test; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; import java.io.IOException; +import static org.junit.jupiter.api.Assertions.assertThrows; + @ContextConfiguration(locations = "classpath:META-INF/snapshot/snapshotDisabled.xml") -public final class SnapshotSpringNamespaceDisableTest extends AbstractZookeeperJUnit4SpringContextTests { +public final class SnapshotSpringNamespaceDisableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { - @Test(expected = IOException.class) - public void assertSnapshotDisable() throws IOException { - SocketUtils.sendCommand(SnapshotService.DUMP_COMMAND, 9998); + @Test + public void assertSnapshotDisable() { + assertThrows(IOException.class, () -> SocketUtils.sendCommand(SnapshotService.DUMP_COMMAND, 9998)); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java index 92376cb92b..a1c94756ed 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java @@ -17,16 +17,16 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnit4SpringContextTests; -import org.junit.Test; +import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; import java.io.IOException; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; @ContextConfiguration(locations = "classpath:META-INF/snapshot/snapshotEnabled.xml") -public final class SnapshotSpringNamespaceEnableTest extends AbstractZookeeperJUnit4SpringContextTests { +public final class SnapshotSpringNamespaceEnableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { @Test public void assertSnapshotEnable() throws IOException { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnit4SpringContextTests.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java similarity index 81% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnit4SpringContextTests.java rename to elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java index 6a1832a00f..e623d7cd25 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnit4SpringContextTests.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java @@ -17,9 +17,11 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.TestExecutionListeners; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; +import org.springframework.test.context.junit.jupiter.SpringExtension; +@ExtendWith(SpringExtension.class) @TestExecutionListeners(EmbedZookeeperTestExecutionListener.class) -public abstract class AbstractZookeeperJUnit4SpringContextTests extends AbstractJUnit4SpringContextTests { +public abstract class AbstractZookeeperJUnitJupiterSpringContextTests { } diff --git a/pom.xml b/pom.xml index bf99960b2f..e9e772a3f4 100644 --- a/pom.xml +++ b/pom.xml @@ -343,6 +343,12 @@ ${mockito.version} test + + org.mockito + mockito-junit-jupiter + ${mockito.version} + test + org.aspectj aspectjweaver @@ -376,6 +382,26 @@ junit-vintage-engine test + + org.junit.jupiter + junit-jupiter + test + + + org.mockito + mockito-core + test + + + org.mockito + mockito-inline + test + + + org.mockito + mockito-junit-jupiter + test + diff --git a/src/main/resources/checkstyle.xml b/src/main/resources/checkstyle.xml index 496dca007c..00242136f7 100644 --- a/src/main/resources/checkstyle.xml +++ b/src/main/resources/checkstyle.xml @@ -117,7 +117,7 @@ - + diff --git a/src/main/resources/checkstyle_ci.xml b/src/main/resources/checkstyle_ci.xml index ba0e83d9ef..326987419b 100644 --- a/src/main/resources/checkstyle_ci.xml +++ b/src/main/resources/checkstyle_ci.xml @@ -112,7 +112,7 @@ - + @@ -226,7 +226,7 @@ - + From 458255fdda8b47bf3fc0efc3f9c1b37fac0e9569 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Mon, 18 Sep 2023 17:44:20 +0800 Subject: [PATCH 031/178] Change the strictness of some Mockito instances to LENIENT --- .../search/JobEventRdbSearchTest.java | 5 +-- .../scheduler/mesos/SchedulerEngineTest.java | 3 +- .../mesos/TaskLaunchScheduledServiceTest.java | 3 +- .../producer/ProducerManagerTest.java | 6 ++-- .../executor/ElasticJobExecutorTest.java | 3 +- .../http/executor/HttpJobExecutorTest.java | 8 +++-- .../ElasticJobExecutorServiceTest.java | 4 +-- .../operate/JobOperateAPIImplTest.java | 5 +-- .../statistics/JobStatisticsAPIImplTest.java | 5 +-- .../ShardingStatisticsAPIImplTest.java | 5 +-- .../AbstractJobSpringIntegrateTest.java | 4 +-- ...okeeperJUnitJupiterSpringContextTests.java | 10 +++++- pom.xml | 32 ++++--------------- 13 files changed, 46 insertions(+), 47 deletions(-) diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java index 41cfeed508..2d7315acdc 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java @@ -48,8 +48,9 @@ public final class JobEventRdbSearchTest { @Mock private PreparedStatement preparedStatement; - - @Mock + + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. + @Mock(strictness = Mock.Strictness.LENIENT) private ResultSet resultSet; @Mock diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java index d2304e7e3a..316eaafe5d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java @@ -44,6 +44,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -70,7 +71,7 @@ public final class SchedulerEngineTest { public void setUp() { schedulerEngine = new SchedulerEngine(taskScheduler, facadeService, new JobTracingEventBus(), frameworkIDService, statisticManager); ReflectionUtils.setFieldValue(schedulerEngine, "facadeService", facadeService); - when(facadeService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); + lenient().when(facadeService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); new RunningService(mock(CoordinatorRegistryCenter.class)).clear(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java index 5a8665a0ae..dd78117c0d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java @@ -53,6 +53,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -76,7 +77,7 @@ public final class TaskLaunchScheduledServiceTest { @BeforeEach public void setUp() { - when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"))); + lenient().when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"))); taskLaunchScheduledService = new TaskLaunchScheduledService(schedulerDriver, taskScheduler, facadeService, jobTracingEventBus); taskLaunchScheduledService.startUp(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java index 8465f88fb7..982c0ba250 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java @@ -36,9 +36,9 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.junit.jupiter.MockitoExtension; import java.util.Arrays; import java.util.Collections; @@ -50,7 +50,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -@RunWith(MockitoJUnitRunner.class) +@ExtendWith(MockitoExtension.class) public final class ProducerManagerTest { @Mock diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java index 5fdc2d9b07..d8ee2974ea 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java @@ -41,6 +41,7 @@ import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -242,7 +243,7 @@ private ShardingContexts createMultipleShardingContexts() { private void prepareForIsNotMisfire(final JobFacade jobFacade, final ShardingContexts shardingContexts) { when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); when(jobFacade.misfireIfRunning(shardingContexts.getShardingItemParameters().keySet())).thenReturn(false); - when(jobFacade.isExecuteMisfired(shardingContexts.getShardingItemParameters().keySet())).thenReturn(false); + lenient().when(jobFacade.isExecuteMisfired(shardingContexts.getShardingItemParameters().keySet())).thenReturn(false); } private void verifyForIsNotMisfire(final JobFacade jobFacade, final ShardingContexts shardingContexts) { diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index e056a81679..29d37f6e15 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -41,6 +41,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) @@ -60,8 +61,9 @@ public final class HttpJobExecutorTest { @Mock private JobFacade jobFacade; - - @Mock + + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. + @Mock(strictness = Mock.Strictness.LENIENT) private Properties properties; @Mock @@ -80,7 +82,7 @@ public static void init() { @BeforeEach public void setUp() { - when(jobConfig.getProps()).thenReturn(properties); + lenient().when(jobConfig.getProps()).thenReturn(properties); jobExecutor = new HttpJobExecutor(); } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index c58409256c..3db5903723 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -40,13 +40,13 @@ public void assertCreateExecutorService() { assertFalse(executorServiceObject.isShutdown()); ExecutorService executorService = executorServiceObject.createExecutorService(); executorService.submit(new FooTask()); - Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> { + Awaitility.await().atLeast(1L, TimeUnit.MILLISECONDS).atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> { assertThat(executorServiceObject.getActiveThreadCount(), is(1)); assertThat(executorServiceObject.getWorkQueueSize(), is(0)); assertFalse(executorServiceObject.isShutdown()); }); executorService.submit(new FooTask()); - Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> { + Awaitility.await().atLeast(1L, TimeUnit.MILLISECONDS).atMost(5L, TimeUnit.MINUTES).untilAsserted(() -> { assertThat(executorServiceObject.getActiveThreadCount(), is(1)); assertThat(executorServiceObject.getWorkQueueSize(), is(1)); assertFalse(executorServiceObject.isShutdown()); diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java index 2ad236c2e6..11c57d55eb 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java @@ -39,8 +39,9 @@ public final class JobOperateAPIImplTest { static final int DUMP_PORT = 9000; private JobOperateAPI jobOperateAPI; - - @Mock + + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. + @Mock(strictness = Mock.Strictness.LENIENT) private CoordinatorRegistryCenter regCenter; @BeforeEach diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java index 124805e021..b0c025043e 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java @@ -38,8 +38,9 @@ public final class JobStatisticsAPIImplTest { private JobStatisticsAPI jobStatisticsAPI; - - @Mock + + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. + @Mock(strictness = Mock.Strictness.LENIENT) private CoordinatorRegistryCenter regCenter; @BeforeEach diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java index 8ebc51bb5f..c92659d512 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java @@ -37,8 +37,9 @@ public final class ShardingStatisticsAPIImplTest { private ShardingStatisticsAPI shardingStatisticsAPI; - - @Mock + + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. + @Mock(strictness = Mock.Strictness.LENIENT) private CoordinatorRegistryCenter regCenter; @BeforeEach diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index ab6971a9f9..d7a3538940 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -52,14 +52,14 @@ public void reset() { public void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); } - + @Test public void assertSpringJobBean() { assertSimpleElasticJobBean(); } private void assertSimpleElasticJobBean() { - Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> + Awaitility.await().atMost(5L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(AnnotationSimpleJob.isCompleted(), is(true)) ); assertTrue(AnnotationSimpleJob.isCompleted()); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java index e623d7cd25..b21c50105e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java @@ -21,7 +21,15 @@ import org.springframework.test.context.TestExecutionListeners; import org.springframework.test.context.junit.jupiter.SpringExtension; +/** + * Background reference AbstractJUnit4SpringContextTests + * and spring-projects/spring-framework#29149. + * + * @see org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests + */ @ExtendWith(SpringExtension.class) -@TestExecutionListeners(EmbedZookeeperTestExecutionListener.class) +@TestExecutionListeners(listeners = {EmbedZookeeperTestExecutionListener.class}, + inheritListeners = false, + mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS) public abstract class AbstractZookeeperJUnitJupiterSpringContextTests { } diff --git a/pom.xml b/pom.xml index e9e772a3f4..59f63a4a76 100644 --- a/pom.xml +++ b/pom.xml @@ -71,8 +71,7 @@ 8.0.16 1.4.184 - 4.13.2 - 5.10.0 + 5.10.0 2.2 4.11.0 4.2.0 @@ -313,15 +312,9 @@ ${h2.version} test - - junit - junit - ${junit.version} - test - org.hamcrest - hamcrest-core + hamcrest ${hamcrest.version} test @@ -330,12 +323,6 @@ mockito-core ${mockito.version} test - - - org.hamcrest - hamcrest-core - - org.mockito @@ -364,7 +351,7 @@ org.junit junit-bom - ${junit5.version} + ${junit.version} pom import @@ -373,18 +360,13 @@ - junit - junit - test - - - org.junit.vintage - junit-vintage-engine + org.junit.jupiter + junit-jupiter test - org.junit.jupiter - junit-jupiter + org.hamcrest + hamcrest test From de93e074099617116c9e97248522da2324023105 Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Mon, 18 Sep 2023 22:56:28 +0800 Subject: [PATCH 032/178] Update dependencies to avoid CVE (#2267) --- .../scheduler/fixture/EmbedTestingServer.java | 88 ++++++++++++-- .../src/main/release-docs/LICENSE | 58 ++++----- .../zookeeper/fixture/EmbedTestingServer.java | 104 +++++++++++++--- .../lite/internal/server/ServerService.java | 2 +- .../lite/fixture/EmbedTestingServer.java | 105 +++++++++++++--- .../AbstractEmbedZookeeperBaseTest.java | 93 ++++++++++++-- .../boot/job/fixture/EmbedTestingServer.java | 115 +++++++++++++----- .../EmbedZookeeperTestExecutionListener.java | 110 +++++++++++++---- pom.xml | 105 +++++----------- 9 files changed, 565 insertions(+), 215 deletions(-) diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java index 2cb9e6bc73..5b15150b46 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java @@ -19,43 +19,111 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.CuratorFrameworkState; +import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; -import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; +import org.apache.zookeeper.KeeperException; -import java.io.File; import java.io.IOException; +import java.util.Collection; +import java.util.concurrent.TimeUnit; @NoArgsConstructor(access = AccessLevel.PRIVATE) +@Slf4j public final class EmbedTestingServer { private static final int PORT = 10181; - + private static volatile TestingServer testingServer; - + + private static final Object INIT_LOCK = new Object(); + /** - * Start the embed server. + * Start embed zookeeper server. */ public static void start() { if (null != testingServer) { + log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); return; } + log.info("Starting embed zookeeper server..."); + synchronized (INIT_LOCK) { + if (null != testingServer) { + log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); + return; + } + start0(); + waitTestingServerReady(); + } + } + + private static void start0() { try { - testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + testingServer = new TestingServer(PORT, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } else { + log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { testingServer.close(); - } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + } catch (final IOException ignored) { } + log.info("Close embed zookeeper server done"); })); } } - + + private static void waitTestingServerReady() { + int maxRetries = 60; + try (CuratorFramework client = buildCuratorClient()) { + client.start(); + int round = 0; + while (round < maxRetries) { + try { + if (client.getZookeeperClient().isConnected()) { + log.info("client is connected"); + break; + } + if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { + CuratorFrameworkState state = client.getState(); + Collection childrenKeys = client.getChildren().forPath("/"); + log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); + break; + } + // CHECKSTYLE:OFF + } catch (final Exception ignored) { + // CHECKSTYLE:ON + } + ++round; + } + } + } + + private static CuratorFramework buildCuratorClient() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); + int retryIntervalMilliseconds = 500; + int maxRetries = 3; + builder.connectString(getConnectionString()) + .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) + .namespace("test"); + builder.sessionTimeoutMs(60 * 1000); + builder.connectionTimeoutMs(500); + return builder.build(); + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; + } + /** * Get the connection string. * diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE index e7e7090f64..a32daa0182 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE @@ -216,44 +216,44 @@ The following components are provided under the Apache License. See project link The text of each license is the standard Apache 2.0 license. audience-annotations 0.5.0: https://github.com/apache/yetus, Apache 2.0 - commons-codec 1.10: https://github.com/apache/commons-codec, Apache 2.0 - commons-dbcp2 2.9.0: https://github.com/apache/commons-dbcp, Apache 2.0 + commons-codec 1.16.0: https://github.com/apache/commons-codec, Apache 2.0 + commons-dbcp2 2.11.1: https://github.com/apache/commons-dbcp, Apache 2.0 commons-exec 1.3: http://commons.apache.org/proper/commons-exec, Apache 2.0 commons-lang 2.6: https://github.com/apache/commons-lang, Apache 2.0 commons-lang3 3.4: https://github.com/apache/commons-lang, Apache 2.0 commons-logging 1.2: https://github.com/apache/commons-logging, Apache 2.0 commons-pool2 2.8.1: https://github.com/apache/commons-pool, Apache 2.0 - curator-client 5.1.0: https://github.com/apache/curator, Apache 2.0 - curator-framework 5.1.0: https://github.com/apache/curator, Apache 2.0 - curator-recipes 5.1.0: https://github.com/apache/curator, Apache 2.0 + curator-client 5.5.0: https://github.com/apache/curator, Apache 2.0 + curator-framework 5.5.0: https://github.com/apache/curator, Apache 2.0 + curator-recipes 5.5.0: https://github.com/apache/curator, Apache 2.0 error_prone_annotations 2.3.4: https://github.com/google/error-prone, Apache 2.0 failureaccess 1.0.1:https://github.com/google/guava, Apache 2.0 - fenzo-core 0.11.1: https://github.com/Netflix/Fenzo, Apache 2.0 - gson 2.6.1: https://github.com/google/gson, Apache 2.0 - guava 29.0-jre: https://github.com/google/guava, Apache 2.0 + fenzo-core 1.0.1: https://github.com/Netflix/Fenzo, Apache 2.0 + gson 2.10.1: https://github.com/google/gson, Apache 2.0 + guava 30.0-jre: https://github.com/google/guava, Apache 2.0 HikariCP-java7 2.4.13: https://github.com/brettwooldridge/HikariCP, Apache 2.0 - httpclient 4.5.13: https://github.com/apache/httpcomponents-client, Apache 2.0 - httpcore 4.4.13: https://github.com/apache/httpcomponents-core, Apache 2.0 + httpclient 4.5.14: https://github.com/apache/httpcomponents-client, Apache 2.0 + httpcore 4.4.16: https://github.com/apache/httpcomponents-core, Apache 2.0 jackson-annotations 2.4.0: https://github.com/FasterXML/jackson-annotations, Apache 2.0 jackson-core 2.4.5: https://github.com/FasterXML/jackson-core, Apache 2.0 jackson-databind 2.4.5: https://github.com/FasterXML/jackson-core, Apache 2.0 listenablefuture 9999.0-empty-to-avoid-conflict-with-guava:https://github.com/google/guava, Apache 2.0 log4j 1.2.17: http://logging.apache.org/log4j/1.2/, Apache 2.0 - log4j-over-slf4j 1.7.7: https://github.com/qos-ch/slf4j, Apache 2.0 - mesos 1.1.0: http://mesos.apache.org/, Apache 2.0 - netty-buffer 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-codec 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-codec-http 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-common 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-handler 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-resolver 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-transport 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-transport-native-epoll 4.1.45.Final: https://github.com/netty, Apache 2.0 - netty-transport-native-unix-common 4.1.45.Final: https://github.com/netty, Apache 2.0 + log4j-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0 + mesos 1.11.0: http://mesos.apache.org/, Apache 2.0 + netty-buffer 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-codec 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-codec-http 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-common 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-handler 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-resolver 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-transport 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-transport-native-epoll 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-transport-native-unix-common 4.1.97.Final: https://github.com/netty, Apache 2.0 quartz 2.3.2: https://github.com/quartz-scheduler/quartz, Apache 2.0 - snakeyaml 1.26: http://www.snakeyaml.org, Apache 2.0 - zookeeper 3.6.0: https://github.com/apache/zookeeper, Apache 2.0 - zookeeper-jute 3.6.0: https://github.com/apache/zookeeper, Apache 2.0 + snakeyaml 2.0: https://bitbucket.org/snakeyaml/snakeyaml/src, Apache 2.0 + zookeeper 3.9.0: https://github.com/apache/zookeeper, Apache 2.0 + zookeeper-jute 3.9.0: https://github.com/apache/zookeeper, Apache 2.0 ======================================================================== EPL licenses @@ -264,8 +264,8 @@ The text of each license is also included at licenses/LICENSE-[project].txt. jakarta.annotation-api 1.3.5: https://github.com/eclipse-ee4j/common-annotations-api, EPL 2.0 jakarta.el 3.0.3: https://github.com/eclipse-ee4j/el-ri, EPL 2.0 - logback-classic 1.2.3: https://github.com/qos-ch/logback, EPL 1.0 - logback-core 1.2.3: https://github.com/qos-ch/logback, EPL 1.0 + logback-classic 1.2.12: https://github.com/qos-ch/logback, EPL 1.0 + logback-core 1.2.12: https://github.com/qos-ch/logback, EPL 1.0 mchange-commons-java 0.2.15: https://github.com/swaldman/mchange-commons-java/tree/mchange-commons-java-0.2.15, EPL 1.0 ======================================================================== @@ -276,6 +276,6 @@ The following components are provided under the MIT License. See project link fo The text of each license is also included at licenses/LICENSE-[project].txt. checker-qual 2.11.1: https://github.com/typetools/checker-framework, MIT - jcl-over-slf4j 1.7.7: https://github.com/qos-ch/slf4j, MIT - jul-to-slf4j 1.7.7: https://github.com/qos-ch/slf4j, MIT - slf4j-api 1.7.7: https://github.com/qos-ch/slf4j, MIT + jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, MIT + jul-to-slf4j 1.7.36: https://github.com/qos-ch/slf4j, MIT + slf4j-api 1.7.36: https://github.com/qos-ch/slf4j, MIT diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java index b8349344b0..fac6876979 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java @@ -19,50 +19,118 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.CuratorFrameworkState; +import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; -import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; +import org.apache.zookeeper.KeeperException; -import java.io.File; import java.io.IOException; +import java.util.Collection; +import java.util.concurrent.TimeUnit; +@Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class EmbedTestingServer { private static final int PORT = 9181; - + private static volatile TestingServer testingServer; - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } - + + private static final Object INIT_LOCK = new Object(); + /** - * Start the server. + * Start embed zookeeper server. */ public static void start() { if (null != testingServer) { + log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); return; } + log.info("Starting embed zookeeper server..."); + synchronized (INIT_LOCK) { + if (null != testingServer) { + log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); + return; + } + start0(); + waitTestingServerReady(); + } + } + + private static void start0() { try { - testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + testingServer = new TestingServer(PORT, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } else { + log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { testingServer.close(); - } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + } catch (final IOException ignored) { } + log.info("Close embed zookeeper server done"); })); } } + + private static void waitTestingServerReady() { + int maxRetries = 60; + try (CuratorFramework client = buildCuratorClient()) { + client.start(); + int round = 0; + while (round < maxRetries) { + try { + if (client.getZookeeperClient().isConnected()) { + log.info("client is connected"); + break; + } + if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { + CuratorFrameworkState state = client.getState(); + Collection childrenKeys = client.getChildren().forPath("/"); + log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); + break; + } + // CHECKSTYLE:OFF + } catch (final Exception ignored) { + // CHECKSTYLE:ON + } + ++round; + } + } + } + + private static CuratorFramework buildCuratorClient() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); + int retryIntervalMilliseconds = 500; + int maxRetries = 3; + builder.connectString(getConnectionString()) + .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) + .namespace("test"); + builder.sessionTimeoutMs(60 * 1000); + builder.connectionTimeoutMs(500); + return builder.build(); + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; + } + + /** + * Get the connection string. + * + * @return connection string + */ + public static String getConnectionString() { + return "localhost:" + PORT; + } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java index 011e4c17c8..f9dd30fbb3 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.server; import com.google.common.base.Strings; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/EmbedTestingServer.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/EmbedTestingServer.java index 838d2ec3df..7e4d6613be 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/EmbedTestingServer.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/EmbedTestingServer.java @@ -19,50 +19,117 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.CuratorFrameworkState; +import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; -import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; +import org.apache.zookeeper.KeeperException; -import java.io.File; import java.io.IOException; +import java.util.Collection; +import java.util.concurrent.TimeUnit; @NoArgsConstructor(access = AccessLevel.PRIVATE) +@Slf4j public final class EmbedTestingServer { private static final int PORT = 7181; - + private static volatile TestingServer testingServer; - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } - + + private static final Object INIT_LOCK = new Object(); + /** - * Start the server. + * Start embed zookeeper server. */ public static void start() { if (null != testingServer) { + log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); return; } + log.info("Starting embed zookeeper server..."); + synchronized (INIT_LOCK) { + if (null != testingServer) { + log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); + return; + } + start0(); + waitTestingServerReady(); + } + } + + private static void start0() { try { - testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + testingServer = new TestingServer(PORT, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } else { + log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { testingServer.close(); - } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + } catch (final IOException ignored) { } + log.info("Close embed zookeeper server done"); })); } } -} + private static void waitTestingServerReady() { + int maxRetries = 60; + try (CuratorFramework client = buildCuratorClient()) { + client.start(); + int round = 0; + while (round < maxRetries) { + try { + if (client.getZookeeperClient().isConnected()) { + log.info("client is connected"); + break; + } + if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { + CuratorFrameworkState state = client.getState(); + Collection childrenKeys = client.getChildren().forPath("/"); + log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); + break; + } + // CHECKSTYLE:OFF + } catch (final Exception ignored) { + // CHECKSTYLE:ON + } + ++round; + } + } + } + + private static CuratorFramework buildCuratorClient() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); + int retryIntervalMilliseconds = 500; + int maxRetries = 3; + builder.connectString(getConnectionString()) + .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) + .namespace("test"); + builder.sessionTimeoutMs(60 * 1000); + builder.connectionTimeoutMs(500); + return builder.build(); + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; + } + + /** + * Get the connection string. + * + * @return connection string + */ + public static String getConnectionString() { + return "localhost:" + PORT; + } +} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java index cf5b37263c..150c851edb 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java @@ -17,45 +17,116 @@ package org.apache.shardingsphere.elasticjob.lite.lifecycle; +import lombok.extern.slf4j.Slf4j; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.CuratorFrameworkState; +import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; -import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; +import org.apache.zookeeper.KeeperException; import org.junit.jupiter.api.BeforeAll; -import java.io.File; import java.io.IOException; +import java.util.Collection; +import java.util.concurrent.TimeUnit; +@Slf4j public abstract class AbstractEmbedZookeeperBaseTest { - + private static final int PORT = 8181; - + private static volatile TestingServer testingServer; - + + private static final Object INIT_LOCK = new Object(); + @BeforeAll public static void setUp() { startEmbedTestingServer(); } - + + /** + * Start embed zookeeper server. + */ private static void startEmbedTestingServer() { if (null != testingServer) { + log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); return; } + log.info("Starting embed zookeeper server..."); + synchronized (INIT_LOCK) { + if (null != testingServer) { + log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); + return; + } + start0(); + waitTestingServerReady(); + } + } + + private static void start0() { try { - testingServer = new TestingServer(PORT, new File(String.format("target/test_zk_data/%s/", System.nanoTime()))); + testingServer = new TestingServer(PORT, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } else { + log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { testingServer.close(); - } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + } catch (final IOException ignored) { } + log.info("Close embed zookeeper server done"); })); } } - + + private static void waitTestingServerReady() { + int maxRetries = 60; + try (CuratorFramework client = buildCuratorClient()) { + client.start(); + int round = 0; + while (round < maxRetries) { + try { + if (client.getZookeeperClient().isConnected()) { + log.info("client is connected"); + break; + } + if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { + CuratorFrameworkState state = client.getState(); + Collection childrenKeys = client.getChildren().forPath("/"); + log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); + break; + } + // CHECKSTYLE:OFF + } catch (final Exception ignored) { + // CHECKSTYLE:ON + } + ++round; + } + } + } + + private static CuratorFramework buildCuratorClient() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); + int retryIntervalMilliseconds = 500; + int maxRetries = 3; + builder.connectString(getConnectionString()) + .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) + .namespace("test"); + builder.sessionTimeoutMs(60 * 1000); + builder.connectionTimeoutMs(500); + return builder.build(); + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; + } + /** * Get the connection string. * diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java index c1f4e16e16..8c862435a1 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java @@ -19,68 +19,117 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.curator.CuratorZookeeperClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; -import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; -import org.awaitility.Awaitility; -import org.hamcrest.Matchers; +import org.apache.zookeeper.KeeperException; import java.io.IOException; +import java.util.Collection; import java.util.concurrent.TimeUnit; -import static org.hamcrest.MatcherAssert.assertThat; - @NoArgsConstructor(access = AccessLevel.PRIVATE) +@Slf4j public final class EmbedTestingServer { - + private static final int PORT = 18181; - + private static volatile TestingServer testingServer; - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } - + + private static final Object INIT_LOCK = new Object(); + /** - * Start the server. + * Start embed zookeeper server. */ public static void start() { if (null != testingServer) { + log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); return; } + log.info("Starting embed zookeeper server..."); + synchronized (INIT_LOCK) { + if (null != testingServer) { + log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); + return; + } + start0(); + waitTestingServerReady(); + } + } + + private static void start0() { try { testingServer = new TestingServer(PORT, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } else { + log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { testingServer.close(); - } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + } catch (final IOException ignored) { } + log.info("Close embed zookeeper server done"); })); } - try (CuratorZookeeperClient client = new CuratorZookeeperClient(getConnectionString(), - 60 * 1000, 500, null, - new ExponentialBackoffRetry(500, 3, 500 * 3))) { + } + + private static void waitTestingServerReady() { + int maxRetries = 60; + try (CuratorFramework client = buildCuratorClient()) { client.start(); - Awaitility.await() - .atLeast(100L, TimeUnit.MILLISECONDS) - .atMost(500 * 60L, TimeUnit.MILLISECONDS) - .untilAsserted(() -> assertThat(client.isConnected(), Matchers.is(true))); - // CHECKSTYLE:OFF - } catch (Exception e) { - // CHECKSTYLE:ON - throw new RuntimeException(e); + int round = 0; + while (round < maxRetries) { + try { + if (client.getZookeeperClient().isConnected()) { + log.info("client is connected"); + break; + } + if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { + CuratorFrameworkState state = client.getState(); + Collection childrenKeys = client.getChildren().forPath("/"); + log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); + break; + } + // CHECKSTYLE:OFF + } catch (final Exception ignored) { + // CHECKSTYLE:ON + } + ++round; + } } } + + private static CuratorFramework buildCuratorClient() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); + int retryIntervalMilliseconds = 500; + int maxRetries = 3; + builder.connectString(getConnectionString()) + .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) + .namespace("test"); + builder.sessionTimeoutMs(60 * 1000); + builder.connectionTimeoutMs(500); + return builder.build(); + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; + } + + /** + * Get the connection string. + * + * @return connection string + */ + public static String getConnectionString() { + return "localhost:" + PORT; + } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java index 1e8ff5988c..9b29da7d11 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java @@ -17,60 +17,126 @@ package org.apache.shardingsphere.elasticjob.lite.spring.namespace.test; -import org.apache.curator.CuratorZookeeperClient; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.curator.framework.CuratorFramework; +import org.apache.curator.framework.CuratorFrameworkFactory; +import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.retry.ExponentialBackoffRetry; import org.apache.curator.test.TestingServer; -import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler; -import org.awaitility.Awaitility; -import org.hamcrest.Matchers; +import org.apache.zookeeper.KeeperException; import org.springframework.test.context.TestContext; import org.springframework.test.context.support.AbstractTestExecutionListener; import java.io.IOException; +import java.util.Collection; import java.util.concurrent.TimeUnit; -import static org.hamcrest.MatcherAssert.assertThat; - +@NoArgsConstructor(access = AccessLevel.PRIVATE) +@Slf4j public final class EmbedZookeeperTestExecutionListener extends AbstractTestExecutionListener { - + + private static final int PORT = 3181; + private static volatile TestingServer testingServer; + + private static final Object INIT_LOCK = new Object(); @Override public void beforeTestClass(final TestContext testContext) { startEmbedTestingServer(); } + /** + * Start embed zookeeper server. + */ private static void startEmbedTestingServer() { if (null != testingServer) { + log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); return; } + log.info("Starting embed zookeeper server..."); + synchronized (INIT_LOCK) { + if (null != testingServer) { + log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); + return; + } + start0(); + waitTestingServerReady(); + } + } + + private static void start0() { try { - testingServer = new TestingServer(3181, true); + testingServer = new TestingServer(PORT, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON - RegExceptionHandler.handleException(ex); + if (!isIgnoredException(ex)) { + throw new RuntimeException(ex); + } else { + log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); + } } finally { Runtime.getRuntime().addShutdownHook(new Thread(() -> { try { testingServer.close(); - } catch (final IOException ex) { - RegExceptionHandler.handleException(ex); + } catch (final IOException ignored) { } + log.info("Close embed zookeeper server done"); })); } - try (CuratorZookeeperClient client = new CuratorZookeeperClient(testingServer.getConnectString(), - 60 * 1000, 500, null, - new ExponentialBackoffRetry(500, 3, 500 * 3))) { + } + + private static void waitTestingServerReady() { + int maxRetries = 60; + try (CuratorFramework client = buildCuratorClient()) { client.start(); - Awaitility.await() - .atLeast(100L, TimeUnit.MILLISECONDS) - .atMost(500 * 60L, TimeUnit.MILLISECONDS) - .untilAsserted(() -> assertThat(client.isConnected(), Matchers.is(true))); - // CHECKSTYLE:OFF - } catch (Exception e) { - // CHECKSTYLE:ON - throw new RuntimeException(e); + int round = 0; + while (round < maxRetries) { + try { + if (client.getZookeeperClient().isConnected()) { + log.info("client is connected"); + break; + } + if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { + CuratorFrameworkState state = client.getState(); + Collection childrenKeys = client.getChildren().forPath("/"); + log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); + break; + } + // CHECKSTYLE:OFF + } catch (final Exception ignored) { + // CHECKSTYLE:ON + } + ++round; + } } } + + private static CuratorFramework buildCuratorClient() { + CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); + int retryIntervalMilliseconds = 500; + int maxRetries = 3; + builder.connectString(getConnectionString()) + .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) + .namespace("test"); + builder.sessionTimeoutMs(60 * 1000); + builder.connectionTimeoutMs(500); + return builder.build(); + } + + private static boolean isIgnoredException(final Throwable cause) { + return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; + } + + /** + * Get the connection string. + * + * @return connection string + */ + public static String getConnectionString() { + return "localhost:" + PORT; + } } diff --git a/pom.xml b/pom.xml index 59f63a4a76..514053b7f0 100644 --- a/pom.xml +++ b/pom.xml @@ -46,26 +46,27 @@ UTF-8 zh_CN - 29.0-jre + 30.0-jre 3.4 2.3.2 - 5.1.0 + 3.9.0 + 5.5.0 1.18.24 1.9.1 - 1.7.7 - 1.2.3 - 1.10 + 1.7.36 + 1.2.12 + 1.16.0 1.3 - 4.5.13 - 4.4.13 + 4.5.14 + 4.4.16 2.0 - 2.6.1 - 4.1.59.Final - 1.1.0 - 0.11.1 - - 2.9.0 - 2.8.1 + 2.10.1 + 4.1.97.Final + 1.11.0 + 1.0.1 + + 2.10.0 + 2.11.1 3.4.2 1.6.0 @@ -227,46 +228,6 @@ pom import - - io.netty - netty-buffer - ${netty.version} - - - io.netty - netty-codec - ${netty.version} - - - io.netty - netty-common - ${netty.version} - - - io.netty - netty-handler - ${netty.version} - - - io.netty - netty-resolver - ${netty.version} - - - io.netty - netty-transport - ${netty.version} - - - io.netty - netty-transport-native-epoll - ${netty.version} - - - io.netty - netty-transport-native-unix-common - ${netty.version} - org.apache.mesos @@ -318,24 +279,6 @@ ${hamcrest.version} test - - org.mockito - mockito-core - ${mockito.version} - test - - - org.mockito - mockito-inline - ${mockito.version} - test - - - org.mockito - mockito-junit-jupiter - ${mockito.version} - test - org.aspectj aspectjweaver @@ -355,6 +298,24 @@ pom import + + org.mockito + mockito-bom + ${mockito.version} + pom + import + + + org.mockito + mockito-inline + ${mockito.version} + test + + + org.apache.zookeeper + zookeeper + ${zookeeper.version} + From 2668b866fef82aab5ac3a3728796d9a335097fb4 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Wed, 20 Sep 2023 12:38:54 +0800 Subject: [PATCH 033/178] Support for building with OpenJDK 21 --- .github/workflows/maven.yml | 2 +- .../DefaultJobClassNameProviderTest.java | 6 ++++- pom.xml | 27 +++++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6852a7a5ad..297d59517e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -30,7 +30,7 @@ jobs: build: strategy: matrix: - java: [ 8, 17, 19 ] + java: [ 8, 17, 21-ea ] os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ] runs-on: ${{ matrix.os }} diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java index 06e41d512f..a9739dc0d9 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java @@ -20,6 +20,8 @@ import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.JRE; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -32,8 +34,10 @@ public void assertGetOrdinaryClassJobName() { String result = jobClassNameProvider.getJobClassName(new DetailedFooJob()); assertThat(result, is("org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob")); } - + + // TODO OpenJDK 21 breaks this unit test. @Test + @DisabledForJreRange(min = JRE.JAVA_21, max = JRE.OTHER) public void assertGetLambdaJobName() { JobClassNameProvider jobClassNameProvider = new DefaultJobClassNameProvider(); FooJob lambdaFooJob = shardingContext -> { }; diff --git a/pom.xml b/pom.xml index 514053b7f0..9bf61bc11d 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 2.3.2 3.9.0 5.5.0 - 1.18.24 + 1.18.30 1.9.1 1.7.36 1.2.12 @@ -74,6 +74,7 @@ 1.4.184 5.10.0 2.2 + 1.14.8 4.11.0 4.2.0 @@ -93,7 +94,7 @@ 2.5 4.3.0 2.7 - 0.8.8 + 0.8.10 3.0.2 3.1.0 3.5 @@ -298,12 +299,34 @@ pom import + + net.bytebuddy + byte-buddy + ${bytebuddy.version} + test + + + net.bytebuddy + byte-buddy-agent + ${bytebuddy.version} + test + org.mockito mockito-bom ${mockito.version} pom import + + + net.bytebuddy + byte-buddy + + + net.bytebuddy + byte-buddy-agent + + org.mockito From 3a7fb7105fb17d25f0e9df6d0b49d53a8131a149 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Fri, 13 Oct 2023 18:39:36 +0800 Subject: [PATCH 034/178] Upgrade dependencies version (#2273) * Upgrade dependencies version --- .../rdb/StatisticRdbRepository.java | 10 +++--- .../src/main/release-docs/LICENSE | 24 +++++++------- .../elasticjob/infra/yaml/YamlEngine.java | 5 +-- examples/pom.xml | 2 +- pom.xml | 32 +++++++++---------- 5 files changed, 35 insertions(+), 38 deletions(-) diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java index c08c583c35..5b696181f9 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java @@ -81,8 +81,8 @@ private void createTaskResultTableIfNeeded(final Connection conn) throws SQLExce private void createTaskResultTable(final Connection conn, final StatisticInterval statisticInterval) throws SQLException { String dbSchema = "CREATE TABLE `" + TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval + "` (" + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`success_count` INT(11)," - + "`failed_count` INT(11)," + + "`success_count` INT," + + "`failed_count` INT," + "`statistics_time` TIMESTAMP NOT NULL," + "`creation_time` TIMESTAMP NOT NULL," + "PRIMARY KEY (`id`));"; @@ -103,7 +103,7 @@ private void createTaskRunningTableIfNeeded(final Connection conn) throws SQLExc private void createTaskRunningTable(final Connection conn) throws SQLException { String dbSchema = "CREATE TABLE `" + TABLE_TASK_RUNNING_STATISTICS + "` (" + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`running_count` INT(11)," + + "`running_count` INT," + "`statistics_time` TIMESTAMP NOT NULL," + "`creation_time` TIMESTAMP NOT NULL," + "PRIMARY KEY (`id`));"; @@ -124,7 +124,7 @@ private void createJobRunningTableIfNeeded(final Connection conn) throws SQLExce private void createJobRunningTable(final Connection conn) throws SQLException { String dbSchema = "CREATE TABLE `" + TABLE_JOB_RUNNING_STATISTICS + "` (" + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`running_count` INT(11)," + + "`running_count` INT," + "`statistics_time` TIMESTAMP NOT NULL," + "`creation_time` TIMESTAMP NOT NULL," + "PRIMARY KEY (`id`));"; @@ -145,7 +145,7 @@ private void createJobRegisterTableIfNeeded(final Connection conn) throws SQLExc private void createJobRegisterTable(final Connection conn) throws SQLException { String dbSchema = "CREATE TABLE `" + TABLE_JOB_REGISTER_STATISTICS + "` (" + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`registered_count` INT(11)," + + "`registered_count` INT," + "`statistics_time` TIMESTAMP NOT NULL," + "`creation_time` TIMESTAMP NOT NULL," + "PRIMARY KEY (`id`));"; diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE index a32daa0182..c3bf5bae68 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE @@ -220,7 +220,7 @@ The text of each license is the standard Apache 2.0 license. commons-dbcp2 2.11.1: https://github.com/apache/commons-dbcp, Apache 2.0 commons-exec 1.3: http://commons.apache.org/proper/commons-exec, Apache 2.0 commons-lang 2.6: https://github.com/apache/commons-lang, Apache 2.0 - commons-lang3 3.4: https://github.com/apache/commons-lang, Apache 2.0 + commons-lang3 3.12.0: https://github.com/apache/commons-lang, Apache 2.0 commons-logging 1.2: https://github.com/apache/commons-logging, Apache 2.0 commons-pool2 2.8.1: https://github.com/apache/commons-pool, Apache 2.0 curator-client 5.5.0: https://github.com/apache/curator, Apache 2.0 @@ -230,7 +230,7 @@ The text of each license is the standard Apache 2.0 license. failureaccess 1.0.1:https://github.com/google/guava, Apache 2.0 fenzo-core 1.0.1: https://github.com/Netflix/Fenzo, Apache 2.0 gson 2.10.1: https://github.com/google/gson, Apache 2.0 - guava 30.0-jre: https://github.com/google/guava, Apache 2.0 + guava 32.1.2-jre: https://github.com/google/guava, Apache 2.0 HikariCP-java7 2.4.13: https://github.com/brettwooldridge/HikariCP, Apache 2.0 httpclient 4.5.14: https://github.com/apache/httpcomponents-client, Apache 2.0 httpcore 4.4.16: https://github.com/apache/httpcomponents-core, Apache 2.0 @@ -241,17 +241,17 @@ The text of each license is the standard Apache 2.0 license. log4j 1.2.17: http://logging.apache.org/log4j/1.2/, Apache 2.0 log4j-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0 mesos 1.11.0: http://mesos.apache.org/, Apache 2.0 - netty-buffer 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-codec 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-codec-http 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-common 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-handler 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-resolver 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-transport 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-transport-native-epoll 4.1.97.Final: https://github.com/netty, Apache 2.0 - netty-transport-native-unix-common 4.1.97.Final: https://github.com/netty, Apache 2.0 + netty-buffer 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-codec 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-codec-http 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-common 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-handler 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-resolver 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-transport 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-transport-native-epoll 4.1.99.Final: https://github.com/netty, Apache 2.0 + netty-transport-native-unix-common 4.1.99.Final: https://github.com/netty, Apache 2.0 quartz 2.3.2: https://github.com/quartz-scheduler/quartz, Apache 2.0 - snakeyaml 2.0: https://bitbucket.org/snakeyaml/snakeyaml/src, Apache 2.0 + snakeyaml 2.2: https://bitbucket.org/snakeyaml/snakeyaml/src, Apache 2.0 zookeeper 3.9.0: https://github.com/apache/zookeeper, Apache 2.0 zookeeper-jute 3.9.0: https://github.com/apache/zookeeper, Apache 2.0 diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java index 8bfc91791f..f5760d8c22 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java @@ -23,9 +23,6 @@ import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.inspector.TrustedPrefixesTagInspector; - -import java.util.Collections; /** * YAML engine. @@ -53,7 +50,7 @@ public static String marshal(final Object value) { */ public static T unmarshal(final String yamlContent, final Class classType) { LoaderOptions loaderOptions = new LoaderOptions(); - loaderOptions.setTagInspector(new TrustedPrefixesTagInspector(Collections.singletonList("org.apache.shardingsphere.elasticjob"))); + loaderOptions.setTagInspector(tagInspector -> tagInspector.getClassName().startsWith("org.apache.shardingsphere.elasticjob")); return new Yaml(loaderOptions).loadAs(yamlContent, classType); } } diff --git a/examples/pom.xml b/examples/pom.xml index f29315490c..da24a0c1d5 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -45,7 +45,7 @@ 1.7.7 1.2.0 2.9.0 - 1.4.184 + 2.2.224 8.0.28 3.3 1.2.5 diff --git a/pom.xml b/pom.xml index 9bf61bc11d..e85f5b5ccb 100644 --- a/pom.xml +++ b/pom.xml @@ -46,8 +46,8 @@ UTF-8 zh_CN - 30.0-jre - 3.4 + 32.1.2-jre + 3.12.0 2.3.2 3.9.0 5.5.0 @@ -59,19 +59,19 @@ 1.3 4.5.14 4.4.16 - 2.0 + 2.2 2.10.1 - 4.1.97.Final + 4.1.99.Final 1.11.0 1.0.1 2.10.0 2.11.1 - 3.4.2 + 4.0.3 1.6.0 8.0.16 - 1.4.184 + 2.2.224 5.10.0 2.2 1.14.8 @@ -79,28 +79,28 @@ 4.2.0 0.15 - 3.8.0 - 2.7 + 3.11.0 + 3.3.1 3.3.0 3.1.2 2.18.1 - 3.4 + 4.0.0-M6 1.0.0 3.4 - 3.1.0 - 2.8 - 3.3.0 + 3.2.1 + 3.4.2 + 3.5.0 3.2.1 - 2.5 + 3.3.0 4.3.0 2.7 0.8.10 3.0.2 3.1.0 - 3.5 + 3.20.0 2.0 2.4 - 3.1.0 + 3.5.0 1.10 @@ -253,7 +253,7 @@ com.zaxxer HikariCP - ${hikaricp.version} + ${hikari-cp.version} com.sun.mail From 9646f112f9f6c5f1c5ea06644fd5bd7f834d4da5 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Fri, 13 Oct 2023 18:48:30 +0800 Subject: [PATCH 035/178] Update description (#2274) --- .asf.yaml | 2 +- README.md | 2 +- pom.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index d7f3bd088e..55bc3fbd97 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -21,7 +21,7 @@ notifications: pullrequests: notifications@shardingsphere.apache.org github: - description: Distributed scheduled job framework + description: Distributed scheduled job labels: - elasticjob - database diff --git a/README.md b/README.md index 8d561bc341..adbdfc16bf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [ElasticJob - distributed scheduled job solution](http://shardingsphere.apache.org/elasticjob/) +# [ElasticJob - Distributed scheduled job](http://shardingsphere.apache.org/elasticjob/) **Official website: https://shardingsphere.apache.org/elasticjob/** diff --git a/pom.xml b/pom.xml index e85f5b5ccb..9fc93b731f 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,8 @@ elasticjob 3.1.0-SNAPSHOT pom - ${project.artifactId} + Elastic Job + Distributed scheduled job elasticjob-api @@ -792,7 +793,6 @@ http://shardingsphere.apache.org/elasticjob/ - Distributed scheduled job solution From 7bfe962532856a7eadae243cd1119e4adf7d9fd8 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Fri, 13 Oct 2023 19:11:33 +0800 Subject: [PATCH 036/178] Update pom (#2275) * Update description * Update pom --- pom.xml | 67 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/pom.xml b/pom.xml index 9fc93b731f..34722d54fd 100644 --- a/pom.xml +++ b/pom.xml @@ -42,66 +42,83 @@ + 1.8 [3.5.0,) UTF-8 - zh_CN + 32.1.2-jre 3.12.0 + 1.16.0 + 1.3 + + 2.2 + 2.10.1 + 2.3.2 3.9.0 5.5.0 - 1.18.30 + 1.9.1 - 1.7.36 - 1.2.12 - 1.16.0 - 1.3 4.5.14 4.4.16 - 2.2 - 2.10.1 4.1.99.Final - 1.11.0 - 1.0.1 - + + 1.7.36 + 1.2.12 + 2.10.0 2.11.1 4.0.3 1.6.0 + 1.11.0 + 1.0.1 + + 1.18.30 + 8.0.16 2.2.224 + 5.10.0 2.2 1.14.8 4.11.0 4.2.0 - 0.15 + + 3.2.1 3.11.0 3.3.1 - 3.3.0 3.1.2 - 2.18.1 - 4.0.0-M6 - 1.0.0 - 3.4 - 3.2.1 - 3.4.2 - 3.5.0 + 3.3.0 + + 3.2.1 - 3.3.0 + 3.1.1 + 3.0.0 + 3.5.0 + + + 0.15 + 3.1.0 + 3.0.2 + 3.20.0 4.3.0 2.7 0.8.10 - 3.0.2 - 3.1.0 - 3.20.0 + + + 4.0.0-M6 + 3.4.2 + 3.5.0 + 3.3.0 2.0 2.4 - 3.5.0 + 2.18.1 + 1.0.0 + 3.4 1.10 From 2c8d684e16207c7a3987cab109683b29ec5fd666 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Fri, 13 Oct 2023 19:45:58 +0800 Subject: [PATCH 037/178] Add spotless (#2276) * Add spotless * Add spotless * Add spotless --- .../annotation/ElasticJobConfiguration.java | 5 +- .../elasticjob/api/ElasticJob.java | 2 +- .../elasticjob/api/JobConfiguration.java | 14 +- .../elasticjob/api/JobExtraConfiguration.java | 2 +- .../api/JobExtraConfigurationFactory.java | 2 +- .../elasticjob/api/ShardingContext.java | 2 +- .../ElasticJobConfigurationTest.java | 6 +- .../elasticjob/annotation/job/CustomJob.java | 2 +- .../annotation/job/impl/SimpleTestJob.java | 21 ++- .../elasticjob/api/JobConfigurationTest.java | 10 +- .../cloud/config/CloudJobConfiguration.java | 2 +- .../cloud/config/CloudJobExecutionType.java | 2 +- .../pojo/CloudJobConfigurationPOJO.java | 2 +- .../cloud/statistics/StatisticInterval.java | 2 +- .../rdb/StatisticRdbRepository.java | 89 +++++----- .../pojo/CloudJobConfigurationPOJOTest.java | 2 +- .../elasticjob/cloud/api/JobBootstrap.java | 2 +- .../executor/prod/DaemonTaskScheduler.java | 6 +- .../cloud/executor/prod/TaskExecutor.java | 6 +- .../cloud/facade/CloudJobFacade.java | 4 +- .../executor/facade/CloudJobFacadeTest.java | 2 +- .../executor/fixture/TestDataflowJob.java | 2 +- .../cloud/executor/fixture/TestSimpleJob.java | 2 +- .../executor/local/LocalTaskExecutorTest.java | 3 +- .../prod/DaemonTaskSchedulerTest.java | 2 +- .../cloud/executor/prod/TaskExecutorTest.java | 2 +- .../executor/prod/TaskExecutorThreadTest.java | 2 +- .../elasticjob-cloud-scheduler/pom.xml | 4 +- .../controller/search/JobEventRdbSearch.java | 25 ++- .../app/pojo/CloudAppConfigurationPOJO.java | 2 +- .../job/CloudJobConfigurationListener.java | 2 +- .../scheduler/env/AuthConfiguration.java | 6 +- .../scheduler/env/BootstrapEnvironment.java | 14 +- .../exception/AppConfigurationException.java | 2 +- .../ha/SchedulerElectionCandidate.java | 2 +- .../cloud/scheduler/mesos/LaunchingTasks.java | 4 +- .../scheduler/mesos/ReconcileService.java | 7 +- .../scheduler/mesos/SchedulerEngine.java | 4 +- .../mesos/TaskLaunchScheduledService.java | 10 +- .../scheduler/producer/ProducerManager.java | 2 +- .../state/running/RunningService.java | 9 +- .../statistics/StatisticsScheduler.java | 2 +- .../statistics/TaskResultMetaData.java | 2 +- .../job/JobRunningStatisticJob.java | 5 +- .../job/RegisteredJobStatisticJob.java | 3 +- .../job/TaskResultStatisticJob.java | 5 +- .../elasticjob/cloud/ReflectionUtils.java | 2 +- .../search/JobEventRdbSearchTest.java | 2 +- .../pojo/CloudAppConfigurationPOJOTest.java | 2 +- .../job/CloudJobConfigurationServiceTest.java | 2 +- .../env/BootstrapEnvironmentTest.java | 6 +- .../fixture/CloudAppConfigurationBuilder.java | 2 +- .../fixture/CloudAppJsonConstants.java | 2 +- .../fixture/CloudJobConfigurationBuilder.java | 4 +- .../scheduler/fixture/EmbedTestingServer.java | 17 +- .../cloud/scheduler/fixture/TaskNode.java | 6 +- .../scheduler/mesos/JobTaskRequestTest.java | 6 +- .../scheduler/mesos/SchedulerServiceTest.java | 1 - .../mesos/TaskLaunchScheduledServiceTest.java | 2 +- .../scheduler/mesos/fixture/OfferBuilder.java | 2 +- .../producer/ProducerManagerTest.java | 6 +- .../TransientProducerSchedulerTest.java | 7 +- .../disable/app/DisableAppServiceTest.java | 2 +- .../state/ready/ReadyServiceTest.java | 2 +- .../statistics/StatisticManagerTest.java | 8 +- .../statistics/TaskResultMetaDataTest.java | 2 +- .../statistics/job/BaseStatisticJobTest.java | 2 +- .../statistics/job/TestStatisticJob.java | 3 +- .../pom.xml | 2 +- .../pom.xml | 22 ++- .../elasticjob-lite-distribution/pom.xml | 2 +- .../elasticjob-src-distribution/pom.xml | 2 +- elasticjob-distribution/pom.xml | 8 +- .../error/handler/JobErrorHandler.java | 2 +- .../elasticjob-error-handler-email/pom.xml | 2 +- .../handler/email/EmailJobErrorHandler.java | 4 +- .../elasticjob-error-handler-general/pom.xml | 4 +- .../error/handler/JobErrorHandlerFactory.java | 2 +- .../general/IgnoreJobErrorHandler.java | 2 +- .../handler/general/LogJobErrorHandler.java | 2 +- .../handler/general/ThrowJobErrorHandler.java | 2 +- .../handler/JobErrorHandlerFactoryTest.java | 5 +- .../general/IgnoreJobErrorHandlerTest.java | 6 +- .../general/LogJobErrorHandlerTest.java | 2 +- .../general/ThrowJobErrorHandlerTest.java | 9 +- .../executor/ElasticJobExecutor.java | 10 +- .../elasticjob/executor/JobFacade.java | 2 +- .../executor/item/JobItemExecutor.java | 2 +- .../executor/item/JobItemExecutorFactory.java | 2 +- .../item/impl/ClassedJobItemExecutor.java | 2 +- .../item/impl/TypedJobItemExecutor.java | 2 +- .../executor/ElasticJobExecutorTest.java | 6 +- .../executor/ClassedFooJobExecutor.java | 2 +- .../fixture/executor/TypedFooJobExecutor.java | 2 +- .../executor/fixture/job/DetailedFooJob.java | 2 +- .../executor/fixture/job/FailedJob.java | 2 +- .../executor/fixture/job/FooJob.java | 2 +- .../item/JobItemExecutorFactoryTest.java | 8 +- .../executor/DataflowJobExecutor.java | 2 +- .../elasticjob/dataflow/job/DataflowJob.java | 2 +- .../dataflow/props/DataflowJobProperties.java | 2 +- .../elasticjob-http-executor/pom.xml | 6 +- .../http/executor/HttpJobExecutorTest.java | 2 +- .../executor/fixture/InternalController.java | 4 +- .../script/executor/ScriptJobExecutor.java | 2 +- .../script/props/ScriptJobProperties.java | 2 +- .../script/ScriptJobExecutorTest.java | 6 +- .../simple/executor/SimpleJobExecutor.java | 2 +- .../elasticjob/simple/job/SimpleJob.java | 2 +- .../elasticjob/simple/job/FooSimpleJob.java | 2 +- .../elasticjob-tracing-api/pom.xml | 2 +- .../tracing/JobTracingEventBus.java | 8 +- .../tracing/api/TracingConfiguration.java | 2 +- .../elasticjob/tracing/event/JobEvent.java | 2 +- .../tracing/event/JobExecutionEvent.java | 2 +- .../tracing/event/JobStatusTraceEvent.java | 2 +- .../TracingConfigurationException.java | 2 +- .../tracing/listener/TracingListener.java | 2 +- .../TracingListenerConfiguration.java | 2 +- .../listener/TracingListenerFactory.java | 2 +- .../tracing/JobTracingEventBusTest.java | 2 +- .../tracing/event/JobExecutionEventTest.java | 2 +- .../tracing/fixture/JobEventCaller.java | 2 +- .../TestTracingFailureConfiguration.java | 2 +- .../tracing/fixture/TestTracingListener.java | 2 +- .../TestTracingListenerConfiguration.java | 2 +- .../listener/TracingListenerFactoryTest.java | 10 +- .../TracingStorageConverterFactoryTest.java | 2 +- .../elasticjob-tracing-rdb/pom.xml | 2 +- .../rdb/listener/RDBTracingListener.java | 2 +- .../RDBTracingListenerConfiguration.java | 2 +- .../rdb/storage/RDBJobEventStorage.java | 20 +-- .../rdb/storage/RDBStorageSQLMapper.java | 2 +- .../tracing/rdb/type/DatabaseType.java | 2 +- .../rdb/type/impl/DB2DatabaseType.java | 2 +- .../tracing/rdb/type/impl/H2DatabaseType.java | 2 +- .../rdb/type/impl/MySQLDatabaseType.java | 2 +- .../rdb/type/impl/OracleDatabaseType.java | 2 +- .../rdb/type/impl/PostgreSQLDatabaseType.java | 2 +- .../rdb/type/impl/SQLServerDatabaseType.java | 2 +- .../RDBTracingListenerConfigurationTest.java | 5 +- .../rdb/listener/RDBTracingListenerTest.java | 2 +- .../rdb/storage/RDBJobEventStorageTest.java | 8 +- .../elasticjob-infra-common/pom.xml | 2 +- .../infra/concurrent/BlockUtils.java | 2 +- .../concurrent/ElasticJobExecutorService.java | 4 +- .../concurrent/ExecutorServiceReloadable.java | 6 +- .../infra/context/ExecutionType.java | 2 +- .../infra/context/ShardingItemParameters.java | 2 +- .../elasticjob/infra/context/TaskContext.java | 7 +- .../elasticjob/infra/env/HostException.java | 2 +- .../elasticjob/infra/env/IpUtils.java | 2 +- .../elasticjob/infra/env/TimeService.java | 2 +- .../infra/exception/ExceptionUtils.java | 2 +- .../exception/JobConfigurationException.java | 2 +- .../JobExecutionEnvironmentException.java | 2 +- .../exception/JobStatisticException.java | 2 +- .../infra/exception/JobSystemException.java | 2 +- .../handler/sharding/JobShardingStrategy.java | 2 +- .../sharding/JobShardingStrategyFactory.java | 2 +- .../AverageAllocationJobShardingStrategy.java | 2 +- .../OdevitySortByNameJobShardingStrategy.java | 3 +- .../RoundRobinByNameJobShardingStrategy.java | 2 +- .../threadpool/JobExecutorServiceHandler.java | 2 +- .../JobExecutorServiceHandlerFactory.java | 2 +- .../AbstractJobExecutorServiceHandler.java | 2 +- .../CPUUsageJobExecutorServiceHandler.java | 2 +- ...SingleThreadJobExecutorServiceHandler.java | 2 +- .../elasticjob/infra/json/GsonFactory.java | 2 +- .../infra/listener/ElasticJobListener.java | 6 +- .../listener/ElasticJobListenerFactory.java | 2 +- .../infra/listener/ShardingContexts.java | 2 +- .../elasticjob/infra/spi/TypedSPI.java | 2 +- .../ElasticJobYamlRepresenter.java | 1 + .../ElasticJobExecutorServiceTest.java | 6 +- .../context/ShardingItemParametersTest.java | 2 +- .../infra/context/TaskContextTest.java | 2 +- .../infra/context/fixture/TaskNode.java | 4 +- .../infra/env/HostExceptionTest.java | 2 +- .../elasticjob/infra/env/IpUtilsTest.java | 2 +- .../elasticjob/infra/env/TimeServiceTest.java | 2 +- .../infra/exception/ExceptionUtilsTest.java | 2 +- .../JobConfigurationExceptionTest.java | 2 +- .../JobExecutionEnvironmentExceptionTest.java | 2 +- .../exception/JobStatisticExceptionTest.java | 2 +- .../exception/JobSystemExceptionTest.java | 2 +- .../handler/sharding/JobInstanceTest.java | 2 +- .../JobShardingStrategyFactoryTest.java | 5 +- ...rageAllocationJobShardingStrategyTest.java | 2 +- ...vitySortByNameJobShardingStrategyTest.java | 2 +- ...teServerByNameJobShardingStrategyTest.java | 2 +- .../JobExecutorServiceHandlerFactoryTest.java | 5 +- .../infra/json/GsonFactoryTest.java | 1 - .../ElasticJobListenerFactoryTest.java | 3 +- .../infra/listener/ShardingContextsTest.java | 2 +- .../fixture/FooElasticJobListener.java | 2 +- .../infra/pojo/JobConfigurationPOJOTest.java | 2 +- .../spi/ElasticJobServiceLoaderTest.java | 16 +- .../infra/spi/fixture/TypedFooService.java | 4 +- .../fixture/UnRegisteredTypedFooService.java | 4 +- .../spi/fixture/impl/TypedFooServiceImpl.java | 4 +- .../impl/UnRegisteredTypedFooServiceImpl.java | 6 +- ...YamlConfigurationConverterFactoryTest.java | 2 +- .../elasticjob-registry-center-api/pom.xml | 6 +- .../reg/base/CoordinatorRegistryCenter.java | 8 +- .../reg/base/ElectionCandidate.java | 2 +- .../elasticjob/reg/base/RegistryCenter.java | 2 +- .../reg/exception/RegException.java | 2 +- .../reg/exception/RegExceptionHandler.java | 2 +- .../ConnectionStateChangedEventListener.java | 4 +- .../listener/DataChangedEventListener.java | 2 +- .../exception/RegExceptionHandlerTest.java | 2 +- .../pom.xml | 14 +- .../zookeeper/ZookeeperRegistryCenter.java | 82 +++++----- ...keeperCuratorIgnoredExceptionProvider.java | 2 +- .../zookeeper/ZookeeperConfigurationTest.java | 2 +- .../ZookeeperElectionServiceTest.java | 6 +- .../ZookeeperRegistryCenterForAuthTest.java | 8 +- ...ookeeperRegistryCenterInitFailureTest.java | 4 +- .../ZookeeperRegistryCenterListenerTest.java | 40 ++--- ...keeperRegistryCenterMiscellaneousTest.java | 4 +- .../ZookeeperRegistryCenterModifyTest.java | 2 +- ...eeperRegistryCenterQueryWithCacheTest.java | 4 +- ...erRegistryCenterQueryWithoutCacheTest.java | 4 +- ...ookeeperRegistryCenterTransactionTest.java | 12 +- .../ZookeeperRegistryCenterWatchTest.java | 12 +- .../zookeeper/fixture/EmbedTestingServer.java | 19 ++- .../util/ZookeeperRegistryCenterTestUtil.java | 6 +- .../pom.xml | 8 +- .../elasticjob-registry-center/pom.xml | 6 +- elasticjob-infra/elasticjob-restful/pom.xml | 8 +- .../RequestBodyDeserializerFactory.java | 1 + .../ContextInitializationInboundHandler.java | 4 +- .../ResponseBodySerializerFactory.java | 1 + .../RequestBodyDeserializerFactoryTest.java | 3 +- .../pipeline/HandlerParameterDecoderTest.java | 19 ++- .../restful/pipeline/HttpClient.java | 4 +- .../ResponseBodySerializerFactoryTest.java | 3 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 1 + .../lite/api/bootstrap/JobBootstrap.java | 2 +- .../bootstrap/impl/OneOffJobBootstrap.java | 4 +- .../bootstrap/impl/ScheduleJobBootstrap.java | 2 +- .../api/registry/JobInstanceRegistry.java | 4 +- .../annotation/JobAnnotationBuilder.java | 2 +- .../lite/internal/failover/FailoverNode.java | 6 +- .../internal/failover/FailoverService.java | 6 +- .../internal/guarantee/GuaranteeNode.java | 8 +- .../internal/guarantee/GuaranteeService.java | 40 ++--- .../internal/instance/InstanceService.java | 2 +- .../internal/listener/ListenerManager.java | 2 +- .../listener/ListenerNotifierManager.java | 17 +- .../schedule/JobScheduleController.java | 5 +- .../lite/internal/schedule/JobScheduler.java | 6 +- .../schedule/JobShutdownHookPlugin.java | 3 +- .../lite/internal/server/ServerService.java | 39 +++-- .../lite/internal/setup/SetUpFacade.java | 6 +- .../sharding/ExecutionContextService.java | 6 +- .../internal/sharding/ExecutionService.java | 2 +- .../lite/internal/sharding/ShardingNode.java | 2 +- .../internal/sharding/ShardingService.java | 4 +- .../internal/snapshot/SnapshotService.java | 11 +- .../lite/internal/storage/JobNodeStorage.java | 6 +- .../internal/util/SensitiveInfoUtils.java | 2 +- .../impl/OneOffJobBootstrapTest.java | 34 ++-- .../DistributeOnceElasticJobListenerTest.java | 2 +- .../fixture/TestElasticJobListener.java | 12 +- .../lite/fixture/EmbedTestingServer.java | 16 +- .../executor/ClassedFooJobExecutor.java | 2 +- .../lite/fixture/job/AnnotationSimpleJob.java | 19 ++- .../fixture/job/AnnotationUnShardingJob.java | 7 +- .../lite/fixture/job/DetailedFooJob.java | 2 +- .../elasticjob/lite/fixture/job/FooJob.java | 2 +- .../lite/integrate/BaseIntegrateTest.java | 2 +- .../disable/DisabledJobIntegrateTest.java | 6 +- .../OneOffDisabledJobIntegrateTest.java | 2 +- .../ScheduleDisabledJobIntegrateTest.java | 6 +- .../enable/EnabledJobIntegrateTest.java | 2 +- .../enable/OneOffEnabledJobIntegrateTest.java | 6 +- .../ScheduleEnabledJobIntegrateTest.java | 8 +- .../annotation/JobAnnotationBuilderTest.java | 4 +- .../integrate/BaseAnnotationTest.java | 2 +- .../integrate/OneOffEnabledJobTest.java | 6 +- .../integrate/ScheduleEnabledJobTest.java | 6 +- .../failover/FailoverListenerManagerTest.java | 4 +- .../internal/failover/FailoverNodeTest.java | 2 +- .../failover/FailoverServiceTest.java | 4 +- .../guarantee/GuaranteeServiceTest.java | 12 +- .../internal/instance/InstanceNodeTest.java | 2 +- .../instance/ShutdownListenerManagerTest.java | 2 +- .../listener/ListenerNotifierManagerTest.java | 4 +- .../internal/schedule/LiteJobFacadeTest.java | 2 +- .../DefaultJobClassNameProviderTest.java | 5 +- .../lite/internal/setup/SetUpFacadeTest.java | 6 +- .../sharding/ShardingServiceTest.java | 2 +- .../snapshot/BaseSnapshotServiceTest.java | 2 +- .../snapshot/SnapshotServiceEnableTest.java | 4 +- .../lite/internal/snapshot/SocketUtils.java | 3 +- .../lite/lifecycle/api/JobOperateAPI.java | 2 +- .../lite/lifecycle/domain/JobBriefInfo.java | 4 +- .../lite/lifecycle/domain/ShardingInfo.java | 8 +- .../internal/operate/JobOperateAPIImpl.java | 2 +- .../AbstractEmbedZookeeperBaseTest.java | 20 +-- .../operate/JobOperateAPIImplTest.java | 8 +- .../statistics/JobStatisticsAPIImplTest.java | 2 +- .../ShardingStatisticsAPIImplTest.java | 2 +- .../job/ElasticJobBootstrapConfiguration.java | 8 +- .../job/ElasticJobLiteAutoConfiguration.java | 2 +- .../spring/boot/job/ElasticJobProperties.java | 2 +- .../ScheduleJobBootstrapStartupRunner.java | 2 +- .../ElasticJobTracingConfiguration.java | 5 +- .../boot/tracing/TracingProperties.java | 8 +- ...ElasticJobConfigurationPropertiesTest.java | 2 +- .../job/ElasticJobSpringBootScannerTest.java | 10 +- .../boot/job/ElasticJobSpringBootTest.java | 21 ++- .../executor/CustomClassedJobExecutor.java | 2 +- .../boot/job/executor/PrintJobExecutor.java | 2 +- .../boot/job/executor/PrintJobProperties.java | 2 +- .../boot/job/fixture/EmbedTestingServer.java | 20 +-- .../boot/job/fixture/job/CustomJob.java | 2 +- .../fixture/job/impl/AnnotationCustomJob.java | 11 +- .../job/fixture/job/impl/CustomTestJob.java | 6 +- .../boot/job/repository/BarRepository.java | 2 +- .../repository/impl/BarRepositoryImpl.java | 2 +- .../boot/reg/ZookeeperPropertiesTest.java | 2 +- ...icJobSnapshotServiceConfigurationTest.java | 6 +- .../tracing/TracingConfigurationTest.java | 6 +- .../elasticjob-lite-spring-core/pom.xml | 2 +- .../core/scanner/ClassPathJobScanner.java | 8 +- .../spring/core/scanner/ElasticJobScan.java | 2 +- .../core/scanner/ElasticJobScanRegistrar.java | 10 +- .../core/scanner/JobScannerConfiguration.java | 10 +- .../SpringProxyJobClassNameProvider.java | 4 +- .../lite/spring/core/util/AopTargetUtils.java | 10 +- .../lite/spring/core/util/TargetJob.java | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 5 +- .../namespace/ElasticJobNamespaceHandler.java | 2 +- .../job/tag/JobBeanDefinitionTag.java | 2 +- .../reg/tag/ZookeeperBeanDefinitionTag.java | 2 +- .../JobScannerBeanDefinitionParser.java | 2 +- .../tag/JobScannerBeanDefinitionTag.java | 1 + .../tag/SnapshotBeanDefinitionTag.java | 2 +- .../parser/TracingBeanDefinitionParser.java | 2 +- .../tracing/tag/TracingBeanDefinitionTag.java | 2 +- .../fixture/aspect/SimpleAspect.java | 4 +- .../fixture/job/DataflowElasticJob.java | 2 +- .../fixture/job/FooSimpleElasticJob.java | 2 +- .../job/annotation/AnnotationSimpleJob.java | 25 ++- .../job/ref/RefFooDataflowElasticJob.java | 2 +- .../job/ref/RefFooSimpleElasticJob.java | 4 +- .../fixture/listener/SimpleCglibListener.java | 2 +- .../SimpleJdkDynamicProxyListener.java | 2 +- .../fixture/listener/SimpleListener.java | 2 +- .../fixture/listener/SimpleOnceListener.java | 2 +- .../namespace/fixture/service/FooService.java | 2 +- .../fixture/service/FooServiceImpl.java | 4 +- .../job/AbstractJobSpringIntegrateTest.java | 8 +- .../AbstractOneOffJobSpringIntegrateTest.java | 10 +- .../job/JobSpringNamespaceWithRefTest.java | 6 +- .../job/JobSpringNamespaceWithTypeTest.java | 10 +- ...bSpringNamespaceWithEventTraceRdbTest.java | 2 +- ...fJobSpringNamespaceWithJobHandlerTest.java | 2 +- ...ringNamespaceWithListenerAndCglibTest.java | 2 +- ...aceWithListenerAndJdkDynamicProxyTest.java | 2 +- ...OffJobSpringNamespaceWithListenerTest.java | 2 +- .../OneOffJobSpringNamespaceWithRefTest.java | 12 +- .../OneOffJobSpringNamespaceWithTypeTest.java | 8 +- ...JobSpringNamespaceWithoutListenerTest.java | 2 +- .../AbstractJobSpringIntegrateTest.java | 8 +- .../namespace/snapshot/SocketUtils.java | 3 +- ...okeeperJUnitJupiterSpringContextTests.java | 2 +- .../EmbedZookeeperTestExecutionListener.java | 20 +-- .../elasticjob-lite-spring/pom.xml | 4 +- pom.xml | 153 +++++++++++------- src/{main => }/resources/checkstyle.xml | 0 src/{main => }/resources/checkstyle_ci.xml | 0 src/resources/spotless/copyright.txt | 17 ++ src/resources/spotless/java.xml | 50 ++++++ 377 files changed, 1089 insertions(+), 1052 deletions(-) rename src/{main => }/resources/checkstyle.xml (100%) rename src/{main => }/resources/checkstyle_ci.xml (100%) create mode 100644 src/resources/spotless/copyright.txt create mode 100644 src/resources/spotless/java.xml diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java index 7b7e841f8a..8e4115a8d7 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java @@ -49,14 +49,13 @@ * @return timeZone */ String timeZone() default ""; - - + /** * registry center name. * @return registryCenter */ String registryCenter() default ""; - + /** * Sharding total count. * @return shardingTotalCount diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java index 882d1a5cfb..cd6842b040 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java index 0fe7ab486b..17e384bcd4 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java @@ -7,7 +7,7 @@ * 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. @@ -122,9 +122,9 @@ public static class Builder { private String jobExecutorServiceHandlerType; private String jobErrorHandlerType; - + private final Collection jobListenerTypes = new ArrayList<>(); - + private final Collection extraConfigurations = new LinkedList<>(); private String description = ""; @@ -134,11 +134,11 @@ public static class Builder { private boolean disabled; private boolean overwrite; - + private String label; private boolean staticSharding; - + /** * Cron expression. * @@ -151,7 +151,7 @@ public Builder cron(final String cron) { } return this; } - + /** * time zone. * @@ -171,7 +171,6 @@ public Builder timeZone(final String timeZone) { *

* sharding item and sharding parameter split by =, multiple sharding items and sharding parameters split by comma, just like map. * Sharding item start from zero, cannot equal to great than sharding total count. - * * For example: * 0=a,1=b,2=c *

@@ -206,7 +205,6 @@ public Builder jobParameter(final String jobParameter) { *

* For short interval job, it is better to disable monitor execution to improve performance. * It can't guarantee repeated data fetch and can't failover if disable monitor execution, please keep idempotence in job. - * * For long interval job, it is better to enable monitor execution to guarantee fetch data exactly once. *

* diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java index 4307260e14..068e38e9e4 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java index 8670ed93a2..b6cbfa15f7 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java index 65b2d7461a..dfbe098ec4 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java index e7dd40b40e..8c4692ee22 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java @@ -38,13 +38,13 @@ public void assertAnnotationJob() { assertThat(annotation.cron(), is("0/5 * * * * ?")); assertThat(annotation.shardingTotalCount(), is(3)); assertThat(annotation.shardingItemParameters(), is("0=Beijing,1=Shanghai,2=Guangzhou")); - for (Class factory :annotation.extraConfigurations()) { + for (Class factory : annotation.extraConfigurations()) { assertThat(factory, is(SimpleTracingConfigurationFactory.class)); } - assertArrayEquals(annotation.jobListenerTypes(), new String[] {"NOOP", "LOG"}); + assertArrayEquals(annotation.jobListenerTypes(), new String[]{"NOOP", "LOG"}); Queue propsKey = new LinkedList<>(Arrays.asList("print.title", "print.content")); Queue propsValue = new LinkedList<>(Arrays.asList("test title", "test content")); - for (ElasticJobProp prop :annotation.props()) { + for (ElasticJobProp prop : annotation.props()) { assertThat(prop.key(), is(propsKey.poll())); assertThat(prop.value(), is(propsValue.poll())); } diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java index fbad39c622..e47b9e54cc 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java index 1c85c78328..3a9c01dcaa 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java @@ -24,17 +24,16 @@ import org.apache.shardingsphere.elasticjob.api.ShardingContext; @ElasticJobConfiguration( - cron = "0/5 * * * * ?", - jobName = "SimpleTestJob", - shardingTotalCount = 3, - shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou", - jobListenerTypes = {"NOOP", "LOG"}, - extraConfigurations = {SimpleTracingConfigurationFactory.class}, - props = { - @ElasticJobProp(key = "print.title", value = "test title"), - @ElasticJobProp(key = "print.content", value = "test content") - } -) + cron = "0/5 * * * * ?", + jobName = "SimpleTestJob", + shardingTotalCount = 3, + shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou", + jobListenerTypes = {"NOOP", "LOG"}, + extraConfigurations = {SimpleTracingConfigurationFactory.class}, + props = { + @ElasticJobProp(key = "print.title", value = "test title"), + @ElasticJobProp(key = "print.content", value = "test content") + }) public final class SimpleTestJob implements CustomJob { @Override diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java index b275af4120..1e7412c21c 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java @@ -7,7 +7,7 @@ * 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. @@ -84,13 +84,11 @@ public void assertBuildRequiredProperties() { @Test public void assertBuildWithEmptyJobName() { - assertThrows(IllegalArgumentException.class, () -> - JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build()); + assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build()); } - + @Test public void assertBuildWithInvalidShardingTotalCount() { - assertThrows(IllegalArgumentException.class, () -> - JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build()); + assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java index 3aed437bd5..b61dc99233 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java index 58c0b155bb..f7ea0e1f2b 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java index cac9d66f17..3465db59c9 100644 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java index fc9f7e36c8..dd285852ca 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java @@ -29,7 +29,7 @@ public enum StatisticInterval { MINUTE("0 * * * * ?"), - HOUR("0 0 * * * ?"), + HOUR("0 0 * * * ?"), DAY("0 0 0 * * ?"); diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java index 5b696181f9..7490279523 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java @@ -46,13 +46,13 @@ public class StatisticRdbRepository { private static final String TABLE_TASK_RESULT_STATISTICS = "TASK_RESULT_STATISTICS"; private static final String TABLE_TASK_RUNNING_STATISTICS = "TASK_RUNNING_STATISTICS"; - + private static final String TABLE_JOB_RUNNING_STATISTICS = "JOB_RUNNING_STATISTICS"; private static final String TABLE_JOB_REGISTER_STATISTICS = "JOB_REGISTER_STATISTICS"; private final DataSource dataSource; - + public StatisticRdbRepository(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; initTables(); @@ -153,7 +153,7 @@ private void createJobRegisterTable(final Connection conn) throws SQLException { preparedStatement.execute(); } } - + /** * Add task result statistics. * @@ -179,7 +179,7 @@ public boolean add(final TaskResultStatistics taskResultStatistics) { } return result; } - + /** * Add task running statistics. * @@ -203,7 +203,7 @@ public boolean add(final TaskRunningStatistics taskRunningStatistics) { } return result; } - + /** * Add job running statistics. * @@ -227,7 +227,7 @@ public boolean add(final JobRunningStatistics jobRunningStatistics) { } return result; } - + /** * Add job register statistics. * @@ -251,7 +251,7 @@ public boolean add(final JobRegisterStatistics jobRegisterStatistics) { } return result; } - + /** * Find task result statistics. * @@ -262,15 +262,14 @@ public boolean add(final JobRegisterStatistics jobRegisterStatistics) { public List findTaskResultStatistics(final Date from, final StatisticInterval statisticInterval) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - TaskResultStatistics taskResultStatistics = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), + TaskResultStatistics taskResultStatistics = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), statisticInterval, new Date(resultSet.getTimestamp(4).getTime()), new Date(resultSet.getTimestamp(5).getTime())); result.add(taskResultStatistics); } @@ -280,7 +279,7 @@ public List findTaskResultStatistics(final Date from, fina } return result; } - + /** * Get summed task result statistics. * @@ -291,13 +290,12 @@ public List findTaskResultStatistics(final Date from, fina public TaskResultStatistics getSummedTaskResultStatistics(final Date from, final StatisticInterval statisticInterval) { TaskResultStatistics result = new TaskResultStatistics(0, 0, statisticInterval, new Date()); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT sum(success_count), sum(failed_count) FROM %s WHERE statistics_time >= '%s'", + String sql = String.format("SELECT sum(success_count), sum(failed_count) FROM %s WHERE statistics_time >= '%s'", TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { result = new TaskResultStatistics(resultSet.getInt(1), resultSet.getInt(2), statisticInterval, new Date()); } @@ -307,7 +305,7 @@ public TaskResultStatistics getSummedTaskResultStatistics(final Date from, final } return result; } - + /** * Find latest task result statistics. * @@ -316,15 +314,14 @@ public TaskResultStatistics getSummedTaskResultStatistics(final Date from, final */ public Optional findLatestTaskResultStatistics(final StatisticInterval statisticInterval) { TaskResultStatistics result = null; - String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", + String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), + result = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), statisticInterval, new Date(resultSet.getTimestamp(4).getTime()), new Date(resultSet.getTimestamp(5).getTime())); } } catch (final SQLException ex) { @@ -333,7 +330,7 @@ public Optional findLatestTaskResultStatistics(final Stati } return Optional.ofNullable(result); } - + /** * Find task running statistics. * @@ -343,15 +340,14 @@ public Optional findLatestTaskResultStatistics(final Stati public List findTaskRunningStatistics(final Date from) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_TASK_RUNNING_STATISTICS, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - TaskRunningStatistics taskRunningStatistics = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + TaskRunningStatistics taskRunningStatistics = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); result.add(taskRunningStatistics); } @@ -361,7 +357,7 @@ public List findTaskRunningStatistics(final Date from) { } return result; } - + /** * Find job running statistics. * @@ -371,15 +367,14 @@ public List findTaskRunningStatistics(final Date from) { public List findJobRunningStatistics(final Date from) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_JOB_RUNNING_STATISTICS, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - JobRunningStatistics jobRunningStatistics = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + JobRunningStatistics jobRunningStatistics = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); result.add(jobRunningStatistics); } @@ -389,7 +384,7 @@ public List findJobRunningStatistics(final Date from) { } return result; } - + /** * Find latest task running statistics. * @@ -397,15 +392,14 @@ public List findJobRunningStatistics(final Date from) { */ public Optional findLatestTaskRunningStatistics() { TaskRunningStatistics result = null; - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", + String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", TABLE_TASK_RUNNING_STATISTICS); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + result = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); } } catch (final SQLException ex) { @@ -414,7 +408,7 @@ public Optional findLatestTaskRunningStatistics() { } return Optional.ofNullable(result); } - + /** * Find latest job running statistics. * @@ -426,10 +420,9 @@ public Optional findLatestJobRunningStatistics() { try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), + result = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); } } catch (final SQLException ex) { @@ -438,7 +431,7 @@ public Optional findLatestJobRunningStatistics() { } return Optional.ofNullable(result); } - + /** * Find job register statistics. * @@ -448,15 +441,14 @@ public Optional findLatestJobRunningStatistics() { public List findJobRegisterStatistics(final Date from) { List result = new LinkedList<>(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", + String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", TABLE_JOB_REGISTER_STATISTICS, formatter.format(from)); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - JobRegisterStatistics jobRegisterStatistics = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), + JobRegisterStatistics jobRegisterStatistics = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); result.add(jobRegisterStatistics); } @@ -466,7 +458,7 @@ public List findJobRegisterStatistics(final Date from) { } return result; } - + /** * Find latest job register statistics. * @@ -474,15 +466,14 @@ public List findJobRegisterStatistics(final Date from) { */ public Optional findLatestJobRegisterStatistics() { JobRegisterStatistics result = null; - String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", + String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", TABLE_JOB_REGISTER_STATISTICS); try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { - result = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), + result = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); } } catch (final SQLException ex) { diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java index eabc0dfe3a..7921eff7a4 100644 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java index c399c6da22..824fe2adfa 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java @@ -51,5 +51,5 @@ public static void execute(final String elasticJobType) { private static void execute(final TaskExecutor taskExecutor) { MesosExecutorDriver driver = new MesosExecutorDriver(taskExecutor); System.exit(Protos.Status.DRIVER_STOPPED == driver.run() ? 0 : -1); - } + } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java index 1d78a523d9..12d44a2cc5 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java @@ -7,7 +7,7 @@ * 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. @@ -148,7 +148,7 @@ public static final class DaemonJob implements Job { @Setter private ElasticJob elasticJob; - + @Setter private String elasticJobType; @@ -157,7 +157,7 @@ public static final class DaemonJob implements Job { @Setter private ExecutorDriver executorDriver; - + @Setter private Protos.TaskID taskId; diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java index 5a0dc42312..7ece00d1e7 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java @@ -7,7 +7,7 @@ * 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. @@ -149,7 +149,7 @@ public void run() { throw ex; } } - + private boolean isTransient(final JobConfiguration jobConfig) { return Strings.isNullOrEmpty(jobConfig.getCron()); } @@ -160,7 +160,7 @@ private ElasticJobExecutor getJobExecutor(final JobFacade jobFacade) { } return jobExecutor; } - + private synchronized void createJobExecutor(final JobFacade jobFacade) { if (null != jobExecutor) { return; diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java index e1f324c340..022c2518b7 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java @@ -7,7 +7,7 @@ * 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. @@ -109,7 +109,7 @@ public void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { @Override public void postJobStatusTraceEvent(final String taskId, final State state, final String message) { TaskContext taskContext = TaskContext.from(taskId); - jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), taskContext.getSlaveId(), + jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), taskContext.getSlaveId(), Source.CLOUD_EXECUTOR, taskContext.getType().toString(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), state, message)); } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java index eae59825fd..2fd7214f47 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java index 7445d824ce..fe352f0c2d 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java index 7c3cec0247..3ba79a9b83 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java index c01e68fd4f..a2c6e5e7bf 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java @@ -59,7 +59,6 @@ public void assertScriptJob() { @Test public void assertNotExistsJobType() { - assertThrows(JobConfigurationException.class, () -> - new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute()); + assertThrows(JobConfigurationException.class, () -> new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java index cd0a24a7df..56658ee244 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java index a623379b8f..1450e0b78e 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java index 335ffab01b..ad0d521e96 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index c2b9c0bb28..0ca4665684 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -25,7 +25,7 @@ elasticjob-cloud-scheduler ${project.artifactId} - + 5.2.7.RELEASE @@ -49,7 +49,7 @@ org.apache.httpcomponents httpcore
- + org.apache.commons commons-lang3 diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java index 0cd65775ef..a3b42e734f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java @@ -7,7 +7,7 @@ * 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. @@ -49,14 +49,14 @@ public final class JobEventRdbSearch { private static final String TABLE_JOB_STATUS_TRACE_LOG = "JOB_STATUS_TRACE_LOG"; - private static final List FIELDS_JOB_EXECUTION_LOG = + private static final List FIELDS_JOB_EXECUTION_LOG = Arrays.asList("id", "hostname", "ip", "task_id", "job_name", "execution_source", "sharding_item", "start_time", "complete_time", "is_success", "failure_cause"); - private static final List FIELDS_JOB_STATUS_TRACE_LOG = + private static final List FIELDS_JOB_STATUS_TRACE_LOG = Arrays.asList("id", "job_name", "original_task_id", "task_id", "slave_id", "source", "execution_type", "sharding_item", "state", "message", "creation_time"); private final DataSource dataSource; - + /** * Find job execution events. * @@ -66,7 +66,7 @@ public final class JobEventRdbSearch { public Result findJobExecutionEvents(final Condition condition) { return new Result<>(getEventCount(TABLE_JOB_EXECUTION_LOG, FIELDS_JOB_EXECUTION_LOG, condition), getJobExecutionEvents(condition)); } - + /** * Find job status trace events. * @@ -82,12 +82,11 @@ private List getJobExecutionEvents(final Condition condition) try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = createDataPreparedStatement(conn, TABLE_JOB_EXECUTION_LOG, FIELDS_JOB_EXECUTION_LOG, condition); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), - resultSet.getString(5), JobExecutionEvent.ExecutionSource.valueOf(resultSet.getString(6)), Integer.parseInt(resultSet.getString(7)), - new Date(resultSet.getTimestamp(8).getTime()), resultSet.getTimestamp(9) == null ? null : new Date(resultSet.getTimestamp(9).getTime()), + resultSet.getString(5), JobExecutionEvent.ExecutionSource.valueOf(resultSet.getString(6)), Integer.parseInt(resultSet.getString(7)), + new Date(resultSet.getTimestamp(8).getTime()), resultSet.getTimestamp(9) == null ? null : new Date(resultSet.getTimestamp(9).getTime()), resultSet.getBoolean(10), resultSet.getString(11)); result.add(jobExecutionEvent); } @@ -103,8 +102,7 @@ private List getJobStatusTraceEvents(final Condition condit try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = createDataPreparedStatement(conn, TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), resultSet.getString(5), JobStatusTraceEvent.Source.valueOf(resultSet.getString(6)), resultSet.getString(7), resultSet.getString(8), @@ -123,8 +121,7 @@ private int getEventCount(final String tableName, final Collection table try ( Connection conn = dataSource.getConnection(); PreparedStatement preparedStatement = createCountPreparedStatement(conn, tableName, tableFields, condition); - ResultSet resultSet = preparedStatement.executeQuery() - ) { + ResultSet resultSet = preparedStatement.executeQuery()) { resultSet.next(); result = resultSet.getInt(1); } catch (final SQLException ex) { @@ -256,7 +253,7 @@ private String buildLimit(final int page, final int perPage) { } return sqlBuilder.toString(); } - + /** * Query condition. */ diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java index a6c6142892..7c5db87946 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java index 43d4464d6c..ec422a7f18 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java @@ -79,7 +79,7 @@ public void event(final Type type, final ChildData oldData, final ChildData data private boolean isJobConfigNode(final String path) { return path.startsWith(CloudJobConfigurationNode.ROOT) && path.length() > CloudJobConfigurationNode.ROOT.length(); } - + private CloudJobConfigurationPOJO getCloudJobConfiguration(final ChildData data) { try { return YamlEngine.unmarshal(new String(data.getData()), CloudJobConfigurationPOJO.class); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java index c11aadd539..2d5b14bd5d 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java @@ -26,9 +26,9 @@ @RequiredArgsConstructor @Getter public class AuthConfiguration { - + private final String authUsername; - + private final String authPassword; - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java index 699021f1fb..81fccc9d55 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java @@ -121,7 +121,7 @@ public RestfulServerConfiguration getRestfulServerConfiguration() { public FrameworkConfiguration getFrameworkConfiguration() { return new FrameworkConfiguration(Integer.parseInt(getValue(EnvironmentArgument.JOB_STATE_QUEUE_SIZE)), Integer.parseInt(getValue(EnvironmentArgument.RECONCILE_INTERVAL_MINUTES))); } - + /** * Get user auth config. * @@ -215,17 +215,17 @@ public enum EnvironmentArgument { JOB_STATE_QUEUE_SIZE("job_state_queue_size", "10000", true), EVENT_TRACE_RDB_DRIVER("event_trace_rdb_driver", "", false), - + EVENT_TRACE_RDB_URL("event_trace_rdb_url", "", false), - + EVENT_TRACE_RDB_USERNAME("event_trace_rdb_username", "", false), - + EVENT_TRACE_RDB_PASSWORD("event_trace_rdb_password", "", false), - + RECONCILE_INTERVAL_MINUTES("reconcile_interval_minutes", "-1", false), - + AUTH_USERNAME("auth_username", "root", true), - + AUTH_PASSWORD("auth_password", "pwd", true); private final String key; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java index bb79dbee95..eef4bf8f28 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java index 34b8967043..3055df8e0c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java @@ -40,7 +40,7 @@ public void startLeadership() { try { schedulerService = new SchedulerService(regCenter); schedulerService.start(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Throwable throwable) { throw new JobSystemException(throwable); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java index c7244b640f..9ba46afd84 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java @@ -80,8 +80,8 @@ Collection getIntegrityViolationJobs(final Collection getAssignedJobShardingTotalCountMap(final Collection vmAssignmentResults) { Map result = new HashMap<>(eligibleJobContextsMap.size(), 1); - for (VMAssignmentResult vmAssignmentResult: vmAssignmentResults) { - for (TaskAssignmentResult tasksAssigned: vmAssignmentResult.getTasksAssigned()) { + for (VMAssignmentResult vmAssignmentResult : vmAssignmentResults) { + for (TaskAssignmentResult tasksAssigned : vmAssignmentResult.getTasksAssigned()) { String jobName = TaskContext.from(tasksAssigned.getTaskId()).getMetaInfo().getJobName(); if (result.containsKey(jobName)) { result.put(jobName, result.get(jobName) + 1); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java index 4b7d7e75b8..ce755deab1 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java @@ -72,10 +72,9 @@ public void explicitReconcile() { return; } log.info("Requesting {} tasks reconciliation with the Mesos master", runningTask.size()); - schedulerDriver.reconcileTasks(runningTask.stream().map(each -> - TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(each.getId()).build()) - .setSlaveId(Protos.SlaveID.newBuilder().setValue(each.getSlaveId()).build()) - .setState(Protos.TaskState.TASK_RUNNING).build()).collect(Collectors.toList())); + schedulerDriver.reconcileTasks(runningTask.stream().map(each -> TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(each.getId()).build()) + .setSlaveId(Protos.SlaveID.newBuilder().setValue(each.getSlaveId()).build()) + .setState(Protos.TaskState.TASK_RUNNING).build()).collect(Collectors.toList())); } finally { lock.unlock(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java index 3332a5f1a5..0b2b346c2d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java @@ -65,7 +65,7 @@ public void reregistered(final SchedulerDriver schedulerDriver, final Protos.Mas @Override public void resourceOffers(final SchedulerDriver schedulerDriver, final List offers) { - for (Protos.Offer offer: offers) { + for (Protos.Offer offer : offers) { log.trace("Adding offer {} from host {}", offer.getId(), offer.getHostname()); LeasesQueue.getInstance().offer(offer); } @@ -83,7 +83,7 @@ public void statusUpdate(final SchedulerDriver schedulerDriver, final Protos.Tas TaskContext taskContext = TaskContext.from(taskId); String jobName = taskContext.getMetaInfo().getJobName(); log.trace("call statusUpdate task state is: {}, task id is: {}", taskStatus.getState(), taskId); - jobTracingEventBus.post(new JobStatusTraceEvent(jobName, taskContext.getId(), taskContext.getSlaveId(), JobStatusTraceEvent.Source.CLOUD_SCHEDULER, taskContext.getType().toString(), + jobTracingEventBus.post(new JobStatusTraceEvent(jobName, taskContext.getId(), taskContext.getSlaveId(), JobStatusTraceEvent.Source.CLOUD_SCHEDULER, taskContext.getType().toString(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), JobStatusTraceEvent.State.valueOf(taskStatus.getState().name()), taskStatus.getMessage())); switch (taskStatus.getState()) { case TASK_RUNNING: diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java index 3fada70b43..dc5014cea3 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java @@ -107,7 +107,7 @@ protected void runOneIteration() { Collection vmAssignmentResults = taskScheduler.scheduleOnce(taskRequests, LeasesQueue.getInstance().drainTo()).getResultMap().values(); List taskContextsList = new LinkedList<>(); Map, List> offerIdTaskInfoMap = new HashMap<>(); - for (VMAssignmentResult each: vmAssignmentResults) { + for (VMAssignmentResult each : vmAssignmentResults) { List leasesUsed = each.getLeasesUsed(); List taskInfoList = new ArrayList<>(each.getTasksAssigned().size() * 10); taskInfoList.addAll(getTaskInfoList(launchingTasks.getIntegrityViolationJobs(vmAssignmentResults), each, leasesUsed.get(0).hostname(), leasesUsed.get(0).getOffer())); @@ -124,9 +124,9 @@ protected void runOneIteration() { for (Entry, List> each : offerIdTaskInfoMap.entrySet()) { schedulerDriver.launchTasks(each.getKey(), each.getValue()); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (Throwable throwable) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON log.error("Launch task error", throwable); } finally { AppConstraintEvaluator.getInstance().clearAppRunningState(); @@ -135,7 +135,7 @@ protected void runOneIteration() { private List getTaskInfoList(final Collection integrityViolationJobs, final VMAssignmentResult vmAssignmentResult, final String hostname, final Protos.Offer offer) { List result = new ArrayList<>(vmAssignmentResult.getTasksAssigned().size()); - for (TaskAssignmentResult each: vmAssignmentResult.getTasksAssigned()) { + for (TaskAssignmentResult each : vmAssignmentResult.getTasksAssigned()) { TaskContext taskContext = TaskContext.from(each.getTaskId()); String jobName = taskContext.getMetaInfo().getJobName(); if (!integrityViolationJobs.contains(jobName) && !facadeService.isRunning(taskContext) && !facadeService.isJobDisabled(jobName)) { @@ -257,7 +257,7 @@ private JobStatusTraceEvent createJobStatusTraceEvent(final TaskContext taskCont private List getOfferIDs(final List leasesUsed) { List result = new ArrayList<>(); - for (VirtualMachineLease virtualMachineLease: leasesUsed) { + for (VirtualMachineLease virtualMachineLease : leasesUsed) { result.add(virtualMachineLease.getOffer().getId()); } return result; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java index bb413f1d01..2643fbb4ea 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java @@ -48,7 +48,7 @@ public final class ProducerManager { private final CloudAppConfigurationService appConfigService; private final CloudJobConfigurationService configService; - + private final ReadyService readyService; private final RunningService runningService; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java index 646f9a94cf..3a4b870b90 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java @@ -65,14 +65,13 @@ public RunningService(final CoordinatorRegistryCenter regCenter) { */ public void start() { clear(); - List jobKeys = regCenter.getChildrenKeys(RunningNode.ROOT); - for (String each : jobKeys) { + for (String each : regCenter.getChildrenKeys(RunningNode.ROOT)) { if (!configurationService.load(each).isPresent()) { remove(each); continue; } - RUNNING_TASKS.put(each, Sets.newCopyOnWriteArraySet(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath(each)).stream().map( - input -> TaskContext.from(regCenter.get(RunningNode.getRunningTaskNodePath(MetaInfo.from(input).toString())))).collect(Collectors.toList()))); + RUNNING_TASKS.put(each, Sets.newCopyOnWriteArraySet(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath(each)).stream() + .map(input -> TaskContext.from(regCenter.get(RunningNode.getRunningTaskNodePath(MetaInfo.from(input).toString())))).collect(Collectors.toList()))); } } @@ -133,7 +132,7 @@ public void remove(final String jobName) { } regCenter.remove(RunningNode.getRunningJobNodePath(jobName)); } - + /** * Remove task from running queue. * diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java index 558607477d..407594586c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java @@ -36,7 +36,7 @@ final class StatisticsScheduler { private final StdSchedulerFactory factory; private Scheduler scheduler; - + StatisticsScheduler() { factory = new StdSchedulerFactory(); try { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java index 79c8f57d25..8444ae6fd8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java @@ -27,7 +27,7 @@ public final class TaskResultMetaData { private final AtomicInteger successCount; private final AtomicInteger failedCount; - + public TaskResultMetaData() { successCount = new AtomicInteger(0); failedCount = new AtomicInteger(0); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java index 05bec99bfa..29f0b0a95d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java @@ -55,7 +55,7 @@ public final class JobRunningStatisticJob extends AbstractStatisticJob { private RunningService runningService; private StatisticRdbRepository repository; - + public JobRunningStatisticJob(final CoordinatorRegistryCenter registryCenter, final StatisticRdbRepository rdbRepository) { runningService = new RunningService(registryCenter); this.repository = rdbRepository; @@ -71,7 +71,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName()) .withSchedule(CronScheduleBuilder.cronSchedule(EXECUTE_INTERVAL.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java index c52493a7cf..814d883b36 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java @@ -64,7 +64,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName()) .withSchedule(CronScheduleBuilder.cronSchedule(execInterval.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java index 445db8b121..65422fb6c8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java @@ -66,7 +66,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName() + "_" + statisticInterval) .withSchedule(CronScheduleBuilder.cronSchedule(statisticInterval.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override @@ -85,7 +86,7 @@ public void execute(final JobExecutionContext context) { TaskResultStatistics taskResultStatistics = new TaskResultStatistics( sharedData.getSuccessCount(), sharedData.getFailedCount(), statisticInterval, StatisticTimeUtils.getCurrentStatisticTime(statisticInterval)); - log.debug("Add taskResultStatistics, statisticInterval is:{}, successCount is:{}, failedCount is:{}", + log.debug("Add taskResultStatistics, statisticInterval is:{}, successCount is:{}, failedCount is:{}", statisticInterval, sharedData.getSuccessCount(), sharedData.getFailedCount()); repository.add(taskResultStatistics); sharedData.reset(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java index c38cb4a7e3..5c35d9a2c2 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java index 2d7315acdc..c143b5165b 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java @@ -48,7 +48,7 @@ public final class JobEventRdbSearchTest { @Mock private PreparedStatement preparedStatement; - + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. @Mock(strictness = Mock.Strictness.LENIENT) private ResultSet resultSet; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java index d9e39339c9..bbb076386e 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java index fb7cb50034..eb01b20109 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java @@ -58,7 +58,7 @@ public final class CloudJobConfigurationServiceTest { + "reconcileIntervalMinutes: 10\n" + "shardingItemParameters: ''\n" + "shardingTotalCount: 10\n"; - + @Mock private CoordinatorRegistryCenter regCenter; diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java index 1fb00a26a6..e140d416cd 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java @@ -109,7 +109,7 @@ public void assertReconcileConfiguration() { assertThat(configuration.getReconcileIntervalMinutes(), is(0)); assertFalse(configuration.isEnabledReconcile()); } - + @Test public void assertGetMesosRole() { assertThat(bootstrapEnvironment.getMesosRole(), is(Optional.empty())); @@ -118,12 +118,12 @@ public void assertGetMesosRole() { ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); assertThat(bootstrapEnvironment.getMesosRole(), is(Optional.of("0"))); } - + @Test public void assertGetFrameworkHostPort() { Properties properties = new Properties(); ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); assertThat(bootstrapEnvironment.getFrameworkHostPort(), is("localhost:8899")); } - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java index f414717920..3ce7b175e8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java @@ -24,7 +24,7 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class CloudAppConfigurationBuilder { - + /** * Create cloud app configuration. * @param appName app name diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java index efba518b35..9f34b87b59 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java @@ -25,7 +25,7 @@ public final class CloudAppJsonConstants { private static final String APP_JSON = "{\"appName\":\"%s\",\"appURL\":\"http://localhost/app.jar\",\"bootstrapScript\":\"bin/start.sh\"," + "\"cpuCount\":1.0,\"memoryMB\":128.0,\"appCacheEnable\":true,\"eventTraceSamplingCount\":0}"; - + /** * Get app in json format. * @param appName app name diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java index 6a84b4b8f1..34efe0e146 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java @@ -61,7 +61,7 @@ public static CloudJobConfigurationPOJO createCloudJobConfiguration(final String * @return cloud job configuration */ public static CloudJobConfiguration createCloudJobConfiguration(final String jobName, final CloudJobExecutionType jobExecutionType, final int shardingTotalCount) { - return new CloudJobConfiguration("test_app", 1.0d, 128.0d, jobExecutionType, + return new CloudJobConfiguration("test_app", 1.0d, 128.0d, jobExecutionType, JobConfiguration.newBuilder(jobName, shardingTotalCount).cron("0/30 * * * * ?").failover(true).misfire(true).build()); } @@ -107,7 +107,7 @@ public static CloudJobConfigurationPOJO createOtherCloudJobConfiguration(final S * @return cloud job configuration */ public static CloudJobConfiguration createDataflowCloudJobConfiguration(final String jobName) { - return new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, + return new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, JobConfiguration.newBuilder(jobName, 3).cron("0/30 * * * * ?").failover(false).misfire(false).setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, Boolean.TRUE.toString()).build()); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java index 5b15150b46..d15e60facc 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java @@ -36,11 +36,11 @@ public final class EmbedTestingServer { private static final int PORT = 10181; - + private static volatile TestingServer testingServer; - + private static final Object INIT_LOCK = new Object(); - + /** * Start embed zookeeper server. */ @@ -59,7 +59,7 @@ public static void start() { waitTestingServerReady(); } } - + private static void start0() { try { testingServer = new TestingServer(PORT, true); @@ -81,7 +81,7 @@ private static void start0() { })); } } - + private static void waitTestingServerReady() { int maxRetries = 60; try (CuratorFramework client = buildCuratorClient()) { @@ -107,7 +107,7 @@ private static void waitTestingServerReady() { } } } - + private static CuratorFramework buildCuratorClient() { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); int retryIntervalMilliseconds = 500; @@ -119,11 +119,11 @@ private static CuratorFramework buildCuratorClient() { builder.connectionTimeoutMs(500); return builder.build(); } - + private static boolean isIgnoredException(final Throwable cause) { return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; } - + /** * Get the connection string. * @@ -133,4 +133,3 @@ public static String getConnectionString() { return "localhost:" + PORT; } } - diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java index bb492ee687..f02337f4db 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java @@ -41,9 +41,9 @@ public final class TaskNode { * @return task node path */ public String getTaskNodePath() { - return String.join(DELIMITER, null == jobName ? "test_job" : jobName, "" + shardingItem); + return String.join(DELIMITER, null == jobName ? "test_job" : jobName, String.valueOf(shardingItem)); } - + /** * Get task node value. * @return task node value @@ -51,7 +51,7 @@ public String getTaskNodePath() { public String getTaskNodeValue() { return String.join(DELIMITER, getTaskNodePath(), null == type ? ExecutionType.READY.toString() : type.toString(), null == slaveId ? "slave-S0" : slaveId, null == uuid ? "0" : uuid); } - + /** * Get task meta info. * @return meta info diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java index 7129fdf37e..c9d4a4d192 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java @@ -32,9 +32,9 @@ public final class JobTaskRequestTest { - private final JobTaskRequest jobTaskRequest = - new JobTaskRequest(new TaskContext("test_job", Collections.singletonList(0), ExecutionType - .READY, "unassigned-slave"), CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); + private final JobTaskRequest jobTaskRequest = + new JobTaskRequest(new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "unassigned-slave"), + CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); @Test public void assertGetId() { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java index d8e5f0854c..1d1e01044c 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java @@ -160,4 +160,3 @@ private void setReconcileEnabled(final boolean isEnabled) { when(env.getFrameworkConfiguration()).thenReturn(frameworkConfiguration); } } - diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java index dd78117c0d..3faa3f4b25 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java @@ -125,7 +125,7 @@ public void assertRunOneIterationWithScriptJob() { private TaskAssignmentResult mockTaskAssignmentResult(final String taskName, final ExecutionType executionType) { TaskAssignmentResult result = mock(TaskAssignmentResult.class); when(result.getTaskId()).thenReturn(String.format("%s@-@0@-@%s@-@unassigned-slave@-@0", taskName, executionType.name())); - return result; + return result; } @Test diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java index 89bd71df9f..d6993ffeae 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java @@ -23,7 +23,7 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class OfferBuilder { - + /** * Create offer. * @param offerId offer id diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java index 982c0ba250..0b634254fa 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java @@ -64,7 +64,7 @@ public final class ProducerManagerTest { @Mock private CloudJobConfigurationService configService; - + @Mock private ReadyService readyService; @@ -84,7 +84,7 @@ public final class ProducerManagerTest { private final CloudJobConfigurationPOJO transientJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("transient_test_job"); private final CloudJobConfigurationPOJO daemonJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("daemon_test_job", CloudJobExecutionType.DAEMON); - + @BeforeEach public void setUp() { producerManager = new ProducerManager(schedulerDriver, regCenter); @@ -104,7 +104,7 @@ public void assertStartup() { verify(transientProducerScheduler).register(transientJobConfig); verify(readyService).addDaemon("daemon_test_job"); } - + @Test public void assertRegisterJobWithoutApp() { assertThrows(AppConfigurationException.class, () -> { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java index d3665ff472..a9ba189700 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java @@ -46,7 +46,7 @@ public final class TransientProducerSchedulerTest { @Mock private Scheduler scheduler; - + private TransientProducerScheduler transientProducerScheduler; private final CloudJobConfigurationPOJO cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"); @@ -54,8 +54,9 @@ public final class TransientProducerSchedulerTest { private final JobDetail jobDetail = JobBuilder.newJob(TransientProducerScheduler.ProducerJob.class).withIdentity(cloudJobConfig.getCron()).build(); private final Trigger trigger = TriggerBuilder.newTrigger().withIdentity(cloudJobConfig.getCron()) - .withSchedule(CronScheduleBuilder.cronSchedule(cloudJobConfig.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withSchedule(CronScheduleBuilder.cronSchedule(cloudJobConfig.getCron()) + .withMisfireHandlingInstructionDoNothing()) + .build(); @BeforeEach public void setUp() { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java index 46deb83616..f4c5bc4d84 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java @@ -36,7 +36,7 @@ public final class DisableAppServiceTest { private CoordinatorRegistryCenter regCenter; private DisableAppService disableAppService; - + @BeforeEach public void setUp() { disableAppService = new DisableAppService(regCenter); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java index 9a60982c01..b07513ae83 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java @@ -59,7 +59,7 @@ public final class ReadyServiceTest { private RunningService runningService; private ReadyService readyService; - + @BeforeEach public void setUp() { readyService = new ReadyService(regCenter); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java index 14e1af7c6f..e86db674c8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java @@ -122,7 +122,7 @@ public void assertTaskResultStatisticsWhenRdbIsNotConfigured() { public void assertTaskResultStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.getSummedTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) - .thenReturn(new TaskResultStatistics(10, 10, StatisticInterval.DAY, new Date())); + .thenReturn(new TaskResultStatistics(10, 10, StatisticInterval.DAY, new Date())); assertThat(statisticManager.getTaskResultStatisticsWeekly().getSuccessCount(), is(10)); assertThat(statisticManager.getTaskResultStatisticsWeekly().getFailedCount(), is(10)); assertThat(statisticManager.getTaskResultStatisticsSinceOnline().getSuccessCount(), is(10)); @@ -134,7 +134,7 @@ public void assertTaskResultStatisticsWhenRdbIsConfigured() { public void assertJobExecutionTypeStatistics() { ReflectionUtils.setFieldValue(statisticManager, "configurationService", configurationService); when(configurationService.loadAll()).thenReturn(Arrays.asList( - CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_1", CloudJobExecutionType.DAEMON), + CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_1", CloudJobExecutionType.DAEMON), CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_2", CloudJobExecutionType.TRANSIENT))); assertThat(statisticManager.getJobExecutionTypeStatistics().getDaemonJobCount(), is(1)); assertThat(statisticManager.getJobExecutionTypeStatistics().getTransientJobCount(), is(1)); @@ -198,7 +198,7 @@ public void assertFindLatestTaskResultStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); for (StatisticInterval each : StatisticInterval.values()) { when(rdbRepository.findLatestTaskResultStatistics(each)) - .thenReturn(Optional.of(new TaskResultStatistics(10, 5, each, new Date()))); + .thenReturn(Optional.of(new TaskResultStatistics(10, 5, each, new Date()))); TaskResultStatistics actual = statisticManager.findLatestTaskResultStatistics(each); assertThat(actual.getSuccessCount(), is(10)); assertThat(actual.getFailedCount(), is(5)); @@ -216,7 +216,7 @@ public void assertFindTaskResultStatisticsDailyWhenRdbIsNotConfigured() { public void assertFindTaskResultStatisticsDailyWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.findTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) - .thenReturn(Collections.singletonList(new TaskResultStatistics(10, 5, StatisticInterval.MINUTE, new Date()))); + .thenReturn(Collections.singletonList(new TaskResultStatistics(10, 5, StatisticInterval.MINUTE, new Date()))); assertThat(statisticManager.findTaskResultStatisticsDaily().size(), is(1)); verify(rdbRepository).findTaskResultStatistics(any(Date.class), any(StatisticInterval.class)); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java index 3477a731ea..8047204227 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java @@ -52,5 +52,5 @@ public void assertReset() { assertThat(metaData.getSuccessCount(), is(0)); assertThat(metaData.getFailedCount(), is(0)); } - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java index 78fe5f9a6d..f732f2a909 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java @@ -55,5 +55,5 @@ public void assertFindBlankStatisticTimes() { } } } - + } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java index b25d7cbef5..f8513315b2 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java @@ -40,7 +40,8 @@ public Trigger buildTrigger() { return TriggerBuilder.newTrigger() .withIdentity(getTriggerName()) .withSchedule(CronScheduleBuilder.cronSchedule(StatisticInterval.MINUTE.getCron()) - .withMisfireHandlingInstructionDoNothing()).build(); + .withMisfireHandlingInstructionDoNothing()) + .build(); } @Override diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index 38abef0617..8984517ce3 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -60,10 +60,10 @@ cloud-bin - package single + package src/main/assembly/elasticjob-cloud-binary-distribution.xml diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index 7e2a65c7ef..978cb225ce 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -15,7 +15,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - + 4.0.0 @@ -142,17 +142,15 @@ maven-assembly-plugin - - src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml - + src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml - package single + package
@@ -170,6 +168,13 @@ com.spotify dockerfile-maven-plugin + + apache/shardingsphere-elasticjob-cloud-scheduler + ${project.version} + + ${project.build.finalName}-cloud-scheduler-bin + + cloud-scheduler-bin @@ -178,13 +183,6 @@ - - apache/shardingsphere-elasticjob-cloud-scheduler - ${project.version} - - ${project.build.finalName}-cloud-scheduler-bin - -
diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index 485fabb115..fa4034102b 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -70,10 +70,10 @@ lite-bin - package single + package src/main/assembly/elasticjob-lite-binary-distribution.xml diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index 5eb0c3ffa0..5cdeb9c356 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -37,10 +37,10 @@ src - package single + package src/main/assembly/source-distribution.xml diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index be5f997bab..eba35b5202 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -27,14 +27,14 @@ pom ${project.artifactId} - - true - - elasticjob-src-distribution elasticjob-lite-distribution elasticjob-cloud-executor-distribution elasticjob-cloud-scheduler-distribution + + + true + diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java index 95f85d9e0a..1b9f67fb3b 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index e90ceb4cf9..7da18a0949 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -48,7 +48,7 @@ com.sun.mail javax.mail - + ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java index eddfa5da58..5d48b4b6f8 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java @@ -93,7 +93,7 @@ private Properties createSessionProperties(final String host, final int port, fi private Authenticator getSessionAuthenticator(final String username, final String password) { return new Authenticator() { - + @Override public PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); @@ -116,7 +116,7 @@ public void handleException(final String jobName, final Throwable cause) { private String getErrorMessage(final String jobName, final Throwable cause) { StringWriter writer = new StringWriter(); cause.printStackTrace(new PrintWriter(writer, true)); - return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer.toString()); + return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer); } private Message createMessage(final String content) throws MessagingException { diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 9184609e4a..1f823ad4e9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -41,12 +41,12 @@ org.slf4j slf4j-api - + org.projectlombok lombok - + ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java index 363573c2ff..5e77909bc5 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java index d6d9521087..5eaab152de 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java index 2311b69dc3..2d98f0f454 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java index 7d763724b8..ffa3299405 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java index 7bf5b15b50..c81f994dc4 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java @@ -7,7 +7,7 @@ * 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. @@ -37,8 +37,7 @@ public void assertGetDefaultHandler() { @Test public void assertGetInvalidHandler() { - assertThrows(JobConfigurationException.class, () -> - JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException(""))); + assertThrows(JobConfigurationException.class, () -> JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException(""))); } @Test diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java index 3318cafcc0..054ec2437c 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java @@ -7,7 +7,7 @@ * 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. @@ -27,7 +27,7 @@ public final class IgnoreJobErrorHandlerTest { @Test public void assertHandleException() { - JobErrorHandlerFactory.createHandler("IGNORE", new Properties()).orElseThrow( - () -> new JobConfigurationException("IGNORE error handler not found.")).handleException("test_job", new RuntimeException("test")); + JobErrorHandlerFactory.createHandler("IGNORE", new Properties()) + .orElseThrow(() -> new JobConfigurationException("IGNORE error handler not found.")).handleException("test_job", new RuntimeException("test")); } } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java index a76aa3da5b..d487643763 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java index 7a8b0bbb1c..86b1ac5504 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java @@ -7,7 +7,7 @@ * 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. @@ -27,11 +27,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; public final class ThrowJobErrorHandlerTest { - + @Test public void assertHandleException() { - assertThrows(JobSystemException.class, () -> - JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElseThrow(() -> - new JobConfigurationException("THROW error handler not found.")).handleException("test_job", new RuntimeException("test"))); + assertThrows(JobSystemException.class, () -> JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElseThrow(() -> new JobConfigurationException("THROW error handler not found.")) + .handleException("test_job", new RuntimeException("test"))); } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java index 6a879be4f1..b43cc29764 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java @@ -7,7 +7,7 @@ * 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. @@ -92,9 +92,9 @@ public void execute() { } try { jobFacade.beforeJobExecuted(shardingContexts); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Throwable cause) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON jobErrorHandler.handleException(jobConfig.getJobName(), cause); } execute(jobConfig, shardingContexts, ExecutionSource.NORMAL_TRIGGER); @@ -105,9 +105,9 @@ public void execute() { jobFacade.failoverIfNecessary(); try { jobFacade.afterJobExecuted(shardingContexts); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Throwable cause) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON jobErrorHandler.handleException(jobConfig.getJobName(), cause); } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java index 03fb1c6ac6..40b2cda64f 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java index f95d40dbb7..39c249e0ca 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java index d2792d1a39..4d4ed138ff 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java index dd77a904b7..1627f6967d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java index b2f0542638..fba87a4d6a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java index d8ee2974ea..46628780c6 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java @@ -7,7 +7,7 @@ * 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. @@ -101,7 +101,7 @@ public void assertExecuteWhenPreviousJobStillRunning() { when(jobFacade.misfireIfRunning(shardingContexts.getShardingItemParameters().keySet())).thenReturn(true); elasticJobExecutor.execute(); verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin."); - verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, + verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "Previous job 'test_job' - shardingItems '[]' is still running, misfired job will start after previous job completed."); verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); } @@ -115,7 +115,7 @@ public void assertExecuteWhenShardingItemsIsEmpty() { verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "Sharding item for job 'test_job' is empty."); verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); } - + @Test public void assertExecuteFailureWhenThrowExceptionForSingleShardingItem() { assertThrows(JobSystemException.class, () -> assertExecuteFailureWhenThrowException(createSingleShardingContexts())); diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java index c5299c6624..e5554dcd29 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java index 25c21d455e..3e46cbf9b0 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java index 0cd62dfd0d..c0101e7f53 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java index 6657d93560..ad2deef881 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java index edfaf113d2..006a07a848 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java index 7bacb85b86..08c0fe09b6 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java @@ -7,7 +7,7 @@ * 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. @@ -33,8 +33,7 @@ public final class JobItemExecutorFactoryTest { @Test public void assertGetExecutorByClassFailureWithInvalidType() { - assertThrows(JobConfigurationException.class, () -> - JobItemExecutorFactory.getExecutor(FailedJob.class)); + assertThrows(JobConfigurationException.class, () -> JobItemExecutorFactory.getExecutor(FailedJob.class)); } @Test @@ -49,8 +48,7 @@ public void assertGetExecutorByClassSuccessWithSubClass() { @Test public void assertGetExecutorByTypeFailureWithInvalidType() { - assertThrows(JobConfigurationException.class, () -> - JobItemExecutorFactory.getExecutor("FAIL")); + assertThrows(JobConfigurationException.class, () -> JobItemExecutorFactory.getExecutor("FAIL")); } @Test diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java index 0de47005de..2eea1de495 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java index 486fdbf27e..f88e52383c 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java index 4aed5460d0..9da5aaefe5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index 65ff59805b..43dd477f17 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -32,7 +32,7 @@ elasticjob-executor-kernel ${project.parent.version} - + org.apache.shardingsphere.elasticjob elasticjob-restful @@ -45,12 +45,12 @@ lombok provided - + org.slf4j slf4j-jdk14 - true test + true org.awaitility diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 29d37f6e15..2d6b4c9c69 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -61,7 +61,7 @@ public final class HttpJobExecutorTest { @Mock private JobFacade jobFacade; - + // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. @Mock(strictness = Mock.Strictness.LENIENT) private Properties properties; diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java index 16d56c19c9..e94d88d4a1 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java @@ -75,9 +75,7 @@ public String postName(@Param(name = "updateName", source = ParamSource.PATH) fi */ @Mapping(method = Http.POST, path = "/postWithTimeout") public String postWithTimeout() { - Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.SECONDS).untilAsserted(() -> - assertThat(Boolean.TRUE, is(Boolean.TRUE)) - ); + Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(Boolean.TRUE, is(Boolean.TRUE))); return "ejob"; } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java index 781790754d..2051d70f6f 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java index ff3137f47a..94fca9e86d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index d6e7366a8f..3f3a9dfdd7 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -87,15 +87,15 @@ public void assertProcess() { when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn(determineCommandByPlatform()); jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); } - + private String determineCommandByPlatform() { return OS.isFamilyWindows() ? getWindowsEcho() : getEcho(); } - + private String getWindowsEcho() { return "cmd /c echo script-job"; } - + private String getEcho() { return "echo script-job"; } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java index d6f6c8e85b..2423eddd8b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java index a414cd9b07..787dd9d6a5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java index 72e24a95b5..963aa69a45 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index a549e4f6f5..f1745faebe 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -56,7 +56,7 @@ org.projectlombok lombok - + org.slf4j jcl-over-slf4j diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java index 46df6e47ef..8f39d39ca6 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java @@ -7,7 +7,7 @@ * 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. @@ -37,13 +37,13 @@ */ @Slf4j public final class JobTracingEventBus { - + private static final ExecutorService EXECUTOR_SERVICE; private final EventBus eventBus; private volatile boolean isRegistered; - + static { EXECUTOR_SERVICE = createExecutorService(Runtime.getRuntime().availableProcessors() * 2); } @@ -58,7 +58,7 @@ public JobTracingEventBus(final TracingConfiguration tracingConfig) { } private static ExecutorService createExecutorService(final int threadSize) { - ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(threadSize, threadSize, 5L, TimeUnit.MINUTES, + ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(threadSize, threadSize, 5L, TimeUnit.MINUTES, new LinkedBlockingQueue<>(), new BasicThreadFactory.Builder().namingPattern(String.join("-", "job-event", "%s")).build()); threadPoolExecutor.allowCoreThreadTimeOut(true); return MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService(threadPoolExecutor)); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java index 1c504a789b..46b0efdfe1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java index 3b7324eab1..68f2241670 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java index 1f95531b46..183c34aff1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java index 9a1b679e66..3e1a286039 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java index 89f8a1521d..067e82cd1a 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java index 414ddeb9f1..b9ac000265 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java index eb3b2f251b..3fbb124e09 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java index d088728816..f4c451cee0 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java index b8a5d1f759..b85cc30a46 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java index e14a49cf7b..7a10039fe1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java index 99d0cad5c2..1d454862bb 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java index ed824c8e60..7f6cfdf40c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java index 48f09f0225..d29b840f2a 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java index c950d22c71..d87fb5e432 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java index 56fa18eeca..c284f5e553 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java @@ -7,7 +7,7 @@ * 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. @@ -31,14 +31,12 @@ public final class TracingListenerFactoryTest { @Test public void assertGetListenerWithNullType() { - assertThrows(TracingConfigurationException.class, () -> - TracingListenerFactory.getListener(new TracingConfiguration<>("", null))); + assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("", null))); } - + @Test public void assertGetInvalidListener() { - assertThrows(TracingConfigurationException.class, () -> - TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null))); + assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null))); } @Test diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java index 1c2c712da1..4f31edb5f1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java @@ -36,6 +36,6 @@ public void assertConverterNotFound() { } private static class AClassWithoutCorrespondingConverter { - + } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index cd04ba62d5..c9ff6ba2dd 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -37,7 +37,7 @@ org.projectlombok lombok - + org.slf4j jcl-over-slf4j diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java index 3c518e8382..87b4a907bd 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java index f6747e5235..397f78c338 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 8c27715f0f..be6f2d310c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -7,7 +7,7 @@ * 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. @@ -58,28 +58,28 @@ public final class RDBJobEventStorage { private static final String TASK_ID_STATE_INDEX = "TASK_ID_STATE_INDEX"; private static final Map DATABASE_TYPES = new HashMap<>(); - + private static final Map STORAGE_MAP = new ConcurrentHashMap<>(); - + private final DataSource dataSource; - + private final DatabaseType databaseType; - + private final RDBStorageSQLMapper sqlMapper; - + static { for (DatabaseType each : ServiceLoader.load(DatabaseType.class)) { DATABASE_TYPES.put(each.getType(), each); } } - + private RDBJobEventStorage(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; databaseType = getDatabaseType(dataSource); sqlMapper = new RDBStorageSQLMapper(databaseType.getSQLPropertiesFile()); initTablesAndIndexes(); } - + /** * The same dataSource always return the same RDBJobEventStorage instance. * @@ -96,7 +96,7 @@ public static RDBJobEventStorage getInstance(final DataSource dataSource) throws } })); } - + /** * WrapException util method. * @@ -114,7 +114,7 @@ public static RDBJobEventStorage wrapException(final Supplier - new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource())); + assertThrows(TracingConfigurationException.class, () -> new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource())); } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 3f67f4f355..0a41349898 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index ce708f28a1..5fc5c40848 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -7,7 +7,7 @@ * 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. @@ -39,7 +39,7 @@ public final class RDBJobEventStorageTest { private RDBJobEventStorage storage; - + private BasicDataSource dataSource; @BeforeEach @@ -56,7 +56,7 @@ public void setup() throws SQLException { public void teardown() throws SQLException { dataSource.close(); } - + @Test public void assertAddJobExecutionEvent() { assertTrue(storage.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0))); @@ -137,7 +137,7 @@ public void assertUpdateJobExecutionEventWhenFailureAndMessageExceed() { for (int i = 0; i < 600; i++) { failureMsg.append(i); } - JobExecutionEvent failEvent = startEvent.executionFailure("java.lang.RuntimeException: failure" + failureMsg.toString()); + JobExecutionEvent failEvent = startEvent.executionFailure("java.lang.RuntimeException: failure" + failureMsg); assertTrue(storage.addJobExecutionEvent(failEvent)); assertThat(failEvent.getFailureCause(), startsWith("java.lang.RuntimeException: failure")); } diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index f352732a2c..4314358467 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -59,7 +59,7 @@ org.projectlombok lombok - + org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java index 6cce9c23f5..25f3139b2d 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java index 689dbe3272..90f91e908b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java @@ -7,7 +7,7 @@ * 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. @@ -50,7 +50,7 @@ public ElasticJobExecutorService(final String namingPattern, final int threadSiz public ExecutorService createExecutorService() { return MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService(threadPoolExecutor)); } - + /** * Whether the threadPoolExecutor has been shut down. * diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java index 2f411c4ca8..31de960583 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java @@ -40,14 +40,16 @@ public final class ExecutorServiceReloadable implements Reloadable shardingItems; - + /** * Get task meta data info via string. * @@ -144,7 +144,8 @@ public static MetaInfo from(final String value) { String[] result = value.split(DELIMITER); Preconditions.checkState(1 == result.length || 2 == result.length || 5 == result.length); return new MetaInfo(result[0], 1 == result.length || "".equals(result[1]) - ? Collections.emptyList() : Splitter.on(",").splitToList(result[1]).stream().map(Integer::parseInt).collect(Collectors.toList())); + ? Collections.emptyList() + : Splitter.on(",").splitToList(result[1]).stream().map(Integer::parseInt).collect(Collectors.toList())); } @Override diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java index 785318b8a2..56e1423199 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java index 42acc700d6..c5ddbefe5a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java index a98c6d5fc2..77236d6e33 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java index 0b5676ef40..7a127b60d5 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java index d7642865c8..dc8bcee988 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java index de3ea67719..95245b9f72 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java index 3fea412e07..d4093ccdb2 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java index 402fcf9e59..914540e30b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java index d3abc88330..70e4b704a6 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java index ee40bf186f..628e0f43e0 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java index 6afcb56a45..3e2bcc2c2b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java index 907fd235af..d96803340a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java @@ -7,7 +7,7 @@ * 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. @@ -31,7 +31,6 @@ * IP address asc if job name' hashcode is odd; * IP address desc if job name' hashcode is even. * Used to average assign to job server. - * * For example: * 1. If there are 3 job servers with 2 sharding item, and the hash value of job name is odd, then each server is divided into: 1 = [0], 2 = [1], 3 = []; * 2. If there are 3 job servers with 2 sharding item, and the hash value of job name is even, then each server is divided into: 3 = [0], 2 = [1], 1 = []. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java index a3cb679d53..182f63ccda 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java index 1e095aea4b..39c1f642a5 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java index 1cc14948ac..839c7baffd 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java index 840370cb38..f28d060ffa 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java index 37ed03ce23..959f84505b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java index 9dac2197ac..c81e2d3730 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java index 8b3a21096e..dc7b2f8f55 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java @@ -65,7 +65,7 @@ public static Gson getGson() { public static JsonParser getJsonParser() { return JSON_PARSER; } - + /** * Re-initialize the GsonBuilder. */ diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java index f16e784b80..4fc1b249d8 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java @@ -7,7 +7,7 @@ * 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. @@ -23,7 +23,7 @@ * ElasticJob listener. */ public interface ElasticJobListener extends TypedSPI { - + int LOWEST = Integer.MAX_VALUE; /** @@ -39,7 +39,7 @@ public interface ElasticJobListener extends TypedSPI { * @param shardingContexts sharding contexts */ void afterJobExecuted(ShardingContexts shardingContexts); - + /** * Listener order, default is the lowest. * @return order diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java index f166e81e36..b5aab2459a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java index 85ab86191f..50fef3a0af 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java index 501cad3b3e..e322e94d1c 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java index 233f9ff304..aa13ff780a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java +++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java @@ -27,6 +27,7 @@ * ElasticJob YAML representer. */ public final class ElasticJobYamlRepresenter extends Representer { + public ElasticJobYamlRepresenter(final DumperOptions options) { super(options); } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index 3db5903723..47b990a437 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -7,7 +7,7 @@ * 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. @@ -31,7 +31,7 @@ public final class ElasticJobExecutorServiceTest { private static boolean hasExecuted; - + @Test public void assertCreateExecutorService() { ElasticJobExecutorService executorServiceObject = new ElasticJobExecutorService("executor-service-test", 1); @@ -58,7 +58,7 @@ public void assertCreateExecutorService() { } static class FooTask implements Runnable { - + @Override public void run() { Awaitility.await().atMost(1L, TimeUnit.MINUTES) diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java index ee6b5bc620..040e44b06b 100755 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java index 93803aa430..c65a15f749 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java index 8e9a87d0bc..94202fb856 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java @@ -7,7 +7,7 @@ * 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. @@ -43,6 +43,6 @@ public String getTaskNodeValue() { } private String getTaskNodePath() { - return String.join("@-@", null == jobName ? "test_job" : jobName, shardingItem + ""); + return String.join("@-@", null == jobName ? "test_job" : jobName, String.valueOf(shardingItem)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java index 45d1e478e4..fc91f356aa 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index d2ea13281e..d88adb03df 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java index 55341edc51..d48b5c87b9 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java index 2d585f41e9..d42f12baf1 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java index c94cecd137..0af136a9e3 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java index 24c4bd19b4..7b69ba07ce 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java index 5e08bc50c9..0b904b655e 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java index 4596f0da32..5b83660c08 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java index 1cd13ae37d..2bbc181d50 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java index 11a516c001..bbf9888d67 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java @@ -7,7 +7,7 @@ * 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. @@ -35,8 +35,7 @@ public void assertGetDefaultStrategy() { @Test public void assertGetInvalidStrategy() { - assertThrows(JobConfigurationException.class, () -> - JobShardingStrategyFactory.getStrategy("INVALID")); + assertThrows(JobConfigurationException.class, () -> JobShardingStrategyFactory.getStrategy("INVALID")); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java index 9d6525f7a9..e4b01e232d 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java index b651b1f542..009078818a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java index e1709e9ab6..aa081a4537 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java index 863cd9860e..b5f921c016 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java @@ -7,7 +7,7 @@ * 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. @@ -35,8 +35,7 @@ public void assertGetDefaultHandler() { @Test public void assertGetInvalidHandler() { - assertThrows(JobConfigurationException.class, () -> - JobExecutorServiceHandlerFactory.getHandler("INVALID")); + assertThrows(JobConfigurationException.class, () -> JobExecutorServiceHandlerFactory.getHandler("INVALID")); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java index 23fc1a90e7..51d83b2011 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java @@ -76,4 +76,3 @@ public void assertParserWithException() { }); } } - diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java index f00a68bc87..4e0333e0d7 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java @@ -29,8 +29,7 @@ public final class ElasticJobListenerFactoryTest { @Test public void assertCreateInvalidJobListener() { - assertThrows(JobConfigurationException.class, () -> - ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!"))); + assertThrows(JobConfigurationException.class, () -> ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!"))); } @Test diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java index 8eb20c5af0..91375ad711 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java index 5f19fb6cc8..f53ce97d25 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java @@ -25,7 +25,7 @@ public final class FooElasticJobListener implements ElasticJobListener { @Override public void beforeJobExecuted(final ShardingContexts shardingContexts) { } - + @Override public void afterJobExecuted(final ShardingContexts shardingContexts) { } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java index 1fbdf14b07..4e8493abc0 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java index fb0ad8b5cd..350ce60876 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java @@ -47,25 +47,25 @@ public void assertNewTypedServiceInstance() { @Test public void assertGetCacheTypedServiceFailureWithUnRegisteredServiceInterface() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.getCachedTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( + UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new)); } @Test public void assertGetCacheTypedServiceFailureWithInvalidType() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( + TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new)); } @Test public void assertNewTypedServiceInstanceFailureWithUnRegisteredServiceInterface() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader + .newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new)); } @Test public void assertNewTypedServiceInstanceFailureWithInvalidType() { - Assertions.assertThrows(IllegalArgumentException.class, () -> - ElasticJobServiceLoader.newTypedServiceInstance(TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new)); + Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.newTypedServiceInstance( + TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java index 89159cff06..5ed5219bb1 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java @@ -5,9 +5,9 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java index f17010441f..32891da473 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java @@ -5,9 +5,9 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java index 385714774c..02fef28610 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java @@ -5,9 +5,9 @@ * 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. diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java index a0e1401b2c..c53e043b17 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java @@ -5,9 +5,9 @@ * 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. @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService; public final class UnRegisteredTypedFooServiceImpl implements UnRegisteredTypedFooService { - + @Override public String getType() { return "unRegisteredTypedFooServiceImpl"; diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java index 7c02c0ea57..0de1734828 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java @@ -29,6 +29,6 @@ public void assertConverterNotFound() { } private static class AClassWithoutCorrespondingConverter { - + } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index 6819cb1324..e89073a229 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -17,15 +17,15 @@ --> + 4.0.0 - elasticjob-registry-center org.apache.shardingsphere.elasticjob + elasticjob-registry-center 3.1.0-SNAPSHOT - 4.0.0 elasticjob-registry-center-api ${project.artifactId} - + org.slf4j diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java index 574601406f..8785c1acb3 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java @@ -7,7 +7,7 @@ * 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. @@ -123,7 +123,7 @@ public interface CoordinatorRegistryCenter extends RegistryCenter { * @param listener connection state changed event listener */ void addConnectionStateChangedEventListener(String key, ConnectionStateChangedEventListener listener); - + /** * Execute operations in transaction. * @@ -131,13 +131,13 @@ public interface CoordinatorRegistryCenter extends RegistryCenter { * @throws Exception exception */ void executeInTransaction(List transactionOperations) throws Exception; - + /** * Remove all data listeners that have been bound to the current key. * @param key key to be watched */ void removeDataListeners(String key); - + /** * Remove conn state listener that have been bound to the current key. * @param key key to be watched diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java index c0d0ad6184..5d2987a26f 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java index 701572f81e..e9c1e31de2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java index 1254f91987..229d60d4b5 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java index 20f4f0751f..2100a0fd49 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java index 9488c8646b..dc268358c5 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java @@ -27,9 +27,9 @@ public interface ConnectionStateChangedEventListener { enum State { CONNECTED, - + RECONNECTED, - + UNAVAILABLE, } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java index 334f8a6acf..65ca4a1a7a 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java @@ -21,7 +21,7 @@ * Data changed listener. */ public interface DataChangedEventListener { - + /** * Fire when data changed. * diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java index e619bf325b..01c0e1e575 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index 58210f29e2..8685723b4a 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -17,22 +17,22 @@ --> + 4.0.0 - elasticjob-regitry-center-provider org.apache.shardingsphere.elasticjob + elasticjob-regitry-center-provider 3.1.0-SNAPSHOT - 4.0.0 elasticjob-registry-center-zookeeper-curator ${project.artifactId} - + org.apache.shardingsphere.elasticjob elasticjob-registry-center-api ${project.parent.version} - + org.apache.curator curator-framework @@ -45,12 +45,12 @@ org.apache.curator curator-recipes - + org.projectlombok lombok - + org.apache.curator curator-test @@ -71,5 +71,5 @@ test - + diff --git a/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 b/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 index ac4186e04e..056ea9a7b8 100644 --- a/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 +++ b/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 @@ -7,7 +7,7 @@ * 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. @@ -74,17 +74,17 @@ public final class ZookeeperRegistryCenter implements CoordinatorRegistryCenter private final ZookeeperConfiguration zkConfig; private final Map caches = new ConcurrentHashMap<>(); - + /** * Data listener list. */ private final Map> dataListeners = new ConcurrentHashMap<>(); - + /** * Connections state listener list. */ private final Map> connStateListeners = new ConcurrentHashMap<>(); - + @Getter private CuratorFramework client; @@ -108,12 +108,12 @@ public void init() { if (!Strings.isNullOrEmpty(zkConfig.getDigest())) { builder.authorization("digest", zkConfig.getDigest().getBytes(StandardCharsets.UTF_8)) .aclProvider(new ACLProvider() { - + @Override public List getDefaultAcl() { return ZooDefs.Ids.CREATOR_ALL_ACL; } - + @Override public List getAclForPath(final String path) { return ZooDefs.Ids.CREATOR_ALL_ACL; @@ -127,9 +127,9 @@ public List getAclForPath(final String path) { client.close(); throw new KeeperException.OperationTimeoutException(); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -144,9 +144,7 @@ public void close() { } /* - * // TODO - * sleep 500ms, let cache client close first and then client, otherwise will throw exception - * reference:https://issues.apache.org/jira/browse/CURATOR-157 + * // TODO sleep 500ms, let cache client close first and then client, otherwise will throw exception reference:https://issues.apache.org/jira/browse/CURATOR-157 */ private void waitForCacheClose() { try { @@ -179,9 +177,9 @@ private CuratorCache findCuratorCache(final String key) { public String getDirectly(final String key) { try { return new String(client.getData().forPath(key), StandardCharsets.UTF_8); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); return null; } @@ -193,9 +191,9 @@ public List getChildrenKeys(final String key) { List result = client.getChildren().forPath(key); result.sort(Comparator.reverseOrder()); return result; - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); return Collections.emptyList(); } @@ -208,21 +206,21 @@ public int getNumChildren(final String key) { if (null != stat) { return stat.getNumChildren(); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } return 0; } - + @Override public boolean isExisted(final String key) { try { return null != client.checkExists().forPath(key); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); return false; } @@ -236,9 +234,9 @@ public void persist(final String key, final String value) { } else { update(key, value); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -248,9 +246,9 @@ public void update(final String key, final String value) { try { TransactionOp transactionOp = client.transactionOp(); client.transaction().forOperations(transactionOp.check().forPath(key), transactionOp.setData().forPath(key, value.getBytes(StandardCharsets.UTF_8))); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -262,9 +260,9 @@ public void persistEphemeral(final String key, final String value) { client.delete().deletingChildrenIfNeeded().forPath(key); } client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL).forPath(key, value.getBytes(StandardCharsets.UTF_8)); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -273,9 +271,9 @@ public void persistEphemeral(final String key, final String value) { public String persistSequential(final String key, final String value) { try { return client.create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT_SEQUENTIAL).forPath(key, value.getBytes(StandardCharsets.UTF_8)); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } return null; @@ -285,9 +283,9 @@ public String persistSequential(final String key, final String value) { public void persistEphemeralSequential(final String key) { try { client.create().creatingParentsIfNeeded().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).forPath(key); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -296,9 +294,9 @@ public void persistEphemeralSequential(final String key) { public void remove(final String key) { try { client.delete().deletingChildrenIfNeeded().forPath(key); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } } @@ -309,9 +307,9 @@ public long getRegistryCenterTime(final String key) { try { persist(key, ""); result = client.checkExists().forPath(key).getMtime(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } Preconditions.checkState(0L != result, "Cannot get registry center time."); @@ -378,9 +376,9 @@ private CuratorOp toCuratorOp(final TransactionOperation each, final Transaction default: throw new UnsupportedOperationException(each.toString()); } - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON throw new RegException(ex); } } @@ -390,9 +388,9 @@ public void addCacheData(final String cachePath) { CuratorCache cache = CuratorCache.build(client, cachePath); try { cache.start(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON RegExceptionHandler.handleException(ex); } caches.put(cachePath + "/", cache); @@ -417,9 +415,9 @@ public void executeInLeader(final String key, final LeaderExecutionCallback call latch.start(); latch.await(); callback.execute(); - //CHECKSTYLE:OFF + // CHECKSTYLE:OFF } catch (final Exception ex) { - //CHECKSTYLE:ON + // CHECKSTYLE:ON handleException(ex); } } @@ -446,7 +444,7 @@ public void watch(final String key, final DataChangedEventListener listener, fin } dataListeners.computeIfAbsent(key, k -> new LinkedList<>()).add(cacheListener); } - + @Override public void removeDataListeners(final String key) { final CuratorCache cache = caches.get(key + "/"); @@ -460,7 +458,7 @@ public void removeDataListeners(final String key) { } cacheListenerList.forEach(listener -> cache.listenable().removeListener(listener)); } - + @Override public void removeConnStateListener(final String key) { final List listenerList = connStateListeners.remove(key); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java index 360ca6580b..85b006226e 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java @@ -29,7 +29,7 @@ * Zookeeper curator ignored exception provider. */ public final class ZookeeperCuratorIgnoredExceptionProvider implements IgnoredExceptionProvider { - + @Override public Collection> getIgnoredExceptions() { return Arrays.asList(ConnectionLossException.class, NoNodeException.class, NodeExistsException.class); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java index 4b11d653b4..f02943e254 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 826ec40096..5edb311d47 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -7,7 +7,7 @@ * 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. @@ -83,12 +83,12 @@ private void blockUntilCondition(final Supplier condition) { Thread.sleep(100); } } - + @SneakyThrows private boolean hasLeadership(final ZookeeperElectionService zookeeperElectionService) { return ((LeaderSelector) getFieldValue(zookeeperElectionService, "leaderSelector")).hasLeadership(); } - + @SneakyThrows private Object getFieldValue(final Object target, final String fieldName) { Field field = target.getClass().getDeclaredField(fieldName); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index 61626ceecb..d4f4fe7167 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -7,7 +7,7 @@ * 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. @@ -58,9 +58,9 @@ public static void tearDown() { @Test public void assertInitWithDigestSuccess() throws Exception { CuratorFramework client = CuratorFrameworkFactory.builder() - .connectString(EmbedTestingServer.getConnectionString()) - .retryPolicy(new RetryOneTime(2000)) - .authorization("digest", "digest:password".getBytes()).build(); + .connectString(EmbedTestingServer.getConnectionString()) + .retryPolicy(new RetryOneTime(2000)) + .authorization("digest", "digest:password".getBytes()).build(); client.start(); client.blockUntilConnected(); assertThat(client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"), is("deepNested".getBytes())); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java index 9d301af581..dc59f3ad97 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java @@ -7,7 +7,7 @@ * 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. @@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; public final class ZookeeperRegistryCenterInitFailureTest { - + @Test public void assertInitFailure() { assertThrows(RegException.class, () -> { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java index bd4f0a65ee..a5e84a63fb 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java @@ -43,41 +43,41 @@ @ExtendWith(MockitoExtension.class) public class ZookeeperRegistryCenterListenerTest { - + @Mock private Map caches; - + @Mock private CuratorFramework client; - + @Mock private CuratorCache cache; - + @Mock private Listenable connStateListenable; - + @Mock private Listenable dataListenable; - + private ZookeeperRegistryCenter regCenter; - + private final String jobPath = "/test_job"; - + @BeforeEach public void setUp() { regCenter = new ZookeeperRegistryCenter(null); ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "caches", caches); ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "client", client); } - + @Test - public void testAddConnectionStateChangedEventListener() throws Exception { + public void testAddConnectionStateChangedEventListener() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); regCenter.addConnectionStateChangedEventListener(jobPath, null); verify(client.getConnectionStateListenable()).addListener(any()); assertEquals(1, getConnStateListeners().get(jobPath).size()); } - + @Test public void testWatch() { when(caches.get(jobPath + "/")).thenReturn(cache); @@ -86,7 +86,7 @@ public void testWatch() { verify(cache.listenable()).addListener(any()); assertEquals(1, getDataListeners().get(jobPath).size()); } - + @Test public void testRemoveDataListenersNonCache() { when(cache.listenable()).thenReturn(dataListenable); @@ -94,7 +94,7 @@ public void testRemoveDataListenersNonCache() { verify(cache.listenable(), never()).removeListener(any()); assertNull(getDataListeners().get(jobPath)); } - + @Test public void testRemoveDataListenersHasCache() { when(caches.get(jobPath + "/")).thenReturn(cache); @@ -107,16 +107,16 @@ public void testRemoveDataListenersHasCache() { assertNull(getDataListeners().get(jobPath)); verify(cache.listenable(), times(2)).removeListener(null); } - + @Test - public void testRemoveDataListenersHasCacheEmptyListeners() throws Exception { + public void testRemoveDataListenersHasCacheEmptyListeners() { when(caches.get(jobPath + "/")).thenReturn(cache); when(cache.listenable()).thenReturn(dataListenable); regCenter.removeDataListeners(jobPath); assertNull(getDataListeners().get(jobPath)); verify(cache.listenable(), never()).removeListener(null); } - + @Test public void testRemoveConnStateListener() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); @@ -129,21 +129,21 @@ public void testRemoveConnStateListener() { assertNull(getConnStateListeners().get(jobPath)); verify(client.getConnectionStateListenable(), times(2)).removeListener(null); } - + @Test - public void testRemoveConnStateListenerEmptyListeners() throws Exception { + public void testRemoveConnStateListenerEmptyListeners() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); regCenter.removeConnStateListener(jobPath); assertNull(getConnStateListeners().get(jobPath)); verify(client.getConnectionStateListenable(), never()).removeListener(null); } - + @SuppressWarnings("unchecked") private Map> getConnStateListeners() { return (Map>) ZookeeperRegistryCenterTestUtil .getFieldValue(regCenter, "connStateListeners"); } - + @SuppressWarnings("unchecked") private Map> getDataListeners() { return (Map>) ZookeeperRegistryCenterTestUtil diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java index 332ed279a0..119335b6f0 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java @@ -7,7 +7,7 @@ * 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. @@ -30,7 +30,7 @@ public final class ZookeeperRegistryCenterMiscellaneousTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterMiscellaneousTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index 45756679d4..10da179f00 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -7,7 +7,7 @@ * 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. diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index 9940b8228c..3b22d66051 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -7,7 +7,7 @@ * 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. @@ -29,7 +29,7 @@ public final class ZookeeperRegistryCenterQueryWithCacheTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithCacheTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index d8407dd7e5..94e630d291 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -7,7 +7,7 @@ * 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. @@ -34,7 +34,7 @@ public final class ZookeeperRegistryCenterQueryWithoutCacheTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithoutCacheTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index 52aa4f0400..4f5c08a730 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -33,12 +33,12 @@ import static org.junit.jupiter.api.Assertions.assertFalse; public final class ZookeeperRegistryCenterTransactionTest { - + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); - + private static ZookeeperRegistryCenter zkRegCenter; - + @BeforeAll public static void setUp() { EmbedTestingServer.start(); @@ -46,12 +46,12 @@ public static void setUp() { ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); } - + @BeforeEach public void setup() { ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - + @Test public void assertExecuteInTransactionSucceeded() throws Exception { List operations = new ArrayList<>(3); @@ -62,7 +62,7 @@ public void assertExecuteInTransactionSucceeded() throws Exception { zkRegCenter.executeInTransaction(operations); assertThat(zkRegCenter.getDirectly("/test/transaction"), is("transaction")); } - + @Test public void assertExecuteInTransactionFailed() throws Exception { List operations = new ArrayList<>(3); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index 1bf5a24edc..f6a0eeaf07 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -36,11 +36,11 @@ import static org.hamcrest.MatcherAssert.assertThat; public final class ZookeeperRegistryCenterWatchTest { - + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); - + private static ZookeeperRegistryCenter zkRegCenter; - + @BeforeAll public static void setUp() { EmbedTestingServer.start(); @@ -49,12 +49,12 @@ public static void setUp() { zkRegCenter.init(); ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } - + @AfterAll public static void tearDown() { zkRegCenter.close(); } - + @Test @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) public void assertWatchWithoutExecutor() throws InterruptedException { @@ -73,7 +73,7 @@ public void assertWatchWithoutExecutor() throws InterruptedException { zkRegCenter.update(key, "countDown"); waitingForCountDownValue.await(); } - + @Test @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) public void assertWatchWithExecutor() throws InterruptedException { diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java index fac6876979..70ae28a00b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java @@ -7,7 +7,7 @@ * 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. @@ -36,11 +36,11 @@ public final class EmbedTestingServer { private static final int PORT = 9181; - + private static volatile TestingServer testingServer; - + private static final Object INIT_LOCK = new Object(); - + /** * Start embed zookeeper server. */ @@ -59,7 +59,7 @@ public static void start() { waitTestingServerReady(); } } - + private static void start0() { try { testingServer = new TestingServer(PORT, true); @@ -81,7 +81,7 @@ private static void start0() { })); } } - + private static void waitTestingServerReady() { int maxRetries = 60; try (CuratorFramework client = buildCuratorClient()) { @@ -107,7 +107,7 @@ private static void waitTestingServerReady() { } } } - + private static CuratorFramework buildCuratorClient() { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); int retryIntervalMilliseconds = 500; @@ -119,11 +119,11 @@ private static CuratorFramework buildCuratorClient() { builder.connectionTimeoutMs(500); return builder.build(); } - + private static boolean isIgnoredException(final Throwable cause) { return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; } - + /** * Get the connection string. * @@ -133,4 +133,3 @@ public static String getConnectionString() { return "localhost:" + PORT; } } - diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java index 2dfcbb5e38..e9f8da443b 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java @@ -7,7 +7,7 @@ * 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. @@ -37,7 +37,7 @@ public static void persist(final ZookeeperRegistryCenter zookeeperRegistryCenter zookeeperRegistryCenter.persist("/test/deep/nested", "deepNested"); zookeeperRegistryCenter.persist("/test/child", "child"); } - + /** * Set field value use reflection. * @@ -51,7 +51,7 @@ public static void setFieldValue(final Object target, final String fieldName, fi field.setAccessible(true); field.set(target, fieldValue); } - + /** * Get field value use reflection. * diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index ea5f73588d..932d59c8d2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -17,16 +17,16 @@ --> + 4.0.0 - elasticjob-registry-center org.apache.shardingsphere.elasticjob + elasticjob-registry-center 3.1.0-SNAPSHOT - 4.0.0 elasticjob-regitry-center-provider - ${project.artifactId} pom - + ${project.artifactId} + elasticjob-registry-center-zookeeper-curator diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index 11272ee7a3..953f4f0c7b 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -24,12 +24,12 @@ 3.1.0-SNAPSHOT elasticjob-registry-center - ${project.artifactId} pom - + ${project.artifactId} + elasticjob-registry-center-api elasticjob-regitry-center-provider - + diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index 61705269dd..d1a49c7101 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -17,16 +17,16 @@ --> + 4.0.0 - elasticjob-infra org.apache.shardingsphere.elasticjob + elasticjob-infra 3.1.0-SNAPSHOT - 4.0.0 - + elasticjob-restful ${project.artifactId} - + org.apache.shardingsphere.elasticjob diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java index 63b3b56575..5b5df09b7f 100644 --- a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java +++ b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java @@ -37,6 +37,7 @@ public final class RequestBodyDeserializerFactory { private static final Map DEFAULT_REQUEST_BODY_DESERIALIZER_FACTORIES = new ConcurrentHashMap<>(); private static final RequestBodyDeserializer MISSING_DESERIALIZER = new RequestBodyDeserializer() { + @Override public String mimeType() { throw new UnsupportedOperationException(); diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java index d0459dbe85..a0a93aa1a9 100644 --- a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java +++ b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java @@ -29,15 +29,13 @@ import org.apache.shardingsphere.elasticjob.restful.handler.HandleContext; import org.apache.shardingsphere.elasticjob.restful.handler.Handler; - /** * Create an instance of {@link FullHttpResponse} and initialize {@link HandleContext}. */ -@Slf4j @Sharable +@Slf4j public final class ContextInitializationInboundHandler extends ChannelInboundHandlerAdapter { - @SuppressWarnings("NullableProblems") @Override public void channelRead(final ChannelHandlerContext ctx, final Object msg) { log.debug("{}", msg); diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java index 1387480195..33e221912c 100644 --- a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java +++ b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java @@ -37,6 +37,7 @@ public final class ResponseBodySerializerFactory { private static final Map RESPONSE_BODY_SERIALIZER_FACTORIES = new ConcurrentHashMap<>(); private static final ResponseBodySerializer MISSING_SERIALIZER = new ResponseBodySerializer() { + @Override public String mimeType() { throw new UnsupportedOperationException(); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java index 9c79763559..0376b03458 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java @@ -33,7 +33,6 @@ public void assertGetJsonDefaultDeserializer() { @Test public void assertDeserializerNotFound() { - assertThrows(RequestBodyDeserializerNotFoundException.class, () -> - RequestBodyDeserializerFactory.getRequestBodyDeserializer("Unknown")); + assertThrows(RequestBodyDeserializerNotFoundException.class, () -> RequestBodyDeserializerFactory.getRequestBodyDeserializer("Unknown")); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java index 94b56c67f8..7af51ce1ad 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java @@ -93,16 +93,15 @@ public static class DecoderTestController implements RestfulController { */ @Mapping(method = Http.GET, path = "/{appName}/{ch}") public String handle( - final @Param(source = ParamSource.PATH, name = "appName") String appName, - final @Param(source = ParamSource.PATH, name = "ch") char ch, - final @Param(source = ParamSource.QUERY, name = "cron") String cron, - final @Param(source = ParamSource.HEADER, name = "Message") String message, - final @RequestBody String body, - final @Param(source = ParamSource.QUERY, name = "integer") int integer, - final @Param(source = ParamSource.QUERY, name = "bool") Boolean bool, - final @Param(source = ParamSource.QUERY, name = "long") Long longValue, - final @Param(source = ParamSource.QUERY, name = "double") double doubleValue - ) { + final @Param(source = ParamSource.PATH, name = "appName") String appName, + final @Param(source = ParamSource.PATH, name = "ch") char ch, + final @Param(source = ParamSource.QUERY, name = "cron") String cron, + final @Param(source = ParamSource.HEADER, name = "Message") String message, + final @RequestBody String body, + final @Param(source = ParamSource.QUERY, name = "integer") int integer, + final @Param(source = ParamSource.QUERY, name = "bool") Boolean bool, + final @Param(source = ParamSource.QUERY, name = "long") Long longValue, + final @Param(source = ParamSource.QUERY, name = "double") double doubleValue) { assertThat(appName, is("myApp")); assertThat(ch, is('C')); assertThat(cron, is("0 * * * * ?")); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java index 7c5bfa0b75..2c2296d138 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java @@ -58,14 +58,16 @@ public static void request(final String host, final int port, final FullHttpRequ .channel(NioSocketChannel.class) .remoteAddress(host, port) .handler(new ChannelInitializer() { + @Override protected void initChannel(final Channel ch) { ch.pipeline() .addLast(new HttpClientCodec()) .addLast(new HttpObjectAggregator(1024 * 1024)) .addLast(new SimpleChannelInboundHandler() { + @Override - protected void channelRead0(final ChannelHandlerContext ctx, final FullHttpResponse httpResponse) throws Exception { + protected void channelRead0(final ChannelHandlerContext ctx, final FullHttpResponse httpResponse) { try { consumer.accept(httpResponse); } finally { diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java index 860637ef04..b32934535b 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java @@ -33,7 +33,6 @@ public void assertGetJsonDefaultSerializer() { @Test public void assertSerializerNotFound() { - assertThrows(ResponseBodySerializerNotFoundException.class, () -> - ResponseBodySerializerFactory.getResponseBodySerializer("Unknown")); + assertThrows(ResponseBodySerializerNotFoundException.class, () -> ResponseBodySerializerFactory.getResponseBodySerializer("Unknown")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 8de1f04b5f..dc30809ede 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -1,3 +1,4 @@ + 3.2.1 3.1.1 @@ -102,6 +102,7 @@ 0.15 + 2.22.1 3.1.0 3.0.2 3.20.0 @@ -285,7 +286,7 @@ ${lombok.version} provided - + com.h2database h2 @@ -359,7 +360,7 @@ - + org.junit.jupiter @@ -395,13 +396,13 @@ org.apache.maven.plugins maven-compiler-plugin + ${maven-compiler-plugin.version} ${java.version} ${java.version} ${java.version} ${java.version} - ${maven-compiler-plugin.version} org.apache.maven.plugins @@ -496,14 +497,6 @@ net.nicoulaj.maven.plugins checksum-maven-plugin ${checksum-maven-plugin.version} - - - package - - artifacts - - - true @@ -518,6 +511,14 @@ + + + + artifacts + + package + + @@ -528,16 +529,23 @@ attach-sources - verify jar-no-fork + verify org.apache.maven.plugins maven-javadoc-plugin + + true + ${java.version} + ${project.build.sourceEncoding} + ${project.build.sourceEncoding} + ${project.build.sourceEncoding} + attach-javadocs @@ -546,13 +554,6 @@ - - true - ${java.version} - ${project.build.sourceEncoding} - ${project.build.sourceEncoding} - ${project.build.sourceEncoding} - org.apache.maven.plugins @@ -578,21 +579,61 @@ + + com.diffplug.spotless + spotless-maven-plugin + ${spotless-maven-plugin.version} + + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/java.xml + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/copyright.txt + + + + + UTF-8 + 4 + true + true + false + true + false + false + custom_1 + false + false + + + Leading blank line + --> +<project + --> + +<project + + + + org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} - src/main/resources/checkstyle_ci.xml + src/resources/checkstyle_ci.xml true validate - validate check + validate @@ -643,10 +684,10 @@ report - test report + test @@ -710,37 +751,16 @@ - verify check + verify - - - jdk11+ - - [11,) - - - - - - maven-surefire-plugin - - @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED - - - - - - - - @@ -758,10 +778,10 @@ aggregate - false aggregate + false @@ -779,7 +799,7 @@ maven-checkstyle-plugin ${maven-checkstyle-plugin.version} - src/main/resources/checkstyle.xml + src/resources/checkstyle.xml true @@ -819,20 +839,41 @@ - - scm:git:https://github.com/apache/shardingsphere-elasticjob.git - scm:git:https://github.com/apache/shardingsphere-elasticjob.git - https://github.com/apache/shardingsphere-elasticjob.git - HEAD - - ShardingSphere Developer List - dev@shardingsphere.apache.org dev-subscribe@shardingsphere.apache.org dev-unsubscribe@shardingsphere.apache.org + dev@shardingsphere.apache.org - + + + scm:git:https://github.com/apache/shardingsphere-elasticjob.git + scm:git:https://github.com/apache/shardingsphere-elasticjob.git + https://github.com/apache/shardingsphere-elasticjob.git + HEAD + + + + + jdk11+ + + [11,) + + + + + + maven-surefire-plugin + + @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED + + + + + + + + diff --git a/src/main/resources/checkstyle.xml b/src/resources/checkstyle.xml similarity index 100% rename from src/main/resources/checkstyle.xml rename to src/resources/checkstyle.xml diff --git a/src/main/resources/checkstyle_ci.xml b/src/resources/checkstyle_ci.xml similarity index 100% rename from src/main/resources/checkstyle_ci.xml rename to src/resources/checkstyle_ci.xml diff --git a/src/resources/spotless/copyright.txt b/src/resources/spotless/copyright.txt new file mode 100644 index 0000000000..6a9c064171 --- /dev/null +++ b/src/resources/spotless/copyright.txt @@ -0,0 +1,17 @@ +/* + * 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. + */ + diff --git a/src/resources/spotless/java.xml b/src/resources/spotless/java.xml new file mode 100644 index 0000000000..b552ef9e08 --- /dev/null +++ b/src/resources/spotless/java.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2334d082fed18858b707aae6498e84e747b03cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Fri, 13 Oct 2023 20:28:11 +0800 Subject: [PATCH 038/178] Refactor : refactor the release note --- RELEASE-NOTES.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 7af6a918c3..88b720f403 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,18 @@ +## 3.0.4 + +## Dependencies Upgrade +1. Update dependencies to avoid CVE + +## Enhancements +1. Support for building with OpenJDK 21 +2. Accelerate the startup speed of ElasticJob +3. Migrate from Junit Vintage to Junit Jupiter + +### Change Logs + +1. [MILESTONE 3.0.4](https://github.com/apache/shardingsphere-elasticjob/milestone/9) + + ## 3.0.3 ### Bug Fixes From 8cec60f6912c6ef53f78840215265a1380cb3744 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 14 Oct 2023 01:29:12 +0800 Subject: [PATCH 039/178] Fix checkstyle (#2279) --- .../ElasticJobConfigurationTest.java | 4 +- .../annotation/job/impl/SimpleTestJob.java | 2 +- .../elasticjob/api/JobConfigurationTest.java | 8 +- .../pojo/CloudJobConfigurationPOJOTest.java | 14 +- .../rdb/StatisticRdbRepositoryTest.java | 48 +- .../executor/facade/CloudJobFacadeTest.java | 30 +- .../executor/local/LocalTaskExecutorTest.java | 10 +- .../prod/DaemonTaskSchedulerTest.java | 12 +- .../cloud/executor/prod/TaskExecutorTest.java | 24 +- .../executor/prod/TaskExecutorThreadTest.java | 6 +- .../console/AbstractCloudControllerTest.java | 6 +- .../controller/CloudAppControllerTest.java | 24 +- .../controller/CloudJobControllerTest.java | 56 +-- .../console/controller/CloudLoginTest.java | 8 +- .../CloudOperationControllerTest.java | 10 +- .../search/JobEventRdbSearchTest.java | 8 +- .../CloudAppConfigurationListenerTest.java | 14 +- .../app/CloudAppConfigurationNodeTest.java | 4 +- .../app/CloudAppConfigurationServiceTest.java | 16 +- .../pojo/CloudAppConfigurationPOJOTest.java | 6 +- .../CloudJobConfigurationListenerTest.java | 26 +- .../job/CloudJobConfigurationNodeTest.java | 4 +- .../job/CloudJobConfigurationServiceTest.java | 18 +- .../scheduler/context/JobContextTest.java | 4 +- .../env/BootstrapEnvironmentTest.java | 22 +- .../scheduler/ha/FrameworkIDServiceTest.java | 8 +- .../mesos/AppConstraintEvaluatorTest.java | 22 +- .../scheduler/mesos/FacadeServiceTest.java | 62 +-- .../scheduler/mesos/JobTaskRequestTest.java | 28 +- .../scheduler/mesos/LaunchingTasksTest.java | 6 +- .../scheduler/mesos/LeasesQueueTest.java | 4 +- .../mesos/MesosStateServiceTest.java | 8 +- .../scheduler/mesos/ReconcileServiceTest.java | 10 +- .../scheduler/mesos/SchedulerEngineTest.java | 48 +- .../scheduler/mesos/SchedulerServiceTest.java | 12 +- .../mesos/SupportedExtractionTypeTest.java | 4 +- .../scheduler/mesos/TaskInfoDataTest.java | 8 +- .../mesos/TaskLaunchScheduledServiceTest.java | 14 +- .../scheduler/producer/ProducerJobTest.java | 6 +- .../producer/ProducerManagerTest.java | 26 +- .../TransientProducerRepositoryTest.java | 12 +- .../TransientProducerSchedulerTest.java | 10 +- .../app/CloudAppDisableListenerTest.java | 20 +- .../state/disable/app/DisableAppNodeTest.java | 4 +- .../disable/app/DisableAppServiceTest.java | 12 +- .../job/CloudJobDisableListenerTest.java | 20 +- .../state/disable/job/DisableJobNodeTest.java | 4 +- .../disable/job/DisableJobServiceTest.java | 12 +- .../state/failover/FailoverNodeTest.java | 6 +- .../state/failover/FailoverServiceTest.java | 28 +- .../scheduler/state/ready/ReadyNodeTest.java | 4 +- .../state/ready/ReadyServiceTest.java | 52 +- .../state/running/RunningNodeTest.java | 6 +- .../state/running/RunningServiceTest.java | 28 +- .../statistics/StatisticManagerTest.java | 42 +- .../statistics/StatisticsSchedulerTest.java | 8 +- .../statistics/TaskResultMetaDataTest.java | 8 +- .../statistics/job/BaseStatisticJobTest.java | 10 +- .../job/JobRunningStatisticJobTest.java | 14 +- .../job/RegisteredJobStatisticJobTest.java | 14 +- .../job/TaskResultStatisticJobTest.java | 14 +- .../util/StatisticTimeUtilsTest.java | 14 +- .../cloud/scheduler/util/IOUtilsTest.java | 11 +- ...obErrorHandlerPropertiesValidatorTest.java | 10 +- .../dingtalk/DingtalkJobErrorHandlerTest.java | 18 +- ...obErrorHandlerPropertiesValidatorTest.java | 10 +- .../email/EmailJobErrorHandlerTest.java | 10 +- .../handler/JobErrorHandlerFactoryTest.java | 8 +- .../JobErrorHandlerReloadableTest.java | 10 +- .../general/IgnoreJobErrorHandlerTest.java | 4 +- .../general/LogJobErrorHandlerTest.java | 8 +- .../general/ThrowJobErrorHandlerTest.java | 8 +- ...obErrorHandlerPropertiesValidatorTest.java | 10 +- .../wechat/WechatJobErrorHandlerTest.java | 16 +- .../executor/ElasticJobExecutorTest.java | 28 +- .../item/JobItemExecutorFactoryTest.java | 12 +- .../executor/DataflowJobExecutorTest.java | 10 +- .../http/executor/HttpJobExecutorTest.java | 24 +- .../script/ScriptJobExecutorTest.java | 12 +- .../executor/SimpleJobExecutorTest.java | 8 +- .../tracing/JobTracingEventBusTest.java | 8 +- .../tracing/event/JobExecutionEventTest.java | 8 +- .../listener/TracingListenerFactoryTest.java | 8 +- .../TracingStorageConverterFactoryTest.java | 6 +- ...YamlTracingConfigurationConverterTest.java | 4 +- .../DataSourceConfigurationTest.java | 18 +- .../datasource/DataSourceRegistryTest.java | 6 +- ...DataSourceTracingStorageConverterTest.java | 8 +- .../RDBTracingListenerConfigurationTest.java | 6 +- .../rdb/listener/RDBTracingListenerTest.java | 8 +- .../rdb/storage/RDBJobEventStorageTest.java | 26 +- ...lDataSourceConfigurationConverterTest.java | 4 +- .../ElasticJobExecutorServiceTest.java | 4 +- .../ExecutorServiceReloadableTest.java | 10 +- .../context/ShardingItemParametersTest.java | 10 +- .../infra/context/TaskContextTest.java | 28 +- .../infra/env/HostExceptionTest.java | 4 +- .../elasticjob/infra/env/IpUtilsTest.java | 12 +- .../elasticjob/infra/env/TimeServiceTest.java | 4 +- .../infra/exception/ExceptionUtilsTest.java | 8 +- .../JobConfigurationExceptionTest.java | 6 +- .../JobExecutionEnvironmentExceptionTest.java | 4 +- .../exception/JobStatisticExceptionTest.java | 4 +- .../exception/JobSystemExceptionTest.java | 8 +- .../handler/sharding/JobInstanceTest.java | 8 +- .../JobShardingStrategyFactoryTest.java | 8 +- ...rageAllocationJobShardingStrategyTest.java | 14 +- ...vitySortByNameJobShardingStrategyTest.java | 6 +- ...teServerByNameJobShardingStrategyTest.java | 8 +- .../JobExecutorServiceHandlerFactoryTest.java | 8 +- ...CPUUsageJobExecutorServiceHandlerTest.java | 4 +- ...leThreadJobExecutorServiceHandlerTest.java | 4 +- .../infra/json/GsonFactoryTest.java | 12 +- .../ElasticJobListenerFactoryTest.java | 6 +- .../infra/listener/ShardingContextsTest.java | 4 +- .../infra/pojo/JobConfigurationPOJOTest.java | 14 +- .../spi/ElasticJobServiceLoaderTest.java | 16 +- .../JobPropertiesValidateRuleTest.java | 14 +- .../elasticjob/infra/yaml/YamlEngineTest.java | 10 +- ...YamlConfigurationConverterFactoryTest.java | 5 +- .../ConnectionStateChangedEventListener.java | 2 +- .../transaction/TransactionOperationTest.java | 10 +- .../exception/RegExceptionHandlerTest.java | 8 +- .../zookeeper/ZookeeperConfigurationTest.java | 4 +- .../ZookeeperElectionServiceTest.java | 6 +- ...eperRegistryCenterExecuteInLeaderTest.java | 8 +- .../ZookeeperRegistryCenterForAuthTest.java | 10 +- ...ookeeperRegistryCenterInitFailureTest.java | 4 +- .../ZookeeperRegistryCenterListenerTest.java | 24 +- ...keeperRegistryCenterMiscellaneousTest.java | 12 +- .../ZookeeperRegistryCenterModifyTest.java | 18 +- ...eeperRegistryCenterQueryWithCacheTest.java | 10 +- ...erRegistryCenterQueryWithoutCacheTest.java | 18 +- ...ookeeperRegistryCenterTransactionTest.java | 10 +- .../ZookeeperRegistryCenterWatchTest.java | 10 +- ...erCuratorIgnoredExceptionProviderTest.java | 4 +- .../util/ZookeeperRegistryCenterTestUtil.java | 2 +- .../restful/annotation/ParamSource.java | 2 +- .../restful/RegexPathMatcherTest.java | 10 +- .../restful/RegexUrlPatternMapTest.java | 8 +- .../RequestBodyDeserializerFactoryTest.java | 6 +- .../filter/DefaultFilterChainTest.java | 18 +- .../FilterChainInboundHandlerTest.java | 8 +- .../pipeline/HandlerParameterDecoderTest.java | 6 +- .../pipeline/HttpRequestDispatcherTest.java | 4 +- .../pipeline/NettyRestfulServiceTest.java | 36 +- ...ulServiceTrailingSlashInsensitiveTest.java | 4 +- ...tfulServiceTrailingSlashSensitiveTest.java | 10 +- .../ResponseBodySerializerFactoryTest.java | 6 +- .../wrapper/QueryParameterMapTest.java | 8 +- .../internal/reconcile/ReconcileService.java | 2 +- .../impl/OneOffJobBootstrapTest.java | 14 +- .../DistributeOnceElasticJobListenerTest.java | 16 +- .../api/registry/JobInstanceRegistryTest.java | 22 +- .../lite/integrate/BaseIntegrateTest.java | 6 +- .../OneOffDisabledJobIntegrateTest.java | 6 +- .../ScheduleDisabledJobIntegrateTest.java | 6 +- .../enable/EnabledJobIntegrateTest.java | 2 +- .../enable/OneOffEnabledJobIntegrateTest.java | 6 +- .../ScheduleEnabledJobIntegrateTest.java | 6 +- .../annotation/JobAnnotationBuilderTest.java | 4 +- .../integrate/BaseAnnotationTest.java | 6 +- .../integrate/OneOffEnabledJobTest.java | 8 +- .../integrate/ScheduleEnabledJobTest.java | 8 +- .../config/ConfigurationNodeTest.java | 4 +- .../config/ConfigurationServiceTest.java | 24 +- .../config/RescheduleListenerManagerTest.java | 14 +- .../election/ElectionListenerManagerTest.java | 26 +- .../internal/election/LeaderNodeTest.java | 6 +- .../internal/election/LeaderServiceTest.java | 24 +- .../failover/FailoverListenerManagerTest.java | 30 +- .../internal/failover/FailoverNodeTest.java | 12 +- .../failover/FailoverServiceTest.java | 40 +- .../GuaranteeListenerManagerTest.java | 18 +- .../internal/guarantee/GuaranteeNodeTest.java | 14 +- .../guarantee/GuaranteeServiceTest.java | 40 +- .../internal/instance/InstanceNodeTest.java | 18 +- .../instance/InstanceServiceTest.java | 16 +- .../instance/ShutdownListenerManagerTest.java | 20 +- .../listener/ListenerManagerTest.java | 6 +- .../listener/ListenerNotifierManagerTest.java | 6 +- ...stryCenterConnectionStateListenerTest.java | 14 +- .../reconcile/ReconcileServiceTest.java | 8 +- .../internal/schedule/JobRegistryTest.java | 24 +- .../schedule/JobScheduleControllerTest.java | 54 +- .../schedule/JobTriggerListenerTest.java | 10 +- .../internal/schedule/LiteJobFacadeTest.java | 38 +- .../schedule/SchedulerFacadeTest.java | 8 +- .../lite/internal/server/ServerNodeTest.java | 14 +- .../internal/server/ServerServiceTest.java | 26 +- .../DefaultJobClassNameProviderTest.java | 6 +- .../JobClassNameProviderFactoryTest.java | 4 +- .../lite/internal/setup/SetUpFacadeTest.java | 8 +- .../sharding/ExecutionContextServiceTest.java | 10 +- .../sharding/ExecutionServiceTest.java | 44 +- .../MonitorExecutionListenerManagerTest.java | 12 +- .../sharding/ShardingListenerManagerTest.java | 26 +- .../internal/sharding/ShardingNodeTest.java | 10 +- .../sharding/ShardingServiceTest.java | 38 +- .../snapshot/BaseSnapshotServiceTest.java | 6 +- .../snapshot/SnapshotServiceDisableTest.java | 10 +- .../snapshot/SnapshotServiceEnableTest.java | 14 +- .../internal/storage/JobNodePathTest.java | 14 +- .../internal/storage/JobNodeStorageTest.java | 40 +- .../trigger/TriggerListenerManagerTest.java | 16 +- .../internal/util/SensitiveInfoUtilsTest.java | 6 +- .../AbstractEmbedZookeeperBaseTest.java | 2 +- .../lite/lifecycle/api/JobAPIFactoryTest.java | 14 +- .../lifecycle/domain/ShardingStatusTest.java | 10 +- .../operate/JobOperateAPIImplTest.java | 30 +- .../operate/ShardingOperateAPIImplTest.java | 8 +- .../reg/RegistryCenterFactoryTest.java | 8 +- .../settings/JobConfigurationAPIImplTest.java | 20 +- .../statistics/JobStatisticsAPIImplTest.java | 22 +- .../ServerStatisticsAPIImplTest.java | 8 +- .../ShardingStatisticsAPIImplTest.java | 6 +- ...ElasticJobConfigurationPropertiesTest.java | 13 +- .../job/ElasticJobSpringBootScannerTest.java | 6 +- .../boot/job/ElasticJobSpringBootTest.java | 22 +- .../boot/reg/ZookeeperPropertiesTest.java | 10 +- ...icJobSnapshotServiceConfigurationTest.java | 6 +- .../tracing/TracingConfigurationTest.java | 6 +- .../JobClassNameProviderFactoryTest.java | 10 +- .../spring/core/util/AopTargetUtilsTest.java | 8 +- .../lite/spring/core/util/TargetJob.java | 1 - .../job/AbstractJobSpringIntegrateTest.java | 6 +- .../AbstractOneOffJobSpringIntegrateTest.java | 6 +- ...bSpringNamespaceWithEventTraceRdbTest.java | 4 +- .../JobSpringNamespaceWithJobHandlerTest.java | 4 +- ...ringNamespaceWithListenerAndCglibTest.java | 4 +- ...aceWithListenerAndJdkDynamicProxyTest.java | 4 +- .../JobSpringNamespaceWithListenerTest.java | 4 +- .../job/JobSpringNamespaceWithRefTest.java | 8 +- .../job/JobSpringNamespaceWithTypeTest.java | 6 +- ...JobSpringNamespaceWithoutListenerTest.java | 4 +- ...bSpringNamespaceWithEventTraceRdbTest.java | 4 +- ...fJobSpringNamespaceWithJobHandlerTest.java | 4 +- ...ringNamespaceWithListenerAndCglibTest.java | 4 +- ...aceWithListenerAndJdkDynamicProxyTest.java | 4 +- ...OffJobSpringNamespaceWithListenerTest.java | 4 +- .../OneOffJobSpringNamespaceWithRefTest.java | 8 +- .../OneOffJobSpringNamespaceWithTypeTest.java | 6 +- ...JobSpringNamespaceWithoutListenerTest.java | 4 +- .../AbstractJobSpringIntegrateTest.java | 7 +- .../SnapshotSpringNamespaceDisableTest.java | 4 +- .../SnapshotSpringNamespaceEnableTest.java | 4 +- ...okeeperJUnitJupiterSpringContextTests.java | 4 +- pom.xml | 4 +- src/resources/checkstyle.xml | 463 ++++++++++-------- src/resources/checkstyle_ci.xml | 238 --------- 250 files changed, 1779 insertions(+), 1981 deletions(-) delete mode 100644 src/resources/checkstyle_ci.xml diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java index 8c4692ee22..fad66da5f7 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java @@ -29,10 +29,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertArrayEquals; -public final class ElasticJobConfigurationTest { +class ElasticJobConfigurationTest { @Test - public void assertAnnotationJob() { + void assertAnnotationJob() { ElasticJobConfiguration annotation = SimpleTestJob.class.getAnnotation(ElasticJobConfiguration.class); assertThat(annotation.jobName(), is("SimpleTestJob")); assertThat(annotation.cron(), is("0/5 * * * * ?")); diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java index 3a9c01dcaa..af2b4dda9f 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java @@ -29,7 +29,7 @@ shardingTotalCount = 3, shardingItemParameters = "0=Beijing,1=Shanghai,2=Guangzhou", jobListenerTypes = {"NOOP", "LOG"}, - extraConfigurations = {SimpleTracingConfigurationFactory.class}, + extraConfigurations = SimpleTracingConfigurationFactory.class, props = { @ElasticJobProp(key = "print.title", value = "test title"), @ElasticJobProp(key = "print.content", value = "test content") diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java index 1e7412c21c..6fda7ad19f 100644 --- a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java +++ b/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java @@ -26,10 +26,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class JobConfigurationTest { +class JobConfigurationTest { @Test - public void assertBuildAllProperties() { + void assertBuildAllProperties() { JobConfiguration actual = JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?") .timeZone("GMT+8") @@ -83,12 +83,12 @@ public void assertBuildRequiredProperties() { } @Test - public void assertBuildWithEmptyJobName() { + void assertBuildWithEmptyJobName() { assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("", 3).cron("0/1 * * * * ?").build()); } @Test - public void assertBuildWithInvalidShardingTotalCount() { + void assertBuildWithInvalidShardingTotalCount() { assertThrows(IllegalArgumentException.class, () -> JobConfiguration.newBuilder("test_job", -1).cron("0/1 * * * * ?").build()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java index 7921eff7a4..17ace6fca6 100644 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java @@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class CloudJobConfigurationPOJOTest { +class CloudJobConfigurationPOJOTest { private static final String YAML = "appName: app\n" + "cpuCount: 1.0\n" @@ -69,7 +69,7 @@ public final class CloudJobConfigurationPOJOTest { + "shardingTotalCount: 3\n"; @Test - public void assertToJobConfiguration() { + void assertToJobConfiguration() { CloudJobConfigurationPOJO pojo = new CloudJobConfigurationPOJO(); pojo.setAppName("app"); pojo.setCpuCount(1d); @@ -113,7 +113,7 @@ public void assertToJobConfiguration() { } @Test - public void assertFromJobConfiguration() { + void assertFromJobConfiguration() { JobConfiguration jobConfig = JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?") .shardingItemParameters("0=A,1=B,2=C").jobParameter("param") @@ -145,7 +145,7 @@ public void assertFromJobConfiguration() { } @Test - public void assertMarshal() { + void assertMarshal() { CloudJobConfigurationPOJO actual = new CloudJobConfigurationPOJO(); actual.setAppName("app"); actual.setCpuCount(1d); @@ -165,7 +165,7 @@ public void assertMarshal() { } @Test - public void assertMarshalWithNullValue() { + void assertMarshalWithNullValue() { CloudJobConfigurationPOJO actual = new CloudJobConfigurationPOJO(); actual.setAppName("app"); actual.setCpuCount(1d); @@ -177,7 +177,7 @@ public void assertMarshalWithNullValue() { } @Test - public void assertUnmarshal() { + void assertUnmarshal() { CloudJobConfigurationPOJO actual = YamlEngine.unmarshal(YAML, CloudJobConfigurationPOJO.class); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); @@ -195,7 +195,7 @@ public void assertUnmarshal() { } @Test - public void assertUnmarshalWithNullValue() { + void assertUnmarshalWithNullValue() { CloudJobConfigurationPOJO actual = YamlEngine.unmarshal(YAML_WITH_NULL, CloudJobConfigurationPOJO.class); assertThat(actual.getAppName(), is("app")); assertThat(actual.getCpuCount(), is(1d)); diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java index e18977d85c..6a03ce09cc 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java +++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java @@ -35,12 +35,12 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public class StatisticRdbRepositoryTest { +class StatisticRdbRepositoryTest { private StatisticRdbRepository repository; @BeforeEach - public void setup() throws SQLException { + void setup() throws SQLException { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); dataSource.setUrl("jdbc:h2:mem:"); @@ -50,36 +50,36 @@ public void setup() throws SQLException { } @Test - public void assertAddTaskResultStatistics() { + void assertAddTaskResultStatistics() { for (StatisticInterval each : StatisticInterval.values()) { assertTrue(repository.add(new TaskResultStatistics(100, 0, each, new Date()))); } } @Test - public void assertAddTaskRunningStatistics() { + void assertAddTaskRunningStatistics() { assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); } @Test - public void assertAddJobRunningStatistics() { + void assertAddJobRunningStatistics() { assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); } @Test - public void assertAddJobRegisterStatistics() { + void assertAddJobRegisterStatistics() { assertTrue(repository.add(new JobRegisterStatistics(100, new Date()))); } @Test - public void assertFindTaskResultStatisticsWhenTableIsEmpty() { + void assertFindTaskResultStatisticsWhenTableIsEmpty() { assertThat(repository.findTaskResultStatistics(new Date(), StatisticInterval.MINUTE).size(), is(0)); assertThat(repository.findTaskResultStatistics(new Date(), StatisticInterval.HOUR).size(), is(0)); assertThat(repository.findTaskResultStatistics(new Date(), StatisticInterval.DAY).size(), is(0)); } @Test - public void assertFindTaskResultStatisticsWithDifferentFromDate() { + void assertFindTaskResultStatisticsWithDifferentFromDate() { Date now = new Date(); Date yesterday = getYesterday(); for (StatisticInterval each : StatisticInterval.values()) { @@ -91,7 +91,7 @@ public void assertFindTaskResultStatisticsWithDifferentFromDate() { } @Test - public void assertGetSummedTaskResultStatisticsWhenTableIsEmpty() { + void assertGetSummedTaskResultStatisticsWhenTableIsEmpty() { for (StatisticInterval each : StatisticInterval.values()) { TaskResultStatistics po = repository.getSummedTaskResultStatistics(new Date(), each); assertThat(po.getSuccessCount(), is(0)); @@ -100,7 +100,7 @@ public void assertGetSummedTaskResultStatisticsWhenTableIsEmpty() { } @Test - public void assertGetSummedTaskResultStatistics() { + void assertGetSummedTaskResultStatistics() { for (StatisticInterval each : StatisticInterval.values()) { Date date = new Date(); repository.add(new TaskResultStatistics(100, 2, each, date)); @@ -112,14 +112,14 @@ public void assertGetSummedTaskResultStatistics() { } @Test - public void assertFindLatestTaskResultStatisticsWhenTableIsEmpty() { + void assertFindLatestTaskResultStatisticsWhenTableIsEmpty() { for (StatisticInterval each : StatisticInterval.values()) { assertFalse(repository.findLatestTaskResultStatistics(each).isPresent()); } } @Test - public void assertFindLatestTaskResultStatistics() { + void assertFindLatestTaskResultStatistics() { for (StatisticInterval each : StatisticInterval.values()) { repository.add(new TaskResultStatistics(100, 2, each, new Date())); repository.add(new TaskResultStatistics(200, 5, each, new Date())); @@ -131,12 +131,12 @@ public void assertFindLatestTaskResultStatistics() { } @Test - public void assertFindTaskRunningStatisticsWhenTableIsEmpty() { + void assertFindTaskRunningStatisticsWhenTableIsEmpty() { assertThat(repository.findTaskRunningStatistics(new Date()).size(), is(0)); } @Test - public void assertFindTaskRunningStatisticsWithDifferentFromDate() { + void assertFindTaskRunningStatisticsWithDifferentFromDate() { Date now = new Date(); Date yesterday = getYesterday(); assertTrue(repository.add(new TaskRunningStatistics(100, yesterday))); @@ -146,12 +146,12 @@ public void assertFindTaskRunningStatisticsWithDifferentFromDate() { } @Test - public void assertFindLatestTaskRunningStatisticsWhenTableIsEmpty() { + void assertFindLatestTaskRunningStatisticsWhenTableIsEmpty() { assertFalse(repository.findLatestTaskRunningStatistics().isPresent()); } @Test - public void assertFindLatestTaskRunningStatistics() { + void assertFindLatestTaskRunningStatistics() { repository.add(new TaskRunningStatistics(100, new Date())); repository.add(new TaskRunningStatistics(200, new Date())); Optional po = repository.findLatestTaskRunningStatistics(); @@ -160,12 +160,12 @@ public void assertFindLatestTaskRunningStatistics() { } @Test - public void assertFindJobRunningStatisticsWhenTableIsEmpty() { + void assertFindJobRunningStatisticsWhenTableIsEmpty() { assertThat(repository.findJobRunningStatistics(new Date()).size(), is(0)); } @Test - public void assertFindJobRunningStatisticsWithDifferentFromDate() { + void assertFindJobRunningStatisticsWithDifferentFromDate() { Date now = new Date(); Date yesterday = getYesterday(); assertTrue(repository.add(new JobRunningStatistics(100, yesterday))); @@ -175,12 +175,12 @@ public void assertFindJobRunningStatisticsWithDifferentFromDate() { } @Test - public void assertFindLatestJobRunningStatisticsWhenTableIsEmpty() { + void assertFindLatestJobRunningStatisticsWhenTableIsEmpty() { assertFalse(repository.findLatestJobRunningStatistics().isPresent()); } @Test - public void assertFindLatestJobRunningStatistics() { + void assertFindLatestJobRunningStatistics() { repository.add(new JobRunningStatistics(100, new Date())); repository.add(new JobRunningStatistics(200, new Date())); Optional po = repository.findLatestJobRunningStatistics(); @@ -189,12 +189,12 @@ public void assertFindLatestJobRunningStatistics() { } @Test - public void assertFindJobRegisterStatisticsWhenTableIsEmpty() { + void assertFindJobRegisterStatisticsWhenTableIsEmpty() { assertThat(repository.findJobRegisterStatistics(new Date()).size(), is(0)); } @Test - public void assertFindJobRegisterStatisticsWithDifferentFromDate() { + void assertFindJobRegisterStatisticsWithDifferentFromDate() { Date now = new Date(); Date yesterday = getYesterday(); assertTrue(repository.add(new JobRegisterStatistics(100, yesterday))); @@ -204,12 +204,12 @@ public void assertFindJobRegisterStatisticsWithDifferentFromDate() { } @Test - public void assertFindLatestJobRegisterStatisticsWhenTableIsEmpty() { + void assertFindLatestJobRegisterStatisticsWhenTableIsEmpty() { assertFalse(repository.findLatestJobRegisterStatistics().isPresent()); } @Test - public void assertFindLatestJobRegisterStatistics() { + void assertFindLatestJobRegisterStatistics() { repository.add(new JobRegisterStatistics(100, new Date())); repository.add(new JobRegisterStatistics(200, new Date())); Optional po = repository.findLatestJobRegisterStatistics(); diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java index 2fd7214f47..6a7a3c1a0e 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java @@ -42,7 +42,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class CloudJobFacadeTest { +class CloudJobFacadeTest { private ShardingContexts shardingContexts; @@ -52,7 +52,7 @@ public final class CloudJobFacadeTest { private JobFacade jobFacade; @BeforeEach - public void setUp() { + void setUp() { shardingContexts = getShardingContexts(); jobFacade = new CloudJobFacade(shardingContexts, getJobConfiguration(), jobTracingEventBus); } @@ -68,69 +68,69 @@ private JobConfiguration getJobConfiguration() { } @Test - public void assertCheckJobExecutionEnvironment() throws JobExecutionEnvironmentException { + void assertCheckJobExecutionEnvironment() throws JobExecutionEnvironmentException { jobFacade.checkJobExecutionEnvironment(); } @Test - public void assertFailoverIfNecessary() { + void assertFailoverIfNecessary() { jobFacade.failoverIfNecessary(); } @Test - public void assertRegisterJobBegin() { + void assertRegisterJobBegin() { jobFacade.registerJobBegin(null); } @Test - public void assertRegisterJobCompleted() { + void assertRegisterJobCompleted() { jobFacade.registerJobCompleted(null); } @Test - public void assertGetShardingContext() { + void assertGetShardingContext() { assertThat(jobFacade.getShardingContexts(), is(shardingContexts)); } @Test - public void assertMisfireIfNecessary() { + void assertMisfireIfNecessary() { jobFacade.misfireIfRunning(null); } @Test - public void assertClearMisfire() { + void assertClearMisfire() { jobFacade.clearMisfire(null); } @Test - public void assertIsExecuteMisfired() { + void assertIsExecuteMisfired() { assertFalse(jobFacade.isExecuteMisfired(null)); } @Test - public void assertIsNeedSharding() { + void assertIsNeedSharding() { assertFalse(jobFacade.isNeedSharding()); } @Test - public void assertBeforeJobExecuted() { + void assertBeforeJobExecuted() { jobFacade.beforeJobExecuted(null); } @Test - public void assertAfterJobExecuted() { + void assertAfterJobExecuted() { jobFacade.afterJobExecuted(null); } @Test - public void assertPostJobExecutionEvent() { + void assertPostJobExecutionEvent() { JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); jobFacade.postJobExecutionEvent(jobExecutionEvent); verify(jobTracingEventBus).post(jobExecutionEvent); } @Test - public void assertPostJobStatusTraceEvent() { + void assertPostJobStatusTraceEvent() { jobFacade.postJobStatusTraceEvent(String.format("%s@-@0@-@%s@-@fake_slave_id@-@0", "test_job", ExecutionType.READY), State.TASK_RUNNING, "message is empty."); } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java index a2c6e5e7bf..48df5fbeb9 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java @@ -32,10 +32,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class LocalTaskExecutorTest { +class LocalTaskExecutorTest { @Test - public void assertSimpleJob() { + void assertSimpleJob() { TestSimpleJob simpleJob = new TestSimpleJob(); new LocalTaskExecutor(simpleJob, JobConfiguration.newBuilder(TestSimpleJob.class.getSimpleName(), 3) .cron("*/2 * * * * ?").shardingItemParameters("0=A,1=B").build(), 1).execute(); @@ -43,7 +43,7 @@ public void assertSimpleJob() { } @Test - public void assertDataflowJob() { + void assertDataflowJob() { TestDataflowJob dataflowJob = new TestDataflowJob(); new LocalTaskExecutor(dataflowJob, JobConfiguration.newBuilder(TestDataflowJob.class.getSimpleName(), 3) .cron("*/2 * * * * ?").setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, Boolean.FALSE.toString()).build(), 1).execute(); @@ -52,13 +52,13 @@ public void assertDataflowJob() { } @Test - public void assertScriptJob() { + void assertScriptJob() { new LocalTaskExecutor(new TestDataflowJob(), JobConfiguration.newBuilder("TestScriptJob", 3) .cron("*/2 * * * * ?").setProperty(ScriptJobProperties.SCRIPT_KEY, "echo test").build(), 1).execute(); } @Test - public void assertNotExistsJobType() { + void assertNotExistsJobType() { assertThrows(JobConfigurationException.class, () -> new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute()); } } diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java index 56658ee244..1aa0258afa 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java @@ -45,7 +45,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class DaemonTaskSchedulerTest { +class DaemonTaskSchedulerTest { @Mock private CloudJobFacade jobFacade; @@ -70,7 +70,7 @@ public final class DaemonTaskSchedulerTest { private DaemonJob daemonJob; @BeforeEach - public void setUp() { + void setUp() { daemonJob = new DaemonJob(); daemonJob.setJobFacade(jobFacade); daemonJob.setElasticJobType("SCRIPT"); @@ -79,7 +79,7 @@ public void setUp() { } @Test - public void assertJobRun() { + void assertJobRun() { when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); when(jobFacade.loadJobConfiguration(true)).thenReturn(createJobConfiguration()); daemonJob.execute(jobExecutionContext); @@ -90,7 +90,7 @@ public void assertJobRun() { } @Test - public void assertJobRunWithEventSampling() { + void assertJobRunWithEventSampling() { when(shardingContexts.getJobEventSamplingCount()).thenReturn(2); when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); when(jobFacade.loadJobConfiguration(true)).thenReturn(createJobConfiguration()); @@ -111,7 +111,7 @@ private JobConfiguration createJobConfiguration() { @Test @SneakyThrows - public void assertInit() { + void assertInit() { DaemonTaskScheduler scheduler = createScheduler(); scheduler.init(); Field field = DaemonTaskScheduler.class.getDeclaredField("RUNNING_SCHEDULERS"); @@ -122,7 +122,7 @@ public void assertInit() { @Test @SneakyThrows - public void assertShutdown() { + void assertShutdown() { DaemonTaskScheduler scheduler = createScheduler(); scheduler.init(); DaemonTaskScheduler.shutdown(taskId); diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java index 1450e0b78e..411b29eaee 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java @@ -44,7 +44,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class TaskExecutorTest { +class TaskExecutorTest { @Mock private ExecutorDriver executorDriver; @@ -61,7 +61,7 @@ public final class TaskExecutorTest { private TaskExecutor taskExecutor; @BeforeEach - public void setUp() { + void setUp() { taskExecutor = new TaskExecutor(new TestSimpleJob()); setExecutorService(); executorInfo = ExecutorInfo.getDefaultInstance(); @@ -75,14 +75,14 @@ private void setExecutorService() { } @Test - public void assertKillTask() { + void assertKillTask() { TaskID taskID = Protos.TaskID.newBuilder().setValue("task_id").build(); taskExecutor.killTask(executorDriver, taskID); verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskID).setState(Protos.TaskState.TASK_KILLED).build()); } @Test - public void assertRegisteredWithoutData() { + void assertRegisteredWithoutData() { // CHECKSTYLE:OFF HashMap data = new HashMap<>(4, 1); // CHECKSTYLE:ON @@ -96,44 +96,44 @@ public void assertRegisteredWithoutData() { } @Test - public void assertRegisteredWithData() { + void assertRegisteredWithData() { taskExecutor.registered(executorDriver, executorInfo, frameworkInfo, slaveInfo); } @Test - public void assertLaunchTask() { + void assertLaunchTask() { taskExecutor.launchTask(executorDriver, TaskInfo.newBuilder().setName("test_job") .setTaskId(TaskID.newBuilder().setValue("fake_task_id")).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); } @Test - public void assertReregistered() { + void assertReregistered() { taskExecutor.reregistered(executorDriver, slaveInfo); } @Test - public void assertDisconnected() { + void assertDisconnected() { taskExecutor.disconnected(executorDriver); } @Test - public void assertFrameworkMessage() { + void assertFrameworkMessage() { taskExecutor.frameworkMessage(executorDriver, null); } @Test - public void assertShutdown() { + void assertShutdown() { taskExecutor.shutdown(executorDriver); } @Test - public void assertError() { + void assertError() { taskExecutor.error(executorDriver, ""); } @Test @SneakyThrows - public void assertConstructor() { + void assertConstructor() { TestSimpleJob testSimpleJob = new TestSimpleJob(); taskExecutor = new TaskExecutor(testSimpleJob); Field fieldElasticJob = TaskExecutor.class.getDeclaredField("elasticJob"); diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java index ad0d521e96..ddbcf156a9 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java +++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java @@ -43,7 +43,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class TaskExecutorThreadTest { +class TaskExecutorThreadTest { @Mock private ExecutorDriver executorDriver; @@ -51,7 +51,7 @@ public final class TaskExecutorThreadTest { private final String taskId = String.format("%s@-@0@-@%s@-@fake_slave_id@-@0", "test_job", ExecutionType.READY); @Test - public void assertLaunchTaskWithDaemonTaskAndJavaSimpleJob() { + void assertLaunchTaskWithDaemonTaskAndJavaSimpleJob() { TaskInfo taskInfo = buildJavaTransientTaskInfo(); TaskThread taskThread = new TaskExecutor(new TestSimpleJob()).new TaskThread(executorDriver, taskInfo); taskThread.run(); @@ -60,7 +60,7 @@ public void assertLaunchTaskWithDaemonTaskAndJavaSimpleJob() { } @Test - public void assertLaunchTaskWithDaemonTaskAndJavaScriptJob() { + void assertLaunchTaskWithDaemonTaskAndJavaScriptJob() { TaskInfo taskInfo = buildSpringScriptTransientTaskInfo(); TaskThread taskThread = new TaskExecutor(new TestSimpleJob()).new TaskThread(executorDriver, taskInfo); taskThread.run(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java index 7215f7a570..4a8dbcf237 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java @@ -57,7 +57,7 @@ public abstract class AbstractCloudControllerTest { private static RestfulService slaveServer; @BeforeAll - public static void setUpClass() { + static void setUpClass() { initRestfulServer(); initMesosServer(); } @@ -86,7 +86,7 @@ private static void initMesosServer() { } @AfterAll - public static void tearDown() { + static void tearDown() { consoleBootstrap.stop(); masterServer.shutdown(); slaveServer.shutdown(); @@ -94,7 +94,7 @@ public static void tearDown() { } @BeforeEach - public void setUp() { + void setUp() { reset(regCenter); reset(jobEventRdbSearch); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java index 65873c4d80..3980396e6c 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java @@ -35,7 +35,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class CloudAppControllerTest extends AbstractCloudControllerTest { +class CloudAppControllerTest extends AbstractCloudControllerTest { private static final String YAML = "appCacheEnable: true\n" + "appName: test_app\n" @@ -46,14 +46,14 @@ public class CloudAppControllerTest extends AbstractCloudControllerTest { + "memoryMB: 128.0\n"; @Test - public void assertRegister() { + void assertRegister() { when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(false); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); verify(getRegCenter()).persist("/config/app/test_app", YAML); } @Test - public void assertRegisterWithExistedName() { + void assertRegisterWithExistedName() { when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(false); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); @@ -61,12 +61,12 @@ public void assertRegisterWithExistedName() { } @Test - public void assertRegisterWithBadRequest() { + void assertRegisterWithBadRequest() { assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", "\"{\"appName\":\"wrong_job\"}"), is(500)); } @Test - public void assertUpdate() { + void assertUpdate() { when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(true); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.put("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); @@ -74,21 +74,21 @@ public void assertUpdate() { } @Test - public void assertDetail() { + void assertDetail() { when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/test_app"), is(CloudAppJsonConstants.getAppJson("test_app"))); verify(getRegCenter()).get("/config/app/test_app"); } @Test - public void assertDetailWithNotExistedJob() { + void assertDetailWithNotExistedJob() { Map content = new HashMap<>(1); content.put("appName", ""); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/notExistedJobName", content), is("")); } @Test - public void assertFindAllJobs() { + void assertFindAllJobs() { when(getRegCenter().isExisted("/config/app")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/app")).thenReturn(Collections.singletonList("test_app")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); @@ -99,20 +99,20 @@ public void assertFindAllJobs() { } @Test - public void assertDeregister() { + void assertDeregister() { when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.delete("http://127.0.0.1:19000/api/app/test_app"), is(200)); verify(getRegCenter()).get("/config/app/test_app"); } @Test - public void assertIsDisabled() { + void assertIsDisabled() { when(getRegCenter().isExisted("/state/disable/app/test_app")).thenReturn(true); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/test_app/disable"), is("true")); } @Test - public void assertDisable() { + void assertDisable() { when(getRegCenter().isExisted("/config/job")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); @@ -123,7 +123,7 @@ public void assertDisable() { } @Test - public void assertEnable() { + void assertEnable() { when(getRegCenter().isExisted("/config/job")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java index bfa30436cb..61948b1eb1 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java @@ -49,7 +49,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class CloudJobControllerTest extends AbstractCloudControllerTest { +class CloudJobControllerTest extends AbstractCloudControllerTest { private static final String YAML = "appName: test_app\n" + "cpuCount: 1.0\n" @@ -70,7 +70,7 @@ public class CloudJobControllerTest extends AbstractCloudControllerTest { + "shardingTotalCount: 10\n"; @Test - public void assertRegister() { + void assertRegister() { when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(false); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", CloudJsonConstants.getJobJson()), is(200)); @@ -79,13 +79,13 @@ public void assertRegister() { } @Test - public void assertRegisterWithoutApp() { + void assertRegisterWithoutApp() { when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(false); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", CloudJsonConstants.getJobJson()), is(500)); } @Test - public void assertRegisterWithExistedName() { + void assertRegisterWithExistedName() { when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); when(getRegCenter().get("/config/job/test_job")).thenReturn(null, CloudJsonConstants.getJobJson()); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", CloudJsonConstants.getJobJson()), is(200)); @@ -94,13 +94,13 @@ public void assertRegisterWithExistedName() { } @Test - public void assertRegisterWithBadRequest() { + void assertRegisterWithBadRequest() { when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", "\"{\"jobName\":\"wrong_job\"}"), is(500)); } @Test - public void assertUpdate() { + void assertUpdate() { when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(true); when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); assertThat(HttpTestUtil.put("http://127.0.0.1:19000/api/job/update", CloudJsonConstants.getJobJson()), is(200)); @@ -109,33 +109,33 @@ public void assertUpdate() { } @Test - public void assertDeregister() { + void assertDeregister() { when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(false); assertThat(HttpTestUtil.delete("http://127.0.0.1:19000/api/job/test_job/deregister"), is(200)); verify(getRegCenter(), times(3)).get("/config/job/test_job"); } @Test - public void assertTriggerWithDaemonJob() { + void assertTriggerWithDaemonJob() { when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson(CloudJobExecutionType.DAEMON)); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/trigger", "test_job"), is(500)); } @Test - public void assertTriggerWithTransientJob() { + void assertTriggerWithTransientJob() { when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/trigger", "test_job"), is(200)); } @Test - public void assertDetail() { + void assertDetail() { when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/jobs/test_job"), is(CloudJsonConstants.getJobJson())); verify(getRegCenter()).get("/config/job/test_job"); } @Test - public void assertFindAllJobs() { + void assertFindAllJobs() { when(getRegCenter().isExisted("/config/job")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); @@ -146,7 +146,7 @@ public void assertFindAllJobs() { } @Test - public void assertFindAllRunningTasks() { + void assertFindAllRunningTasks() { RunningService runningService = new RunningService(getRegCenter()); TaskContext actualTaskContext = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); when(getRegCenter().get("/config/job/" + actualTaskContext.getMetaInfo().getJobName())).thenReturn(CloudJsonConstants.getJobJson()); @@ -155,7 +155,7 @@ public void assertFindAllRunningTasks() { } @Test - public void assertFindAllReadyTasks() { + void assertFindAllReadyTasks() { when(getRegCenter().isExisted("/state/ready")).thenReturn(true); when(getRegCenter().getChildrenKeys("/state/ready")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/state/ready/test_job")).thenReturn("1"); @@ -170,7 +170,7 @@ public void assertFindAllReadyTasks() { } @Test - public void assertFindAllFailoverTasks() { + void assertFindAllFailoverTasks() { when(getRegCenter().isExisted("/state/failover")).thenReturn(true); when(getRegCenter().getChildrenKeys("/state/failover")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().getChildrenKeys("/state/failover/test_job")).thenReturn(Collections.singletonList("test_job@-@0")); @@ -186,7 +186,7 @@ public void assertFindAllFailoverTasks() { } @Test - public void assertFindJobExecutionEventsWhenNotConfigRDB() { + void assertFindJobExecutionEventsWhenNotConfigRDB() { ReflectionUtils.setStaticFieldValue(CloudJobController.class, "jobEventRdbSearch", null); Map query = new HashMap<>(); query.put("per_page", "10"); @@ -196,19 +196,19 @@ public void assertFindJobExecutionEventsWhenNotConfigRDB() { } @Test - public void assertGetTaskResultStatistics() { + void assertGetTaskResultStatistics() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results"), is(GsonFactory.getGson().toJson(Collections.emptyList()))); } @Test - public void assertGetTaskResultStatisticsWithSinceParameter() { + void assertGetTaskResultStatisticsWithSinceParameter() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results?since=last24hours"), is(GsonFactory.getGson().toJson(Collections.emptyList()))); } @Test - public void assertGetTaskResultStatisticsWithPathParameter() { + void assertGetTaskResultStatisticsWithPathParameter() { String[] parameters = {"online", "lastWeek", "lastHour", "lastMinute"}; for (String each : parameters) { String result = HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results/" + each); @@ -219,7 +219,7 @@ public void assertGetTaskResultStatisticsWithPathParameter() { } @Test - public void assertGetTaskResultStatisticsWithErrorPathParameter() { + void assertGetTaskResultStatisticsWithErrorPathParameter() { String result = HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results/errorPath"); TaskResultStatistics taskResultStatistics = GsonFactory.getGson().fromJson(result, TaskResultStatistics.class); assertThat(taskResultStatistics.getSuccessCount(), is(0)); @@ -227,7 +227,7 @@ public void assertGetTaskResultStatisticsWithErrorPathParameter() { } @Test - public void assertGetJobExecutionTypeStatistics() { + void assertGetJobExecutionTypeStatistics() { String result = HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/executionType"); JobExecutionTypeStatistics jobExecutionTypeStatistics = GsonFactory.getGson().fromJson(result, JobExecutionTypeStatistics.class); assertThat(jobExecutionTypeStatistics.getDaemonJobCount(), is(0)); @@ -235,43 +235,43 @@ public void assertGetJobExecutionTypeStatistics() { } @Test - public void assertFindTaskRunningStatistics() { + void assertFindTaskRunningStatistics() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/running"), is(GsonFactory.getGson().toJson(Collections.emptyList()))); } @Test - public void assertFindTaskRunningStatisticsWeekly() { + void assertFindTaskRunningStatisticsWeekly() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/running?since=lastWeek"), is(GsonFactory.getGson().toJson(Collections.emptyList()))); } @Test - public void assertFindJobRunningStatistics() { + void assertFindJobRunningStatistics() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/running"), is(GsonFactory.getGson().toJson(Collections.emptyList()))); } @Test - public void assertFindJobRunningStatisticsWeekly() { + void assertFindJobRunningStatisticsWeekly() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/running?since=lastWeek"), is(GsonFactory.getGson().toJson(Collections.emptyList()))); } @Test - public void assertFindJobRegisterStatisticsSinceOnline() { + void assertFindJobRegisterStatisticsSinceOnline() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/register"), is(GsonFactory.getGson().toJson(Collections.emptyList()))); } @Test - public void assertIsDisabled() { + void assertIsDisabled() { when(getRegCenter().isExisted("/state/disable/job/test_job")).thenReturn(true); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/test_job/disable"), is("true")); } @Test - public void assertDisable() { + void assertDisable() { when(getRegCenter().isExisted("/config/job")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); @@ -281,7 +281,7 @@ public void assertDisable() { } @Test - public void assertEnable() { + void assertEnable() { when(getRegCenter().isExisted("/config/job")).thenReturn(true); when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java index 67197221ca..c47b897d8a 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java @@ -37,10 +37,10 @@ import static org.hamcrest.MatcherAssert.assertThat; @ExtendWith(MockitoExtension.class) -public class CloudLoginTest extends AbstractCloudControllerTest { +class CloudLoginTest extends AbstractCloudControllerTest { @Test - public void assertLoginSuccess() throws IOException { + void assertLoginSuccess() throws IOException { Map authInfo = new HashMap<>(); authInfo.put("username", "root"); authInfo.put("password", "pwd"); @@ -53,7 +53,7 @@ public void assertLoginSuccess() throws IOException { } @Test - public void assertLoginFail() { + void assertLoginFail() { Map authInfo = new HashMap<>(); authInfo.put("username", "root"); authInfo.put("password", ""); @@ -62,7 +62,7 @@ public void assertLoginFail() { } @Test - public void assertUnauthorized() { + void assertUnauthorized() { assertThat(HttpTestUtil.unauthorizedGet("http://127.0.0.1:19000/api/unauthorized"), is(401)); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java index d39f9cd0b8..95d306303a 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java @@ -30,24 +30,24 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class CloudOperationControllerTest extends AbstractCloudControllerTest { +class CloudOperationControllerTest extends AbstractCloudControllerTest { @Test - public void assertExplicitReconcile() { + void assertExplicitReconcile() { ReflectionUtils.setFieldValue(new CloudOperationController(), "lastReconcileTime", 0); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/explicit", ""), is(200)); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/explicit", ""), is(500)); } @Test - public void assertImplicitReconcile() { + void assertImplicitReconcile() { ReflectionUtils.setFieldValue(new CloudOperationController(), "lastReconcileTime", 0); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/implicit", ""), is(200)); assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/implicit", ""), is(500)); } @Test - public void assertSandbox() { + void assertSandbox() { when(getRegCenter().getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/operate/sandbox?appName=foo_app"), is("[{\"hostname\":\"127.0.0.1\"," + "\"path\":\"/slaves/d8701508-41b7-471e-9b32-61cf824a660d-S0/frameworks/d8701508-41b7-471e-9b32-61cf824a660d-0000/executors/foo_app@-@" @@ -55,7 +55,7 @@ public void assertSandbox() { } @Test - public void assertNoFrameworkSandbox() { + void assertNoFrameworkSandbox() { assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/operate/sandbox?appName=foo_app"), is("[]")); when(getRegCenter().getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("not-exists"); assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/operate/sandbox?appName=foo_app"), is("[]")); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java index c143b5165b..3352a42d52 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class JobEventRdbSearchTest { +class JobEventRdbSearchTest { @Mock private DataSource dataSource; @@ -61,7 +61,7 @@ public final class JobEventRdbSearchTest { private JobEventRdbSearch jobEventRdbSearch; @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { jobEventRdbSearch = new JobEventRdbSearch(dataSource); when(dataSource.getConnection()).thenReturn(conn); when(conn.prepareStatement(any())).thenReturn(preparedStatement); @@ -72,7 +72,7 @@ public void setUp() throws Exception { @Test @SneakyThrows - public void assertFindJobExecutionEvents() { + void assertFindJobExecutionEvents() { when(resultSet.getString(5)).thenReturn("TestJobName"); when(resultSet.getString(6)).thenReturn("FAILOVER"); when(resultSet.getString(7)).thenReturn("1"); @@ -90,7 +90,7 @@ public void assertFindJobExecutionEvents() { @Test @SneakyThrows - public void assertFindJobStatusTraceEvents() { + void assertFindJobStatusTraceEvents() { when(resultSet.getString(2)).thenReturn("TestJobName"); when(resultSet.getString(6)).thenReturn("LITE_EXECUTOR"); when(resultSet.getString(9)).thenReturn("TASK_RUNNING"); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java index 91ae56658a..29d8bd676a 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class CloudAppConfigurationListenerTest { +class CloudAppConfigurationListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -54,7 +54,7 @@ public final class CloudAppConfigurationListenerTest { private CloudAppConfigurationListener cloudAppConfigurationListener; @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "producerManager", producerManager); ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "mesosStateService", mesosStateService); initRegistryCenter(); @@ -72,7 +72,7 @@ private void initRegistryCenter() { } @Test - public void assertRemoveWithInvalidPath() { + void assertRemoveWithInvalidPath() { cloudAppConfigurationListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/other/test_app", null, "".getBytes()), new ChildData("/other/test_app", null, "".getBytes())); verify(mesosStateService, times(0)).executors(ArgumentMatchers.any()); @@ -80,7 +80,7 @@ public void assertRemoveWithInvalidPath() { } @Test - public void assertRemoveWithNoAppNamePath() { + void assertRemoveWithNoAppNamePath() { cloudAppConfigurationListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/config/app", null, "".getBytes()), new ChildData("/config/app", null, "".getBytes())); verify(mesosStateService, times(0)).executors(ArgumentMatchers.any()); @@ -88,19 +88,19 @@ public void assertRemoveWithNoAppNamePath() { } @Test - public void assertRemoveApp() { + void assertRemoveApp() { cloudAppConfigurationListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/config/app/test_app", null, "".getBytes()), new ChildData("/config/app/test_app", null, "".getBytes())); verify(mesosStateService).executors("test_app"); } @Test - public void start() { + void start() { cloudAppConfigurationListener.start(); } @Test - public void stop() { + void stop() { regCenter.addCacheData(CloudAppConfigurationNode.ROOT); ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "regCenter", regCenter); cloudAppConfigurationListener.stop(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java index fb4372febb..bbc9dd4318 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class CloudAppConfigurationNodeTest { +class CloudAppConfigurationNodeTest { @Test - public void assertGetRootNodePath() { + void assertGetRootNodePath() { assertThat(CloudAppConfigurationNode.getRootNodePath("test_job_app"), is("/config/app/test_job_app")); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java index de655e58b8..d873b22f96 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class CloudAppConfigurationServiceTest { +class CloudAppConfigurationServiceTest { private static final String YAML = "appCacheEnable: true\n" + "appName: test_app\n" @@ -56,28 +56,28 @@ public final class CloudAppConfigurationServiceTest { private CloudAppConfigurationService configService; @Test - public void assertAdd() { + void assertAdd() { CloudAppConfigurationPOJO appConfig = CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"); configService.add(appConfig); verify(regCenter).persist("/config/app/test_app", YAML); } @Test - public void assertUpdate() { + void assertUpdate() { CloudAppConfigurationPOJO appConfig = CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"); configService.update(appConfig); verify(regCenter).update("/config/app/test_app", YAML); } @Test - public void assertLoadAllWithoutRootNode() { + void assertLoadAllWithoutRootNode() { when(regCenter.isExisted("/config/app")).thenReturn(false); assertTrue(configService.loadAll().isEmpty()); verify(regCenter).isExisted("/config/app"); } @Test - public void assertLoadAllWithRootNode() { + void assertLoadAllWithRootNode() { when(regCenter.isExisted("/config/app")).thenReturn(true); when(regCenter.getChildrenKeys(CloudAppConfigurationNode.ROOT)).thenReturn(Arrays.asList("test_app_1", "test_app_2")); when(regCenter.get("/config/app/test_app_1")).thenReturn(CloudAppJsonConstants.getAppJson("test_app_1")); @@ -91,12 +91,12 @@ public void assertLoadAllWithRootNode() { } @Test - public void assertLoadWithoutConfig() { + void assertLoadWithoutConfig() { assertFalse(configService.load("test_app").isPresent()); } @Test - public void assertLoadWithConfig() { + void assertLoadWithConfig() { when(regCenter.get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); Optional actual = configService.load("test_app"); assertTrue(actual.isPresent()); @@ -104,7 +104,7 @@ public void assertLoadWithConfig() { } @Test - public void assertRemove() { + void assertRemove() { configService.remove("test_app"); verify(regCenter).remove("/config/app/test_app"); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java index bbb076386e..366390d504 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java @@ -24,10 +24,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class CloudAppConfigurationPOJOTest { +class CloudAppConfigurationPOJOTest { @Test - public void assertToCloudAppConfiguration() { + void assertToCloudAppConfiguration() { CloudAppConfigurationPOJO pojo = new CloudAppConfigurationPOJO(); pojo.setAppName("app"); pojo.setAppURL("url"); @@ -43,7 +43,7 @@ public void assertToCloudAppConfiguration() { } @Test - public void assertFromCloudAppConfiguration() { + void assertFromCloudAppConfiguration() { CloudAppConfigurationPOJO actual = CloudAppConfigurationPOJO.fromCloudAppConfiguration(new CloudAppConfiguration("app", "url", "start.sh")); assertThat(actual.getAppName(), is("app")); assertThat(actual.getAppURL(), is("url")); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java index 328e2c09e0..34bdcfba27 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class CloudJobConfigurationListenerTest { +public class CloudJobConfigurationListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -55,7 +55,7 @@ public final class CloudJobConfigurationListenerTest { private CloudJobConfigurationListener cloudJobConfigurationListener; @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "producerManager", producerManager); ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "readyService", readyService); initRegistryCenter(); @@ -73,7 +73,7 @@ private void initRegistryCenter() { } @Test - public void assertChildEventWhenIsNotConfigPath() { + void assertChildEventWhenIsNotConfigPath() { cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/other/test_job", null, "".getBytes())); verify(producerManager, times(0)).schedule(ArgumentMatchers.any()); verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); @@ -81,7 +81,7 @@ public void assertChildEventWhenIsNotConfigPath() { } @Test - public void assertChildEventWhenIsRootConfigPath() { + void assertChildEventWhenIsRootConfigPath() { cloudJobConfigurationListener.event(Type.NODE_DELETED, new ChildData("/config/job", null, "".getBytes()), new ChildData("/config/job", null, "".getBytes())); verify(producerManager, times(0)).schedule(ArgumentMatchers.any()); @@ -90,7 +90,7 @@ public void assertChildEventWhenIsRootConfigPath() { } @Test - public void assertChildEventWhenStateIsAddAndIsConfigPathAndInvalidData() { + void assertChildEventWhenStateIsAddAndIsConfigPathAndInvalidData() { cloudJobConfigurationListener.event(Type.NODE_CREATED, null, new ChildData("/config/job/test_job", null, "".getBytes())); verify(producerManager, times(0)).schedule(ArgumentMatchers.any()); verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); @@ -98,51 +98,51 @@ public void assertChildEventWhenStateIsAddAndIsConfigPathAndInvalidData() { } @Test - public void assertChildEventWhenStateIsAddAndIsConfigPath() { + void assertChildEventWhenStateIsAddAndIsConfigPath() { cloudJobConfigurationListener.event(Type.NODE_CREATED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson().getBytes())); verify(producerManager).schedule(ArgumentMatchers.any()); } @Test - public void assertChildEventWhenStateIsUpdateAndIsConfigPathAndTransientJob() { + void assertChildEventWhenStateIsUpdateAndIsConfigPathAndTransientJob() { cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson().getBytes())); verify(readyService, times(0)).remove(Collections.singletonList("test_job")); verify(producerManager).reschedule(ArgumentMatchers.any()); } @Test - public void assertChildEventWhenStateIsUpdateAndIsConfigPathAndDaemonJob() { + void assertChildEventWhenStateIsUpdateAndIsConfigPathAndDaemonJob() { cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson(CloudJobExecutionType.DAEMON).getBytes())); verify(readyService).remove(Collections.singletonList("test_job")); verify(producerManager).reschedule(ArgumentMatchers.any()); } @Test - public void assertChildEventWhenStateIsUpdateAndIsConfigPathAndMisfireDisabled() { + void assertChildEventWhenStateIsUpdateAndIsConfigPathAndMisfireDisabled() { cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson(false).getBytes())); verify(readyService).setMisfireDisabled("test_job"); verify(producerManager).reschedule(ArgumentMatchers.any()); } @Test - public void assertChildEventWhenStateIsRemovedAndIsJobConfigPath() { + void assertChildEventWhenStateIsRemovedAndIsJobConfigPath() { cloudJobConfigurationListener.event(Type.NODE_DELETED, new ChildData("/config/job/test_job", null, "".getBytes()), new ChildData("/config/job/test_job", null, "".getBytes())); verify(producerManager).unschedule("test_job"); } @Test - public void assertChildEventWhenStateIsUpdateAndIsConfigPath() { + void assertChildEventWhenStateIsUpdateAndIsConfigPath() { cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, "".getBytes())); } @Test - public void assertStart() { + void assertStart() { cloudJobConfigurationListener.start(); } @Test - public void assertStop() { + void assertStop() { regCenter.addCacheData(CloudJobConfigurationNode.ROOT); ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "regCenter", regCenter); cloudJobConfigurationListener.stop(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java index 5045f5e471..baec18760a 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class CloudJobConfigurationNodeTest { +class CloudJobConfigurationNodeTest { @Test - public void assertGetRootNodePath() { + void assertGetRootNodePath() { assertThat(CloudJobConfigurationNode.getRootNodePath("test_job"), is("/config/job/test_job")); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java index eb01b20109..6132905c3e 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class CloudJobConfigurationServiceTest { +class CloudJobConfigurationServiceTest { private static final String YAML = "appName: test_app\n" + "cpuCount: 1.0\n" @@ -66,28 +66,28 @@ public final class CloudJobConfigurationServiceTest { private CloudJobConfigurationService configService; @Test - public void assertAdd() { + void assertAdd() { CloudJobConfigurationPOJO cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"); configService.add(cloudJobConfig); verify(regCenter).persist("/config/job/test_job", YAML); } @Test - public void assertUpdate() { + void assertUpdate() { CloudJobConfigurationPOJO cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"); configService.update(cloudJobConfig); verify(regCenter).update("/config/job/test_job", YAML); } @Test - public void assertLoadAllWithoutRootNode() { + void assertLoadAllWithoutRootNode() { when(regCenter.isExisted("/config/job")).thenReturn(false); assertTrue(configService.loadAll().isEmpty()); verify(regCenter).isExisted("/config/job"); } @Test - public void assertLoadAllWithRootNode() { + void assertLoadAllWithRootNode() { when(regCenter.isExisted("/config/job")).thenReturn(true); when(regCenter.getChildrenKeys(CloudJobConfigurationNode.ROOT)).thenReturn(Arrays.asList("test_job_1", "test_job_2")); when(regCenter.get("/config/job/test_job_1")).thenReturn(CloudJsonConstants.getJobJson("test_job_1")); @@ -101,12 +101,12 @@ public void assertLoadAllWithRootNode() { } @Test - public void assertLoadWithoutConfig() { + void assertLoadWithoutConfig() { assertFalse(configService.load("test_job").isPresent()); } @Test - public void assertLoadWithConfig() { + void assertLoadWithConfig() { when(regCenter.get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); Optional actual = configService.load("test_job"); assertTrue(actual.isPresent()); @@ -114,14 +114,14 @@ public void assertLoadWithConfig() { } @Test - public void assertLoadWithSpringConfig() { + void assertLoadWithSpringConfig() { when(regCenter.get("/config/job/test_spring_job")).thenReturn(CloudJsonConstants.getSpringJobJson()); Optional actual = configService.load("test_spring_job"); assertTrue(actual.isPresent()); } @Test - public void assertRemove() { + void assertRemove() { configService.remove("test_job"); verify(regCenter).remove("/config/job/test_job"); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java index 7d820a004c..35228cad2f 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java @@ -25,10 +25,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobContextTest { +class JobContextTest { @Test - public void assertFrom() { + void assertFrom() { CloudJobConfiguration cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration(); JobContext actual = JobContext.from(cloudJobConfig, ExecutionType.READY); assertThat(actual.getAssignedShardingItems().size(), is(10)); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java index e140d416cd..1fc195cfb4 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java @@ -31,12 +31,12 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; -public final class BootstrapEnvironmentTest { +class BootstrapEnvironmentTest { private final BootstrapEnvironment bootstrapEnvironment = BootstrapEnvironment.getINSTANCE(); @Test - public void assertGetMesosConfiguration() { + void assertGetMesosConfiguration() { MesosConfiguration mesosConfig = bootstrapEnvironment.getMesosConfiguration(); assertThat(mesosConfig.getHostname(), is("localhost")); assertThat(mesosConfig.getUser(), is("")); @@ -44,7 +44,7 @@ public void assertGetMesosConfiguration() { } @Test - public void assertGetZookeeperConfiguration() { + void assertGetZookeeperConfiguration() { Properties properties = new Properties(); properties.setProperty(BootstrapEnvironment.EnvironmentArgument.ZOOKEEPER_DIGEST.getKey(), "test"); ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); @@ -55,19 +55,19 @@ public void assertGetZookeeperConfiguration() { } @Test - public void assertGetRestfulServerConfiguration() { + void assertGetRestfulServerConfiguration() { RestfulServerConfiguration restfulServerConfig = bootstrapEnvironment.getRestfulServerConfiguration(); assertThat(restfulServerConfig.getPort(), is(8899)); } @Test - public void assertGetFrameworkConfiguration() { + void assertGetFrameworkConfiguration() { FrameworkConfiguration frameworkConfig = bootstrapEnvironment.getFrameworkConfiguration(); assertThat(frameworkConfig.getJobStateQueueSize(), is(10000)); } @Test - public void assertGetEventTraceRdbConfiguration() { + void assertGetEventTraceRdbConfiguration() { Properties properties = new Properties(); properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_DRIVER.getKey(), "org.h2.Driver"); properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_URL.getKey(), "jdbc:h2:mem:job_event_trace"); @@ -78,12 +78,12 @@ public void assertGetEventTraceRdbConfiguration() { } @Test - public void assertWithoutEventTraceRdbConfiguration() { + void assertWithoutEventTraceRdbConfiguration() { assertFalse(bootstrapEnvironment.getTracingConfiguration().isPresent()); } @Test - public void assertGetEventTraceRdbConfigurationMap() { + void assertGetEventTraceRdbConfigurationMap() { Properties properties = new Properties(); properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_DRIVER.getKey(), "org.h2.Driver"); properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_URL.getKey(), "jdbc:h2:mem:job_event_trace"); @@ -98,7 +98,7 @@ public void assertGetEventTraceRdbConfigurationMap() { } @Test - public void assertReconcileConfiguration() { + void assertReconcileConfiguration() { FrameworkConfiguration configuration = bootstrapEnvironment.getFrameworkConfiguration(); assertThat(configuration.getReconcileIntervalMinutes(), is(-1)); assertFalse(configuration.isEnabledReconcile()); @@ -111,7 +111,7 @@ public void assertReconcileConfiguration() { } @Test - public void assertGetMesosRole() { + void assertGetMesosRole() { assertThat(bootstrapEnvironment.getMesosRole(), is(Optional.empty())); Properties properties = new Properties(); properties.setProperty(BootstrapEnvironment.EnvironmentArgument.MESOS_ROLE.getKey(), "0"); @@ -120,7 +120,7 @@ public void assertGetMesosRole() { } @Test - public void assertGetFrameworkHostPort() { + void assertGetFrameworkHostPort() { Properties properties = new Properties(); ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); assertThat(bootstrapEnvironment.getFrameworkHostPort(), is("localhost:8899")); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java index db0cf36921..9a43a4171d 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java @@ -33,7 +33,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class FrameworkIDServiceTest { +class FrameworkIDServiceTest { @Mock private CoordinatorRegistryCenter registryCenter; @@ -41,12 +41,12 @@ public class FrameworkIDServiceTest { private FrameworkIDService frameworkIDService; @BeforeEach - public void init() { + void init() { frameworkIDService = new FrameworkIDService(registryCenter); } @Test - public void assertFetch() { + void assertFetch() { when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("1"); Optional frameworkIDOptional = frameworkIDService.fetch(); assertTrue(frameworkIDOptional.isPresent()); @@ -55,7 +55,7 @@ public void assertFetch() { } @Test - public void assertSave() { + void assertSave() { when(registryCenter.isExisted(HANode.FRAMEWORK_ID_NODE)).thenReturn(false); frameworkIDService.save("1"); verify(registryCenter).isExisted(HANode.FRAMEWORK_ID_NODE); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java index c8db6d3e0f..a90e1a1ceb 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java @@ -49,7 +49,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public final class AppConstraintEvaluatorTest { +class AppConstraintEvaluatorTest { private static final double SUFFICIENT_CPU = 1.0 * 13; @@ -64,24 +64,24 @@ public final class AppConstraintEvaluatorTest { private TaskScheduler taskScheduler; @BeforeAll - public static void init() { + static void init() { facadeService = mock(FacadeService.class); AppConstraintEvaluator.init(facadeService); } @BeforeEach - public void setUp() { + void setUp() { taskScheduler = new TaskScheduler.Builder().withLeaseOfferExpirySecs(1000000000L).withLeaseRejectAction(virtualMachineLease -> { }).build(); } @AfterEach - public void tearDown() { + void tearDown() { AppConstraintEvaluator.getInstance().clearAppRunningState(); } @Test - public void assertFirstLaunch() { + void assertFirstLaunch() { SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, SUFFICIENT_CPU, SUFFICIENT_MEM), getLease(1, SUFFICIENT_CPU, SUFFICIENT_MEM))); assertThat(result.getResultMap().size(), is(2)); assertThat(result.getFailures().size(), is(0)); @@ -89,21 +89,21 @@ public void assertFirstLaunch() { } @Test - public void assertFirstLaunchLackCpu() { + void assertFirstLaunchLackCpu() { SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, INSUFFICIENT_CPU, SUFFICIENT_MEM), getLease(1, INSUFFICIENT_CPU, SUFFICIENT_MEM))); assertThat(result.getResultMap().size(), is(2)); assertThat(getAssignedTaskNumber(result), is(18)); } @Test - public void assertFirstLaunchLackMem() { + void assertFirstLaunchLackMem() { SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, SUFFICIENT_CPU, INSUFFICIENT_MEM), getLease(1, SUFFICIENT_CPU, INSUFFICIENT_MEM))); assertThat(result.getResultMap().size(), is(2)); assertThat(getAssignedTaskNumber(result), is(18)); } @Test - public void assertExistExecutorOnS0() { + void assertExistExecutorOnS0() { when(facadeService.loadExecutorInfo()).thenReturn(Collections.singletonList(new ExecutorStateInfo("foo-app@-@S0", "S0"))); AppConstraintEvaluator.getInstance().loadAppRunningState(); SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, INSUFFICIENT_CPU, INSUFFICIENT_MEM), getLease(1, INSUFFICIENT_CPU, INSUFFICIENT_MEM))); @@ -112,7 +112,7 @@ public void assertExistExecutorOnS0() { } @Test - public void assertGetExecutorError() { + void assertGetExecutorError() { when(facadeService.loadExecutorInfo()).thenThrow(JsonParseException.class); AppConstraintEvaluator.getInstance().loadAppRunningState(); SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, INSUFFICIENT_CPU, INSUFFICIENT_MEM), getLease(1, INSUFFICIENT_CPU, INSUFFICIENT_MEM))); @@ -121,7 +121,7 @@ public void assertGetExecutorError() { } @Test - public void assertLackJobConfig() { + void assertLackJobConfig() { when(facadeService.load("test")).thenReturn(Optional.empty()); SchedulingResult result = taskScheduler.scheduleOnce(Collections.singletonList(getTask("test")), Collections.singletonList(getLease(0, 1.5, 192))); assertThat(result.getResultMap().size(), is(1)); @@ -129,7 +129,7 @@ public void assertLackJobConfig() { } @Test - public void assertLackAppConfig() { + void assertLackAppConfig() { when(facadeService.load("test")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test"))); when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.empty()); SchedulingResult result = taskScheduler.scheduleOnce(Collections.singletonList(getTask("test")), Collections.singletonList(getLease(0, 1.5, 192))); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java index 21f72f1b59..ae00cfb4cd 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java @@ -59,7 +59,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class FacadeServiceTest { +class FacadeServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -91,7 +91,7 @@ public final class FacadeServiceTest { private FacadeService facadeService; @BeforeEach - public void setUp() { + void setUp() { facadeService = new FacadeService(regCenter); ReflectionUtils.setFieldValue(facadeService, "jobConfigService", jobConfigService); ReflectionUtils.setFieldValue(facadeService, "appConfigService", appConfigService); @@ -104,13 +104,13 @@ public void setUp() { } @Test - public void assertStart() { + void assertStart() { facadeService.start(); verify(runningService).start(); } @Test - public void assertGetEligibleJobContext() { + void assertGetEligibleJobContext() { Collection failoverJobContexts = Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder .createCloudJobConfiguration("failover_job").toCloudJobConfiguration(), ExecutionType.FAILOVER)); Collection readyJobContexts = Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder @@ -136,7 +136,7 @@ public void assertGetEligibleJobContext() { } @Test - public void assertRemoveLaunchTasksFromQueue() { + void assertRemoveLaunchTasksFromQueue() { facadeService.removeLaunchTasksFromQueue(Arrays.asList( TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()), TaskContext.from(TaskNode.builder().build().getTaskNodeValue()))); @@ -145,21 +145,21 @@ public void assertRemoveLaunchTasksFromQueue() { } @Test - public void assertAddRunning() { + void assertAddRunning() { TaskContext taskContext = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); facadeService.addRunning(taskContext); verify(runningService).add(taskContext); } @Test - public void assertUpdateDaemonStatus() { + void assertUpdateDaemonStatus() { TaskContext taskContext = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); facadeService.updateDaemonStatus(taskContext, true); verify(runningService).updateIdle(taskContext, true); } @Test - public void assertRemoveRunning() { + void assertRemoveRunning() { String taskNodeValue = TaskNode.builder().build().getTaskNodeValue(); TaskContext taskContext = TaskContext.from(taskNodeValue); facadeService.removeRunning(taskContext); @@ -167,7 +167,7 @@ public void assertRemoveRunning() { } @Test - public void assertRecordFailoverTaskWhenJobConfigNotExisted() { + void assertRecordFailoverTaskWhenJobConfigNotExisted() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(jobConfigService.load("test_job")).thenReturn(Optional.empty()); facadeService.recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); @@ -175,7 +175,7 @@ public void assertRecordFailoverTaskWhenJobConfigNotExisted() { } @Test - public void assertRecordFailoverTaskWhenIsFailoverDisabled() { + void assertRecordFailoverTaskWhenIsFailoverDisabled() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createOtherCloudJobConfiguration("test_job"))); facadeService.recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); @@ -183,7 +183,7 @@ public void assertRecordFailoverTaskWhenIsFailoverDisabled() { } @Test - public void assertRecordFailoverTaskWhenIsFailoverDisabledAndIsDaemonJob() { + void assertRecordFailoverTaskWhenIsFailoverDisabledAndIsDaemonJob() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); facadeService.recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); @@ -191,7 +191,7 @@ public void assertRecordFailoverTaskWhenIsFailoverDisabledAndIsDaemonJob() { } @Test - public void assertRecordFailoverTaskWhenIsFailoverEnabled() { + void assertRecordFailoverTaskWhenIsFailoverEnabled() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); TaskContext taskContext = TaskContext.from(taskNode.getTaskNodeValue()); @@ -200,76 +200,76 @@ public void assertRecordFailoverTaskWhenIsFailoverEnabled() { } @Test - public void assertLoadAppConfig() { + void assertLoadAppConfig() { Optional appConfigOptional = Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app")); when(appConfigService.load("test_app")).thenReturn(appConfigOptional); assertThat(facadeService.loadAppConfig("test_app"), is(appConfigOptional)); } @Test - public void assertLoadJobConfig() { + void assertLoadJobConfig() { Optional cloudJobConfig = Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job")); when(jobConfigService.load("test_job")).thenReturn(cloudJobConfig); assertThat(facadeService.load("test_job"), is(cloudJobConfig)); } @Test - public void assertLoadAppConfigWhenAbsent() { + void assertLoadAppConfigWhenAbsent() { when(appConfigService.load("test_app")).thenReturn(Optional.empty()); assertThat(facadeService.loadAppConfig("test_app"), is(Optional.empty())); } @Test - public void assertLoadJobConfigWhenAbsent() { + void assertLoadJobConfigWhenAbsent() { when(jobConfigService.load("test_job")).thenReturn(Optional.empty()); assertThat(facadeService.load("test_job"), is(Optional.empty())); } @Test - public void assertAddDaemonJobToReadyQueue() { + void assertAddDaemonJobToReadyQueue() { when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); facadeService.addDaemonJobToReadyQueue("test_job"); verify(readyService).addDaemon("test_job"); } @Test - public void assertIsRunningForReadyJobAndNotRunning() { + void assertIsRunningForReadyJobAndNotRunning() { when(runningService.getRunningTasks("test_job")).thenReturn(Collections.emptyList()); assertFalse(facadeService.isRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.READY).build().getTaskNodeValue()))); } @Test - public void assertIsRunningForFailoverJobAndNotRunning() { + void assertIsRunningForFailoverJobAndNotRunning() { when(runningService.isTaskRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()).getMetaInfo())).thenReturn(false); assertFalse(facadeService.isRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()))); } @Test - public void assertIsRunningForFailoverJobAndRunning() { + void assertIsRunningForFailoverJobAndRunning() { when(runningService.isTaskRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()).getMetaInfo())).thenReturn(true); assertTrue(facadeService.isRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()))); } @Test - public void assertAddMapping() { + void assertAddMapping() { facadeService.addMapping("taskId", "localhost"); verify(runningService).addMapping("taskId", "localhost"); } @Test - public void assertPopMapping() { + void assertPopMapping() { facadeService.popMapping("taskId"); verify(runningService).popMapping("taskId"); } @Test - public void assertStop() { + void assertStop() { facadeService.stop(); verify(runningService).clear(); } @Test - public void assertGetFailoverTaskId() { + void assertGetFailoverTaskId() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); TaskContext taskContext = TaskContext.from(taskNode.getTaskNodeValue()); @@ -280,7 +280,7 @@ public void assertGetFailoverTaskId() { } @Test - public void assertJobDisabledWhenAppEnabled() { + void assertJobDisabledWhenAppEnabled() { when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); when(disableAppService.isDisabled("test_app")).thenReturn(false); when(disableJobService.isDisabled("test_job")).thenReturn(true); @@ -288,20 +288,20 @@ public void assertJobDisabledWhenAppEnabled() { } @Test - public void assertIsJobEnabled() { + void assertIsJobEnabled() { when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); assertFalse(facadeService.isJobDisabled("test_job")); } @Test - public void assertIsJobDisabledWhenAppDisabled() { + void assertIsJobDisabledWhenAppDisabled() { when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); when(disableAppService.isDisabled("test_app")).thenReturn(true); assertTrue(facadeService.isJobDisabled("test_job")); } @Test - public void assertIsJobDisabledWhenAppEnabled() { + void assertIsJobDisabledWhenAppEnabled() { when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); when(disableAppService.isDisabled("test_app")).thenReturn(false); when(disableJobService.isDisabled("test_job")).thenReturn(true); @@ -309,19 +309,19 @@ public void assertIsJobDisabledWhenAppEnabled() { } @Test - public void assertEnableJob() { + void assertEnableJob() { facadeService.enableJob("test_job"); verify(disableJobService).remove("test_job"); } @Test - public void assertDisableJob() { + void assertDisableJob() { facadeService.disableJob("test_job"); verify(disableJobService).add("test_job"); } @Test - public void assertLoadExecutor() { + void assertLoadExecutor() { facadeService.loadExecutorInfo(); verify(mesosStateService).executors(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java index c9d4a4d192..a5d918fe89 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java @@ -30,75 +30,75 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; -public final class JobTaskRequestTest { +class JobTaskRequestTest { private final JobTaskRequest jobTaskRequest = new JobTaskRequest(new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "unassigned-slave"), CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); @Test - public void assertGetId() { + void assertGetId() { assertThat(jobTaskRequest.getId(), StringStartsWith.startsWith("test_job@-@0@-@READY@-@unassigned-slave")); } @Test - public void assertTaskGroupName() { + void assertTaskGroupName() { assertThat(jobTaskRequest.taskGroupName(), is("")); } @Test - public void assertGetCPUs() { + void assertGetCPUs() { assertThat(jobTaskRequest.getCPUs(), is(1.0d)); } @Test - public void assertGetMemory() { + void assertGetMemory() { assertThat(jobTaskRequest.getMemory(), is(128.0d)); } @Test - public void assertGetNetworkMbps() { + void assertGetNetworkMbps() { assertThat(jobTaskRequest.getNetworkMbps(), is(0d)); } @Test - public void assertGetDisk() { + void assertGetDisk() { assertThat(jobTaskRequest.getDisk(), is(10d)); } @Test - public void assertGetPorts() { + void assertGetPorts() { assertThat(jobTaskRequest.getPorts(), is(1)); } @Test - public void assertGetScalarRequests() { + void assertGetScalarRequests() { assertNull(jobTaskRequest.getScalarRequests()); } @Test - public void assertGetHardConstraints() { + void assertGetHardConstraints() { AppConstraintEvaluator.init(null); assertThat(jobTaskRequest.getHardConstraints().size(), is(1)); } @Test - public void assertGetSoftConstraints() { + void assertGetSoftConstraints() { assertNull(jobTaskRequest.getSoftConstraints()); } @Test - public void assertSetAssignedResources() { + void assertSetAssignedResources() { jobTaskRequest.setAssignedResources(null); } @Test - public void assertGetAssignedResources() { + void assertGetAssignedResources() { assertNull(jobTaskRequest.getAssignedResources()); } @Test - public void assertGetCustomNamedResources() { + void assertGetCustomNamedResources() { assertThat(jobTaskRequest.getCustomNamedResources(), is(Collections.emptyMap())); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java index 290fe0b927..4f57d79f20 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class LaunchingTasksTest { +class LaunchingTasksTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -61,7 +61,7 @@ public final class LaunchingTasksTest { private LaunchingTasks launchingTasks; @BeforeEach - public void setUp() { + void setUp() { FacadeService facadeService = new FacadeService(regCenter); ReflectionUtils.setFieldValue(facadeService, "jobConfigService", jobConfigService); ReflectionUtils.setFieldValue(facadeService, "readyService", readyService); @@ -74,7 +74,7 @@ public void setUp() { } @Test - public void assertGetPendingTasks() { + void assertGetPendingTasks() { List actual = launchingTasks.getPendingTasks(); assertThat(actual.size(), is(20)); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java index c7e379135e..1b3cc80052 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java @@ -24,12 +24,12 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class LeasesQueueTest { +class LeasesQueueTest { private final LeasesQueue leasesQueue = LeasesQueue.getInstance(); @Test - public void assertOperate() { + void assertOperate() { assertTrue(leasesQueue.drainTo().isEmpty()); leasesQueue.offer(OfferBuilder.createOffer("offer_1")); leasesQueue.offer(OfferBuilder.createOffer("offer_2")); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java index 54d887969b..0c7aca9588 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java @@ -34,13 +34,13 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class MesosStateServiceTest extends AbstractCloudControllerTest { +class MesosStateServiceTest extends AbstractCloudControllerTest { @Mock private CoordinatorRegistryCenter registryCenter; @Test - public void assertSandbox() { + void assertSandbox() { when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); MesosStateService service = new MesosStateService(registryCenter); Collection> sandbox = service.sandbox("foo_app"); @@ -51,7 +51,7 @@ public void assertSandbox() { } @Test - public void assertExecutors() { + void assertExecutors() { when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); MesosStateService service = new MesosStateService(registryCenter); Collection executorStateInfo = service.executors("foo_app"); @@ -62,7 +62,7 @@ public void assertExecutors() { } @Test - public void assertAllExecutors() { + void assertAllExecutors() { when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); MesosStateService service = new MesosStateService(registryCenter); Collection executorStateInfo = service.executors(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java index ced647cba3..fbcbe0b8f8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ReconcileServiceTest { +class ReconcileServiceTest { @Mock private SchedulerDriver schedulerDriver; @@ -55,24 +55,24 @@ public final class ReconcileServiceTest { private ArgumentCaptor> taskStatusCaptor; @BeforeEach - public void setUp() { + void setUp() { reconcileService = new ReconcileService(schedulerDriver, facadeService); } @Test - public void assertRunOneIteration() { + void assertRunOneIteration() { reconcileService.runOneIteration(); verify(schedulerDriver).reconcileTasks(Collections.emptyList()); } @Test - public void assertImplicitReconcile() { + void assertImplicitReconcile() { reconcileService.implicitReconcile(); verify(schedulerDriver).reconcileTasks(Collections.emptyList()); } @Test - public void assertExplicitReconcile() { + void assertExplicitReconcile() { Map> runningTaskMap = new HashMap<>(); runningTaskMap.put("transient_test_job", Sets.newHashSet( TaskContext.from("transient_test_job@-@0@-@READY@-@SLAVE-S0@-@UUID"), TaskContext.from("transient_test_job@-@1@-@READY@-@SLAVE-S0@-@UUID"))); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java index 316eaafe5d..c0ba180d37 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java @@ -51,7 +51,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class SchedulerEngineTest { +class SchedulerEngineTest { @Mock private TaskScheduler taskScheduler; @@ -68,7 +68,7 @@ public final class SchedulerEngineTest { private SchedulerEngine schedulerEngine; @BeforeEach - public void setUp() { + void setUp() { schedulerEngine = new SchedulerEngine(taskScheduler, facadeService, new JobTracingEventBus(), frameworkIDService, statisticManager); ReflectionUtils.setFieldValue(schedulerEngine, "facadeService", facadeService); lenient().when(facadeService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); @@ -76,20 +76,20 @@ public void setUp() { } @Test - public void assertRegistered() { + void assertRegistered() { schedulerEngine.registered(null, Protos.FrameworkID.newBuilder().setValue("1").build(), Protos.MasterInfo.getDefaultInstance()); verify(taskScheduler).expireAllLeases(); verify(frameworkIDService).save("1"); } @Test - public void assertReregistered() { + void assertReregistered() { schedulerEngine.reregistered(null, Protos.MasterInfo.getDefaultInstance()); verify(taskScheduler).expireAllLeases(); } @Test - public void assertResourceOffers() { + void assertResourceOffers() { SchedulerDriver schedulerDriver = mock(SchedulerDriver.class); List offers = Arrays.asList(OfferBuilder.createOffer("offer_0"), OfferBuilder.createOffer("offer_1")); schedulerEngine.resourceOffers(schedulerDriver, offers); @@ -97,13 +97,13 @@ public void assertResourceOffers() { } @Test - public void assertOfferRescinded() { + void assertOfferRescinded() { schedulerEngine.offerRescinded(null, Protos.OfferID.newBuilder().setValue("myOffer").build()); verify(taskScheduler).expireLease("myOffer"); } @Test - public void assertRunningStatusUpdateForDaemonJobBegin() { + void assertRunningStatusUpdateForDaemonJobBegin() { TaskNode taskNode = TaskNode.builder().build(); schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) .setState(Protos.TaskState.TASK_RUNNING).setMessage("BEGIN").setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); @@ -111,7 +111,7 @@ public void assertRunningStatusUpdateForDaemonJobBegin() { } @Test - public void assertRunningStatusUpdateForDaemonJobComplete() { + void assertRunningStatusUpdateForDaemonJobComplete() { TaskNode taskNode = TaskNode.builder().build(); schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) .setState(Protos.TaskState.TASK_RUNNING).setMessage("COMPLETE").setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); @@ -119,7 +119,7 @@ public void assertRunningStatusUpdateForDaemonJobComplete() { } @Test - public void assertRunningStatusUpdateForOther() { + void assertRunningStatusUpdateForOther() { TaskNode taskNode = TaskNode.builder().build(); schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) .setState(Protos.TaskState.TASK_RUNNING).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); @@ -127,7 +127,7 @@ public void assertRunningStatusUpdateForOther() { } @Test - public void assertFinishedStatusUpdateWithoutLaunchedTasks() { + void assertFinishedStatusUpdateWithoutLaunchedTasks() { TaskNode taskNode = TaskNode.builder().build(); schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) .setState(Protos.TaskState.TASK_FINISHED).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); @@ -136,7 +136,7 @@ public void assertFinishedStatusUpdateWithoutLaunchedTasks() { } @Test - public void assertFinishedStatusUpdate() { + void assertFinishedStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -150,7 +150,7 @@ public void assertFinishedStatusUpdate() { } @Test - public void assertKilledStatusUpdate() { + void assertKilledStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -164,7 +164,7 @@ public void assertKilledStatusUpdate() { } @Test - public void assertFailedStatusUpdate() { + void assertFailedStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -179,7 +179,7 @@ public void assertFailedStatusUpdate() { } @Test - public void assertErrorStatusUpdate() { + void assertErrorStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -194,7 +194,7 @@ public void assertErrorStatusUpdate() { } @Test - public void assertLostStatusUpdate() { + void assertLostStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -209,7 +209,7 @@ public void assertLostStatusUpdate() { } @Test - public void assertDroppedStatusUpdate() { + void assertDroppedStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -225,7 +225,7 @@ public void assertDroppedStatusUpdate() { } @Test - public void assertGoneStatusUpdate() { + void assertGoneStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -240,7 +240,7 @@ public void assertGoneStatusUpdate() { } @Test - public void assertGoneByOperatorStatusUpdate() { + void assertGoneByOperatorStatusUpdate() { @SuppressWarnings("unchecked") Action2 taskUnAssigner = mock(Action2.class); when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); @@ -256,7 +256,7 @@ public void assertGoneByOperatorStatusUpdate() { } @Test - public void assertUnknownStatusUpdate() { + void assertUnknownStatusUpdate() { TaskNode taskNode = TaskNode.builder().build(); schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_UNKNOWN) @@ -265,7 +265,7 @@ public void assertUnknownStatusUpdate() { } @Test - public void assertUnReachedStatusUpdate() { + void assertUnReachedStatusUpdate() { TaskNode taskNode = TaskNode.builder().build(); schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_UNREACHABLE) @@ -274,23 +274,23 @@ public void assertUnReachedStatusUpdate() { } @Test - public void assertFrameworkMessage() { + void assertFrameworkMessage() { schedulerEngine.frameworkMessage(null, null, Protos.SlaveID.newBuilder().setValue("slave-S0").build(), new byte[1]); } @Test - public void assertSlaveLost() { + void assertSlaveLost() { schedulerEngine.slaveLost(null, Protos.SlaveID.newBuilder().setValue("slave-S0").build()); verify(taskScheduler).expireAllLeasesByVMId("slave-S0"); } @Test - public void assertExecutorLost() { + void assertExecutorLost() { schedulerEngine.executorLost(null, Protos.ExecutorID.newBuilder().setValue("test_job@-@0@-@00").build(), Protos.SlaveID.newBuilder().setValue("slave-S0").build(), 0); } @Test - public void assertError() { + void assertError() { schedulerEngine.error(null, null); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java index 1d1e01044c..c06632f705 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class SchedulerServiceTest { +class SchedulerServiceTest { @Mock private BootstrapEnvironment env; @@ -82,7 +82,7 @@ public class SchedulerServiceTest { private SchedulerService schedulerService; @BeforeEach - public void setUp() { + void setUp() { schedulerService = new SchedulerService(env, facadeService, schedulerDriver, producerManager, statisticManager, cloudJobConfigurationListener, taskLaunchScheduledService, consoleBootstrap, reconcileService, cloudJobDisableListener, @@ -90,7 +90,7 @@ public void setUp() { } @Test - public void assertStart() { + void assertStart() { setReconcileEnabled(true); schedulerService.start(); InOrder inOrder = getInOrder(); @@ -105,7 +105,7 @@ public void assertStart() { } @Test - public void assertStartWithoutReconcile() { + void assertStartWithoutReconcile() { setReconcileEnabled(false); schedulerService.start(); InOrder inOrder = getInOrder(); @@ -120,7 +120,7 @@ public void assertStartWithoutReconcile() { } @Test - public void assertStop() { + void assertStop() { setReconcileEnabled(true); schedulerService.stop(); InOrder inOrder = getInOrder(); @@ -135,7 +135,7 @@ public void assertStop() { } @Test - public void assertStopWithoutReconcile() { + void assertStopWithoutReconcile() { setReconcileEnabled(false); schedulerService.stop(); InOrder inOrder = getInOrder(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java index 4ef76e04af..ee31b68a9a 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java @@ -22,10 +22,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class SupportedExtractionTypeTest { +class SupportedExtractionTypeTest { @Test - public void assertIsExtraction() { + void assertIsExtraction() { assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tar")); assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tar.gz")); assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tar.bz2")); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java index bf1dad3f6c..7bdc6c6738 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java @@ -29,24 +29,24 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; -public final class TaskInfoDataTest { +class TaskInfoDataTest { private final ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 3, "test_param", Collections.emptyMap()); @Test - public void assertSerializeSimpleJob() { + void assertSerializeSimpleJob() { TaskInfoData actual = new TaskInfoData(shardingContexts, CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); assertSerialize(SerializationUtils.deserialize(actual.serialize())); } @Test - public void assertSerializeDataflowJob() { + void assertSerializeDataflowJob() { TaskInfoData actual = new TaskInfoData(shardingContexts, CloudJobConfigurationBuilder.createDataflowCloudJobConfiguration("test_job")); assertSerialize(SerializationUtils.deserialize(actual.serialize())); } @Test - public void assertSerializeScriptJob() { + void assertSerializeScriptJob() { TaskInfoData actual = new TaskInfoData(shardingContexts, CloudJobConfigurationBuilder.createScriptCloudJobConfiguration("test_job").toCloudJobConfiguration()); assertSerialize(SerializationUtils.deserialize(actual.serialize())); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java index 3faa3f4b25..8b8d1b83ac 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java @@ -59,7 +59,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class TaskLaunchScheduledServiceTest { +class TaskLaunchScheduledServiceTest { @Mock private SchedulerDriver schedulerDriver; @@ -76,19 +76,19 @@ public final class TaskLaunchScheduledServiceTest { private TaskLaunchScheduledService taskLaunchScheduledService; @BeforeEach - public void setUp() { + void setUp() { lenient().when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"))); taskLaunchScheduledService = new TaskLaunchScheduledService(schedulerDriver, taskScheduler, facadeService, jobTracingEventBus); taskLaunchScheduledService.startUp(); } @AfterEach - public void tearDown() { + void tearDown() { taskLaunchScheduledService.shutDown(); } @Test - public void assertRunOneIteration() { + void assertRunOneIteration() { when(facadeService.getEligibleJobContext()).thenReturn( Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("failover_job", CloudJobExecutionType.DAEMON, 1), ExecutionType.FAILOVER))); Map vmAssignmentResultMap = new HashMap<>(); @@ -105,7 +105,7 @@ public void assertRunOneIteration() { } @Test - public void assertRunOneIterationWithScriptJob() { + void assertRunOneIterationWithScriptJob() { when(facadeService.getEligibleJobContext()).thenReturn( Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder.createScriptCloudJobConfiguration("script_job", 1).toCloudJobConfiguration(), ExecutionType.READY))); Map vmAssignmentResultMap = new HashMap<>(); @@ -129,12 +129,12 @@ private TaskAssignmentResult mockTaskAssignmentResult(final String taskName, fin } @Test - public void assertScheduler() { + void assertScheduler() { assertThat(taskLaunchScheduledService.scheduler(), instanceOf(Scheduler.class)); } @Test - public void assertServiceName() { + void assertServiceName() { assertThat(taskLaunchScheduledService.serviceName(), is("task-launch-processor")); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java index f06957a58b..b9ab1cd5e5 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java @@ -31,7 +31,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ProducerJobTest { +class ProducerJobTest { @Mock private JobExecutionContext jobExecutionContext; @@ -44,14 +44,14 @@ public final class ProducerJobTest { private TransientProducerScheduler.ProducerJob producerJob; @BeforeEach - public void setUp() { + void setUp() { producerJob = new TransientProducerScheduler.ProducerJob(); producerJob.setRepository(repository); producerJob.setReadyService(readyService); } @Test - public void assertExecute() { + void assertExecute() { when(jobExecutionContext.getJobDetail()).thenReturn(JobBuilder.newJob(TransientProducerScheduler.ProducerJob.class).withIdentity("0/30 * * * * ?").build()); repository.put(JobKey.jobKey("0/30 * * * * ?"), "test_job"); producerJob.execute(jobExecutionContext); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java index 0b634254fa..285a705dcf 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java @@ -51,7 +51,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ProducerManagerTest { +class ProducerManagerTest { @Mock private SchedulerDriver schedulerDriver; @@ -86,7 +86,7 @@ public final class ProducerManagerTest { private final CloudJobConfigurationPOJO daemonJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("daemon_test_job", CloudJobExecutionType.DAEMON); @BeforeEach - public void setUp() { + void setUp() { producerManager = new ProducerManager(schedulerDriver, regCenter); ReflectionUtils.setFieldValue(producerManager, "appConfigService", appConfigService); ReflectionUtils.setFieldValue(producerManager, "configService", configService); @@ -97,7 +97,7 @@ public void setUp() { } @Test - public void assertStartup() { + void assertStartup() { when(configService.loadAll()).thenReturn(Arrays.asList(transientJobConfig, daemonJobConfig)); producerManager.startup(); verify(configService).loadAll(); @@ -106,7 +106,7 @@ public void assertStartup() { } @Test - public void assertRegisterJobWithoutApp() { + void assertRegisterJobWithoutApp() { assertThrows(AppConfigurationException.class, () -> { when(appConfigService.load("test_app")).thenReturn(Optional.empty()); producerManager.register(transientJobConfig); @@ -114,7 +114,7 @@ public void assertRegisterJobWithoutApp() { } @Test - public void assertRegisterExistedJob() { + void assertRegisterExistedJob() { assertThrows(JobConfigurationException.class, () -> { when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); @@ -123,7 +123,7 @@ public void assertRegisterExistedJob() { } @Test - public void assertRegisterDisabledJob() { + void assertRegisterDisabledJob() { assertThrows(JobConfigurationException.class, () -> { when(disableJobService.isDisabled("transient_test_job")).thenReturn(true); producerManager.register(transientJobConfig); @@ -131,7 +131,7 @@ public void assertRegisterDisabledJob() { } @Test - public void assertRegisterTransientJob() { + void assertRegisterTransientJob() { when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); when(configService.load("transient_test_job")).thenReturn(Optional.empty()); producerManager.register(transientJobConfig); @@ -140,7 +140,7 @@ public void assertRegisterTransientJob() { } @Test - public void assertRegisterDaemonJob() { + void assertRegisterDaemonJob() { when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); when(configService.load("daemon_test_job")).thenReturn(Optional.empty()); producerManager.register(daemonJobConfig); @@ -149,7 +149,7 @@ public void assertRegisterDaemonJob() { } @Test - public void assertUpdateNotExisted() { + void assertUpdateNotExisted() { assertThrows(JobConfigurationException.class, () -> { when(configService.load("transient_test_job")).thenReturn(Optional.empty()); producerManager.update(transientJobConfig); @@ -157,7 +157,7 @@ public void assertUpdateNotExisted() { } @Test - public void assertUpdateExisted() { + void assertUpdateExisted() { when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); List taskContexts = Arrays.asList( TaskContext.from("transient_test_job@-@0@-@READY@-@SLAVE-S0@-@UUID"), TaskContext.from("transient_test_job@-@1@-@READY@-@SLAVE-S0@-@UUID")); @@ -172,14 +172,14 @@ public void assertUpdateExisted() { } @Test - public void assertDeregisterNotExisted() { + void assertDeregisterNotExisted() { when(configService.load("transient_test_job")).thenReturn(Optional.empty()); producerManager.deregister("transient_test_job"); verify(configService, times(0)).remove("transient_test_job"); } @Test - public void assertDeregisterExisted() { + void assertDeregisterExisted() { when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); List taskContexts = Arrays.asList( TaskContext.from("transient_test_job@-@0@-@READY@-@SLAVE-S0@-@UUID"), TaskContext.from("transient_test_job@-@1@-@READY@-@SLAVE-S0@-@UUID")); @@ -195,7 +195,7 @@ public void assertDeregisterExisted() { } @Test - public void assertShutdown() { + void assertShutdown() { producerManager.shutdown(); verify(transientProducerScheduler).shutdown(); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java index d5f9178a8d..70a82a3a8a 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java @@ -28,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ExtendWith(MockitoExtension.class) -public final class TransientProducerRepositoryTest { +class TransientProducerRepositoryTest { private final JobKey jobKey = JobKey.jobKey("0/45 * * * * ?"); @@ -37,14 +37,14 @@ public final class TransientProducerRepositoryTest { private final TransientProducerRepository transientProducerRepository = new TransientProducerRepository(); @Test - public void assertPutJobKey() { + void assertPutJobKey() { transientProducerRepository.put(jobKey, jobName); assertThat(transientProducerRepository.get(jobKey).get(0), is(jobName)); transientProducerRepository.remove(jobName); } @Test - public void assertPutJobWithChangedCron() { + void assertPutJobWithChangedCron() { transientProducerRepository.put(jobKey, jobName); JobKey newJobKey = JobKey.jobKey("0/15 * * * * ?"); transientProducerRepository.put(newJobKey, jobName); @@ -54,7 +54,7 @@ public void assertPutJobWithChangedCron() { } @Test - public void assertPutMoreJobWithChangedCron() { + void assertPutMoreJobWithChangedCron() { String jobName2 = "other_test_job"; transientProducerRepository.put(jobKey, jobName); transientProducerRepository.put(jobKey, jobName2); @@ -67,14 +67,14 @@ public void assertPutMoreJobWithChangedCron() { } @Test - public void assertRemoveJobKey() { + void assertRemoveJobKey() { transientProducerRepository.put(jobKey, jobName); transientProducerRepository.remove(jobName); assertTrue(transientProducerRepository.get(jobKey).isEmpty()); } @Test - public void assertContainsKey() { + void assertContainsKey() { transientProducerRepository.put(jobKey, jobName); assertTrue(transientProducerRepository.containsKey(jobKey)); transientProducerRepository.remove(jobName); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java index a9ba189700..80c7214196 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class TransientProducerSchedulerTest { +class TransientProducerSchedulerTest { @Mock private ReadyService readyService; @@ -59,13 +59,13 @@ public final class TransientProducerSchedulerTest { .build(); @BeforeEach - public void setUp() { + void setUp() { transientProducerScheduler = new TransientProducerScheduler(readyService); ReflectionUtils.setFieldValue(transientProducerScheduler, "scheduler", scheduler); } @Test - public void assertRegister() throws SchedulerException { + void assertRegister() throws SchedulerException { when(scheduler.checkExists(jobDetail.getKey())).thenReturn(false); transientProducerScheduler.register(cloudJobConfig); verify(scheduler).checkExists(jobDetail.getKey()); @@ -73,13 +73,13 @@ public void assertRegister() throws SchedulerException { } @Test - public void assertDeregister() throws SchedulerException { + void assertDeregister() throws SchedulerException { transientProducerScheduler.deregister(cloudJobConfig); verify(scheduler).unscheduleJob(TriggerKey.triggerKey(cloudJobConfig.getCron())); } @Test - public void assertShutdown() throws SchedulerException { + void assertShutdown() throws SchedulerException { transientProducerScheduler.shutdown(); verify(scheduler).isShutdown(); verify(scheduler).shutdown(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java index 65656321c9..1c385a8455 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class CloudAppDisableListenerTest { +public class CloudAppDisableListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -52,7 +52,7 @@ public final class CloudAppDisableListenerTest { private CloudAppDisableListener cloudAppDisableListener; @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(cloudAppDisableListener, "producerManager", producerManager); initRegistryCenter(); ReflectionUtils.setFieldValue(cloudAppDisableListener, "regCenter", regCenter); @@ -70,27 +70,27 @@ private void initRegistryCenter() { } @Test - public void assertDisableWithInvalidPath() { + void assertDisableWithInvalidPath() { cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/other/test_app", null, "".getBytes())); verify(jobConfigService, times(0)).loadAll(); verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); } @Test - public void assertDisableWithNoAppNamePath() { + void assertDisableWithNoAppNamePath() { cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/app", null, "".getBytes())); verify(jobConfigService, times(0)).loadAll(); verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); } @Test - public void assertDisable() { + void assertDisable() { cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/app/app_test", null, "".getBytes())); verify(jobConfigService).loadAll(); } @Test - public void assertEnableWithInvalidPath() { + void assertEnableWithInvalidPath() { cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/other/test_app", null, "".getBytes()), new ChildData("/other/test_app", null, "".getBytes())); verify(jobConfigService, times(0)).loadAll(); @@ -98,7 +98,7 @@ public void assertEnableWithInvalidPath() { } @Test - public void assertEnableWithNoAppNamePath() { + void assertEnableWithNoAppNamePath() { cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/app", null, "".getBytes()), new ChildData("/state/disable/app", null, "".getBytes())); verify(jobConfigService, times(0)).loadAll(); @@ -106,19 +106,19 @@ public void assertEnableWithNoAppNamePath() { } @Test - public void assertEnable() { + void assertEnable() { cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/app/app_test", null, "".getBytes()), new ChildData("/state/disable/app/app_test", null, "".getBytes())); verify(jobConfigService).loadAll(); } @Test - public void start() { + void start() { cloudAppDisableListener.start(); } @Test - public void stop() { + void stop() { regCenter.addCacheData("/state/disable/app"); ReflectionUtils.setFieldValue(cloudAppDisableListener, "regCenter", regCenter); cloudAppDisableListener.stop(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java index e8eab8a26e..a79bfb5e3b 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class DisableAppNodeTest { +class DisableAppNodeTest { @Test - public void assertGetDisableAppNodePath() { + void assertGetDisableAppNodePath() { assertThat(DisableAppNode.getDisableAppNodePath("test_app0000000001"), is("/state/disable/app/test_app0000000001")); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java index f4c5bc4d84..bdb681b181 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java @@ -30,7 +30,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class DisableAppServiceTest { +class DisableAppServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -38,32 +38,32 @@ public final class DisableAppServiceTest { private DisableAppService disableAppService; @BeforeEach - public void setUp() { + void setUp() { disableAppService = new DisableAppService(regCenter); } @Test - public void assertAdd() { + void assertAdd() { disableAppService.add("test_app"); verify(regCenter).isExisted("/state/disable/app/test_app"); verify(regCenter).persist("/state/disable/app/test_app", "test_app"); } @Test - public void assertRemove() { + void assertRemove() { disableAppService.remove("test_app"); verify(regCenter).remove("/state/disable/app/test_app"); } @Test - public void assertIsDisabled() { + void assertIsDisabled() { when(regCenter.isExisted("/state/disable/app/test_app")).thenReturn(true); assertTrue(disableAppService.isDisabled("test_app")); verify(regCenter).isExisted("/state/disable/app/test_app"); } @Test - public void assertIsEnabled() { + void assertIsEnabled() { when(regCenter.isExisted("/state/disable/app/test_app")).thenReturn(false); assertFalse(disableAppService.isDisabled("test_app")); verify(regCenter).isExisted("/state/disable/app/test_app"); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java index 22fd4773d6..212ad33904 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class CloudJobDisableListenerTest { +class CloudJobDisableListenerTest { private static ZookeeperRegistryCenter regCenter; @@ -49,7 +49,7 @@ public final class CloudJobDisableListenerTest { private CloudJobDisableListener cloudJobDisableListener; @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(cloudJobDisableListener, "producerManager", producerManager); initRegistryCenter(); ReflectionUtils.setFieldValue(cloudJobDisableListener, "regCenter", regCenter); @@ -66,27 +66,27 @@ private void initRegistryCenter() { } @Test - public void assertDisableWithInvalidPath() { + void assertDisableWithInvalidPath() { cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/other/test_job", null, "".getBytes())); verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); } @Test - public void assertDisableWithNoJobNamePath() { + void assertDisableWithNoJobNamePath() { cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/job", null, "".getBytes())); verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); } @Test - public void assertDisable() { + void assertDisable() { cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/job/job_test", null, "".getBytes())); verify(producerManager).unschedule(eq("job_test")); } @Test - public void assertEnableWithInvalidPath() { + void assertEnableWithInvalidPath() { cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/other/test_job", null, "".getBytes()), new ChildData("/other/test_job", null, "".getBytes())); verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); @@ -94,7 +94,7 @@ public void assertEnableWithInvalidPath() { } @Test - public void assertEnableWithNoJobNamePath() { + void assertEnableWithNoJobNamePath() { cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/job", null, "".getBytes()), new ChildData("/state/disable/job", null, "".getBytes())); verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); @@ -102,19 +102,19 @@ public void assertEnableWithNoJobNamePath() { } @Test - public void assertEnable() { + void assertEnable() { cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/job/job_test", null, "".getBytes()), new ChildData("/state/disable/job/job_test", null, "".getBytes())); verify(producerManager).reschedule(eq("job_test")); } @Test - public void assertStart() { + void assertStart() { cloudJobDisableListener.start(); } @Test - public void assertStop() { + void assertStop() { regCenter.addCacheData("/state/disable/job"); ReflectionUtils.setFieldValue(cloudJobDisableListener, "regCenter", regCenter); cloudJobDisableListener.stop(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java index bf62aad7ba..a4f5a4b193 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class DisableJobNodeTest { +class DisableJobNodeTest { @Test - public void assertGetDisableAppNodePath() { + void assertGetDisableAppNodePath() { assertThat(DisableJobNode.getDisableJobNodePath("test_job0000000001"), is("/state/disable/job/test_job0000000001")); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java index c0c7f41115..bbac784d71 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java @@ -30,7 +30,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class DisableJobServiceTest { +class DisableJobServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -38,32 +38,32 @@ public final class DisableJobServiceTest { private DisableJobService disableJobService; @BeforeEach - public void setUp() { + void setUp() { disableJobService = new DisableJobService(regCenter); } @Test - public void assertAdd() { + void assertAdd() { disableJobService.add("test_job"); verify(regCenter).isExisted("/state/disable/job/test_job"); verify(regCenter).persist("/state/disable/job/test_job", "test_job"); } @Test - public void assertRemove() { + void assertRemove() { disableJobService.remove("test_job"); verify(regCenter).remove("/state/disable/job/test_job"); } @Test - public void assertIsDisabled() { + void assertIsDisabled() { when(regCenter.isExisted("/state/disable/job/test_job")).thenReturn(true); assertTrue(disableJobService.isDisabled("test_job")); verify(regCenter).isExisted("/state/disable/job/test_job"); } @Test - public void assertIsEnabled() { + void assertIsEnabled() { when(regCenter.isExisted("/state/disable/job/test_job")).thenReturn(false); assertFalse(disableJobService.isDisabled("test_job")); verify(regCenter).isExisted("/state/disable/job/test_job"); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java index 56c418729a..e6443690bc 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java @@ -24,15 +24,15 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class FailoverNodeTest { +class FailoverNodeTest { @Test - public void assertGetFailoverJobNodePath() { + void assertGetFailoverJobNodePath() { assertThat(FailoverNode.getFailoverJobNodePath("test_job"), is("/state/failover/test_job")); } @Test - public void assertGetFailoverTaskNodePath() { + void assertGetFailoverTaskNodePath() { String jobNodePath = TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodePath(); assertThat(FailoverNode.getFailoverTaskNodePath(jobNodePath), is("/state/failover/test_job/" + jobNodePath)); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java index c7fc2ecd8d..7fa55733a0 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java @@ -49,7 +49,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class FailoverServiceTest { +class FailoverServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -63,14 +63,14 @@ public final class FailoverServiceTest { private FailoverService failoverService; @BeforeEach - public void setUp() { + void setUp() { failoverService = new FailoverService(regCenter); ReflectionUtils.setFieldValue(failoverService, "configService", configService); ReflectionUtils.setFieldValue(failoverService, "runningService", runningService); } @Test - public void assertAddWhenJobIsOverQueueSize() { + void assertAddWhenJobIsOverQueueSize() { when(regCenter.getNumChildren(FailoverNode.ROOT)).thenReturn(BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration().getJobStateQueueSize() + 1); TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); @@ -78,7 +78,7 @@ public void assertAddWhenJobIsOverQueueSize() { } @Test - public void assertAddWhenExisted() { + void assertAddWhenExisted() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(true); failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); @@ -87,7 +87,7 @@ public void assertAddWhenExisted() { } @Test - public void assertAddWhenNotExistedAndTaskIsRunning() { + void assertAddWhenNotExistedAndTaskIsRunning() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(false); when(runningService.isTaskRunning(MetaInfo.from(taskNode.getTaskNodePath()))).thenReturn(true); @@ -98,7 +98,7 @@ public void assertAddWhenNotExistedAndTaskIsRunning() { } @Test - public void assertAddWhenNotExistedAndTaskIsNotRunning() { + void assertAddWhenNotExistedAndTaskIsNotRunning() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(false); when(runningService.isTaskRunning(MetaInfo.from(taskNode.getTaskNodePath()))).thenReturn(false); @@ -109,14 +109,14 @@ public void assertAddWhenNotExistedAndTaskIsNotRunning() { } @Test - public void assertGetAllEligibleJobContextsWithoutRootNode() { + void assertGetAllEligibleJobContextsWithoutRootNode() { when(regCenter.isExisted("/state/failover")).thenReturn(false); assertTrue(failoverService.getAllEligibleJobContexts().isEmpty()); verify(regCenter).isExisted("/state/failover"); } @Test - public void assertGetAllEligibleJobContextsWithRootNode() { + void assertGetAllEligibleJobContextsWithRootNode() { when(regCenter.isExisted("/state/failover")).thenReturn(true); when(regCenter.getChildrenKeys("/state/failover")).thenReturn(Arrays.asList("task_empty_job", "not_existed_job", "eligible_job")); when(regCenter.getChildrenKeys("/state/failover/task_empty_job")).thenReturn(Collections.emptyList()); @@ -139,7 +139,7 @@ public void assertGetAllEligibleJobContextsWithRootNode() { } @Test - public void assertRemove() { + void assertRemove() { String jobNodePath1 = TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodePath(); String jobNodePath2 = TaskNode.builder().shardingItem(1).type(ExecutionType.FAILOVER).build().getTaskNodePath(); failoverService.remove(Arrays.asList(MetaInfo.from(jobNodePath1), MetaInfo.from(jobNodePath2))); @@ -148,7 +148,7 @@ public void assertRemove() { } @Test - public void assertGetTaskId() { + void assertGetTaskId() { TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(true); @@ -160,14 +160,14 @@ public void assertGetTaskId() { } @Test - public void assertGetAllFailoverTasksWithoutRootNode() { + void assertGetAllFailoverTasksWithoutRootNode() { when(regCenter.isExisted(FailoverNode.ROOT)).thenReturn(false); assertTrue(failoverService.getAllFailoverTasks().isEmpty()); verify(regCenter).isExisted(FailoverNode.ROOT); } @Test - public void assertGetAllFailoverTasksWhenRootNodeHasNoChild() { + void assertGetAllFailoverTasksWhenRootNodeHasNoChild() { when(regCenter.isExisted(FailoverNode.ROOT)).thenReturn(true); when(regCenter.getChildrenKeys(FailoverNode.ROOT)).thenReturn(Collections.emptyList()); assertTrue(failoverService.getAllFailoverTasks().isEmpty()); @@ -176,7 +176,7 @@ public void assertGetAllFailoverTasksWhenRootNodeHasNoChild() { } @Test - public void assertGetAllFailoverTasksWhenJobNodeHasNoChild() { + void assertGetAllFailoverTasksWhenJobNodeHasNoChild() { when(regCenter.isExisted(FailoverNode.ROOT)).thenReturn(true); when(regCenter.getChildrenKeys(FailoverNode.ROOT)).thenReturn(Collections.singletonList("test_job")); when(regCenter.getChildrenKeys(FailoverNode.getFailoverJobNodePath("test_job"))).thenReturn(Collections.emptyList()); @@ -187,7 +187,7 @@ public void assertGetAllFailoverTasksWhenJobNodeHasNoChild() { } @Test - public void assertGetAllFailoverTasksWithRootNode() { + void assertGetAllFailoverTasksWithRootNode() { String uuid1 = UUID.randomUUID().toString(); String uuid2 = UUID.randomUUID().toString(); String uuid3 = UUID.randomUUID().toString(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java index 1f685a12f7..aa59c75ad5 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class ReadyNodeTest { +class ReadyNodeTest { @Test - public void assertGetReadyJobNodePath() { + void assertGetReadyJobNodePath() { assertThat(ReadyNode.getReadyJobNodePath("test_job0000000001"), is("/state/ready/test_job0000000001")); } } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java index b07513ae83..bf03950ca1 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ReadyServiceTest { +class ReadyServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -61,14 +61,14 @@ public final class ReadyServiceTest { private ReadyService readyService; @BeforeEach - public void setUp() { + void setUp() { readyService = new ReadyService(regCenter); ReflectionUtils.setFieldValue(readyService, "configService", configService); ReflectionUtils.setFieldValue(readyService, "runningService", runningService); } @Test - public void assertAddTransientWithJobConfigIsNotPresent() { + void assertAddTransientWithJobConfigIsNotPresent() { when(configService.load("test_job")).thenReturn(Optional.empty()); readyService.addTransient("test_job"); verify(regCenter, times(0)).isExisted("/state/ready"); @@ -76,7 +76,7 @@ public void assertAddTransientWithJobConfigIsNotPresent() { } @Test - public void assertAddTransientWithJobConfigIsNotTransient() { + void assertAddTransientWithJobConfigIsNotTransient() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); readyService.addTransient("test_job"); verify(regCenter, times(0)).isExisted("/state/ready"); @@ -84,7 +84,7 @@ public void assertAddTransientWithJobConfigIsNotTransient() { } @Test - public void assertAddTransientWhenJobExistedAndEnableMisfired() { + void assertAddTransientWhenJobExistedAndEnableMisfired() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); when(regCenter.getDirectly("/state/ready/test_job")).thenReturn("1"); readyService.addTransient("test_job"); @@ -92,7 +92,7 @@ public void assertAddTransientWhenJobExistedAndEnableMisfired() { } @Test - public void assertAddTransientWhenJobExistedAndDisableMisfired() { + void assertAddTransientWhenJobExistedAndDisableMisfired() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", false))); when(regCenter.getDirectly("/state/ready/test_job")).thenReturn("1"); readyService.addTransient("test_job"); @@ -100,28 +100,28 @@ public void assertAddTransientWhenJobExistedAndDisableMisfired() { } @Test - public void assertAddTransientWhenJobNotExisted() { + void assertAddTransientWhenJobNotExisted() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); readyService.addTransient("test_job"); verify(regCenter).persist("/state/ready/test_job", "1"); } @Test - public void assertAddTransientWithOverJobQueueSize() { + void assertAddTransientWithOverJobQueueSize() { when(regCenter.getNumChildren(ReadyNode.ROOT)).thenReturn(BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration().getJobStateQueueSize() + 1); readyService.addTransient("test_job"); verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); } @Test - public void assertAddDaemonWithOverJobQueueSize() { + void assertAddDaemonWithOverJobQueueSize() { when(regCenter.getNumChildren(ReadyNode.ROOT)).thenReturn(BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration().getJobStateQueueSize() + 1); readyService.addDaemon("test_job"); verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); } @Test - public void assertAddDaemonWithJobConfigIsNotPresent() { + void assertAddDaemonWithJobConfigIsNotPresent() { when(configService.load("test_job")).thenReturn(Optional.empty()); readyService.addDaemon("test_job"); verify(regCenter, times(0)).isExisted("/state/ready"); @@ -129,7 +129,7 @@ public void assertAddDaemonWithJobConfigIsNotPresent() { } @Test - public void assertAddDaemonWithJobConfigIsNotDaemon() { + void assertAddDaemonWithJobConfigIsNotDaemon() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); readyService.addDaemon("test_job"); verify(regCenter, times(0)).isExisted("/state/ready"); @@ -137,21 +137,21 @@ public void assertAddDaemonWithJobConfigIsNotDaemon() { } @Test - public void assertAddDaemonWithoutRootNode() { + void assertAddDaemonWithoutRootNode() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); readyService.addDaemon("test_job"); verify(regCenter).persist("/state/ready/test_job", "1"); } @Test - public void assertAddDaemonWithSameJobName() { + void assertAddDaemonWithSameJobName() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); readyService.addDaemon("test_job"); verify(regCenter).persist(ArgumentMatchers.any(), ArgumentMatchers.eq("1")); } @Test - public void assertAddRunningDaemon() { + void assertAddRunningDaemon() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); when(runningService.isJobRunning("test_job")).thenReturn(true); readyService.addDaemon("test_job"); @@ -159,35 +159,35 @@ public void assertAddRunningDaemon() { } @Test - public void assertAddDaemonWithoutSameJobName() { + void assertAddDaemonWithoutSameJobName() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); readyService.addDaemon("test_job"); verify(regCenter).persist("/state/ready/test_job", "1"); } @Test - public void assertGetAllEligibleJobContextsWithoutRootNode() { + void assertGetAllEligibleJobContextsWithoutRootNode() { when(regCenter.isExisted("/state/ready")).thenReturn(false); assertTrue(readyService.getAllEligibleJobContexts(Collections.emptyList()).isEmpty()); verify(regCenter).isExisted("/state/ready"); } @Test - public void assertSetMisfireDisabledWhenJobIsNotExisted() { + void assertSetMisfireDisabledWhenJobIsNotExisted() { when(configService.load("test_job")).thenReturn(Optional.empty()); readyService.setMisfireDisabled("test_job"); verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); } @Test - public void assertSetMisfireDisabledWhenReadyNodeNotExisted() { + void assertSetMisfireDisabledWhenReadyNodeNotExisted() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); readyService.setMisfireDisabled("test_job"); verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); } @Test - public void assertSetMisfireDisabledWhenReadyNodeExisted() { + void assertSetMisfireDisabledWhenReadyNodeExisted() { when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); when(regCenter.getDirectly("/state/ready/test_job")).thenReturn("100"); readyService.setMisfireDisabled("test_job"); @@ -195,7 +195,7 @@ public void assertSetMisfireDisabledWhenReadyNodeExisted() { } @Test - public void assertGetAllEligibleJobContextsWithRootNode() { + void assertGetAllEligibleJobContextsWithRootNode() { when(regCenter.isExisted("/state/ready")).thenReturn(true); when(regCenter.getChildrenKeys("/state/ready")).thenReturn(Arrays.asList("not_existed_job", "running_job", "ineligible_job", "eligible_job")); when(configService.load("not_existed_job")).thenReturn(Optional.empty()); @@ -214,7 +214,7 @@ public void assertGetAllEligibleJobContextsWithRootNode() { } @Test - public void assertGetAllEligibleJobContextsWithRootNodeAndDaemonJob() { + void assertGetAllEligibleJobContextsWithRootNodeAndDaemonJob() { when(regCenter.isExisted("/state/ready")).thenReturn(true); when(regCenter.getChildrenKeys("/state/ready")).thenReturn(Arrays.asList("not_existed_job", "running_job")); when(configService.load("not_existed_job")).thenReturn(Optional.empty()); @@ -228,7 +228,7 @@ public void assertGetAllEligibleJobContextsWithRootNodeAndDaemonJob() { } @Test - public void assertRemove() { + void assertRemove() { when(regCenter.getDirectly("/state/ready/test_job_1")).thenReturn("1"); when(regCenter.getDirectly("/state/ready/test_job_2")).thenReturn("2"); readyService.remove(Arrays.asList("test_job_1", "test_job_2")); @@ -239,7 +239,7 @@ public void assertRemove() { } @Test - public void assertGetAllTasksWithoutRootNode() { + void assertGetAllTasksWithoutRootNode() { when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(false); assertTrue(readyService.getAllReadyTasks().isEmpty()); verify(regCenter).isExisted(ReadyNode.ROOT); @@ -248,7 +248,7 @@ public void assertGetAllTasksWithoutRootNode() { } @Test - public void assertGetAllTasksWhenRootNodeHasNoChild() { + void assertGetAllTasksWhenRootNodeHasNoChild() { when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(true); when(regCenter.getChildrenKeys(ReadyNode.ROOT)).thenReturn(Collections.emptyList()); assertTrue(readyService.getAllReadyTasks().isEmpty()); @@ -258,7 +258,7 @@ public void assertGetAllTasksWhenRootNodeHasNoChild() { } @Test - public void assertGetAllTasksWhenNodeIsEmpty() { + void assertGetAllTasksWhenNodeIsEmpty() { when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(true); when(regCenter.getChildrenKeys(ReadyNode.ROOT)).thenReturn(Collections.singletonList("test_job")); when(regCenter.get(ReadyNode.getReadyJobNodePath("test_job"))).thenReturn(""); @@ -269,7 +269,7 @@ public void assertGetAllTasksWhenNodeIsEmpty() { } @Test - public void assertGetAllTasksWithRootNode() { + void assertGetAllTasksWithRootNode() { when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(true); when(regCenter.getChildrenKeys(ReadyNode.ROOT)).thenReturn(Arrays.asList("test_job_1", "test_job_2")); when(regCenter.get(ReadyNode.getReadyJobNodePath("test_job_1"))).thenReturn("1"); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java index 320a806e50..a0df3815ba 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java @@ -23,15 +23,15 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class RunningNodeTest { +class RunningNodeTest { @Test - public void assertGetRunningJobNodePath() { + void assertGetRunningJobNodePath() { assertThat(RunningNode.getRunningJobNodePath("test_job"), is("/state/running/test_job")); } @Test - public void assertGetRunningTaskNodePath() { + void assertGetRunningTaskNodePath() { String nodePath = TaskNode.builder().build().getTaskNodePath(); assertThat(RunningNode.getRunningTaskNodePath(nodePath), is("/state/running/test_job/" + nodePath)); } diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java index 9e209afe6d..bfcadc93b8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java @@ -44,7 +44,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class RunningServiceTest { +class RunningServiceTest { private TaskContext taskContext; @@ -56,7 +56,7 @@ public final class RunningServiceTest { private RunningService runningService; @BeforeEach - public void setUp() { + void setUp() { when(regCenter.get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson(CloudJobExecutionType.DAEMON)); when(regCenter.get("/config/job/test_job_t")).thenReturn(CloudJsonConstants.getJobJson("test_job_t")); runningService = new RunningService(regCenter); @@ -72,12 +72,12 @@ public void setUp() { } @AfterEach - public void tearDown() { + void tearDown() { runningService.clear(); } @Test - public void assertStart() { + void assertStart() { TaskNode taskNode1 = TaskNode.builder().jobName("test_job").shardingItem(0).slaveId("111").type(ExecutionType.READY).uuid(UUID.randomUUID().toString()).build(); TaskNode taskNode2 = TaskNode.builder().jobName("test_job").shardingItem(1).slaveId("222").type(ExecutionType.FAILOVER).uuid(UUID.randomUUID().toString()).build(); when(regCenter.getChildrenKeys(RunningNode.ROOT)).thenReturn(Collections.singletonList("test_job")); @@ -89,7 +89,7 @@ public void assertStart() { } @Test - public void assertAddWithoutData() { + void assertAddWithoutData() { assertThat(runningService.getRunningTasks("test_job").size(), is(1)); assertThat(runningService.getRunningTasks("test_job").iterator().next(), is(taskContext)); assertThat(runningService.getRunningTasks("test_job_t").size(), is(1)); @@ -97,7 +97,7 @@ public void assertAddWithoutData() { } @Test - public void assertAddWithData() { + void assertAddWithData() { when(regCenter.get("/config/job/other_job")).thenReturn(CloudJsonConstants.getJobJson("other_job")); TaskNode taskNode = TaskNode.builder().jobName("other_job").build(); runningService.add(TaskContext.from(taskNode.getTaskNodeValue())); @@ -106,14 +106,14 @@ public void assertAddWithData() { } @Test - public void assertUpdateIdle() { + void assertUpdateIdle() { runningService.updateIdle(taskContext, true); assertThat(runningService.getRunningTasks("test_job").size(), is(1)); assertTrue(runningService.getRunningTasks("test_job").iterator().next().isIdle()); } @Test - public void assertRemoveByJobName() { + void assertRemoveByJobName() { runningService.remove("test_job"); assertTrue(runningService.getRunningTasks("test_job").isEmpty()); verify(regCenter).remove(RunningNode.getRunningJobNodePath("test_job")); @@ -122,7 +122,7 @@ public void assertRemoveByJobName() { } @Test - public void assertRemoveByTaskContext() { + void assertRemoveByTaskContext() { when(regCenter.isExisted(RunningNode.getRunningJobNodePath("test_job"))).thenReturn(true); when(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath("test_job"))).thenReturn(Collections.emptyList()); runningService.remove(taskContext); @@ -133,22 +133,22 @@ public void assertRemoveByTaskContext() { } @Test - public void assertIsJobRunning() { + void assertIsJobRunning() { assertTrue(runningService.isJobRunning("test_job")); } @Test - public void assertIsTaskRunning() { + void assertIsTaskRunning() { assertTrue(runningService.isTaskRunning(MetaInfo.from(TaskNode.builder().build().getTaskNodePath()))); } @Test - public void assertIsTaskNotRunning() { + void assertIsTaskNotRunning() { assertFalse(runningService.isTaskRunning(MetaInfo.from(TaskNode.builder().shardingItem(2).build().getTaskNodePath()))); } @Test - public void assertMappingOperate() { + void assertMappingOperate() { String taskId = TaskNode.builder().build().getTaskNodeValue(); assertNull(runningService.popMapping(taskId)); runningService.addMapping(taskId, "localhost"); @@ -157,7 +157,7 @@ public void assertMappingOperate() { } @Test - public void assertClear() { + void assertClear() { assertFalse(runningService.getRunningTasks("test_job").isEmpty()); runningService.addMapping(TaskNode.builder().build().getTaskNodeValue(), "localhost"); runningService.clear(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java index e86db674c8..de9ef44749 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java @@ -50,7 +50,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class StatisticManagerTest { +class StatisticManagerTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -67,12 +67,12 @@ public final class StatisticManagerTest { private StatisticManager statisticManager; @BeforeEach - public void setUp() { + void setUp() { statisticManager = StatisticManager.getInstance(regCenter, null); } @AfterEach - public void tearDown() { + void tearDown() { statisticManager.shutdown(); ReflectionUtils.setStaticFieldValue(StatisticManager.class, "instance", null); reset(configurationService); @@ -80,37 +80,37 @@ public void tearDown() { } @Test - public void assertGetInstance() { + void assertGetInstance() { assertThat(statisticManager, is(StatisticManager.getInstance(regCenter, null))); } @Test - public void assertStartupWhenRdbIsNotConfigured() { + void assertStartupWhenRdbIsNotConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); statisticManager.startup(); } @Test - public void assertStartupWhenRdbIsConfigured() { + void assertStartupWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); statisticManager.startup(); } @Test - public void assertShutdown() { + void assertShutdown() { ReflectionUtils.setFieldValue(statisticManager, "scheduler", scheduler); statisticManager.shutdown(); verify(scheduler).shutdown(); } @Test - public void assertTaskRun() { + void assertTaskRun() { statisticManager.taskRunSuccessfully(); statisticManager.taskRunFailed(); } @Test - public void assertTaskResultStatisticsWhenRdbIsNotConfigured() { + void assertTaskResultStatisticsWhenRdbIsNotConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); assertThat(statisticManager.getTaskResultStatisticsWeekly().getSuccessCount(), is(0)); assertThat(statisticManager.getTaskResultStatisticsWeekly().getFailedCount(), is(0)); @@ -119,7 +119,7 @@ public void assertTaskResultStatisticsWhenRdbIsNotConfigured() { } @Test - public void assertTaskResultStatisticsWhenRdbIsConfigured() { + void assertTaskResultStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.getSummedTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) .thenReturn(new TaskResultStatistics(10, 10, StatisticInterval.DAY, new Date())); @@ -131,7 +131,7 @@ public void assertTaskResultStatisticsWhenRdbIsConfigured() { } @Test - public void assertJobExecutionTypeStatistics() { + void assertJobExecutionTypeStatistics() { ReflectionUtils.setFieldValue(statisticManager, "configurationService", configurationService); when(configurationService.loadAll()).thenReturn(Arrays.asList( CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_1", CloudJobExecutionType.DAEMON), @@ -142,13 +142,13 @@ public void assertJobExecutionTypeStatistics() { } @Test - public void assertFindTaskRunningStatisticsWhenRdbIsNotConfigured() { + void assertFindTaskRunningStatisticsWhenRdbIsNotConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); assertTrue(statisticManager.findTaskRunningStatisticsWeekly().isEmpty()); } @Test - public void assertFindTaskRunningStatisticsWhenRdbIsConfigured() { + void assertFindTaskRunningStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.findTaskRunningStatistics(any(Date.class))).thenReturn(Collections.singletonList(new TaskRunningStatistics(10, new Date()))); assertThat(statisticManager.findTaskRunningStatisticsWeekly().size(), is(1)); @@ -156,13 +156,13 @@ public void assertFindTaskRunningStatisticsWhenRdbIsConfigured() { } @Test - public void assertFindJobRunningStatisticsWhenRdbIsNotConfigured() { + void assertFindJobRunningStatisticsWhenRdbIsNotConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); assertTrue(statisticManager.findJobRunningStatisticsWeekly().isEmpty()); } @Test - public void assertFindJobRunningStatisticsWhenRdbIsConfigured() { + void assertFindJobRunningStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.findJobRunningStatistics(any(Date.class))).thenReturn(Collections.singletonList(new JobRunningStatistics(10, new Date()))); assertThat(statisticManager.findJobRunningStatisticsWeekly().size(), is(1)); @@ -170,13 +170,13 @@ public void assertFindJobRunningStatisticsWhenRdbIsConfigured() { } @Test - public void assertFindJobRegisterStatisticsWhenRdbIsNotConfigured() { + void assertFindJobRegisterStatisticsWhenRdbIsNotConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); assertTrue(statisticManager.findJobRegisterStatisticsSinceOnline().isEmpty()); } @Test - public void assertFindJobRegisterStatisticsWhenRdbIsConfigured() { + void assertFindJobRegisterStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.findJobRegisterStatistics(any(Date.class))).thenReturn(Collections.singletonList(new JobRegisterStatistics(10, new Date()))); assertThat(statisticManager.findJobRegisterStatisticsSinceOnline().size(), is(1)); @@ -184,7 +184,7 @@ public void assertFindJobRegisterStatisticsWhenRdbIsConfigured() { } @Test - public void assertFindLatestTaskResultStatisticsWhenRdbIsNotConfigured() { + void assertFindLatestTaskResultStatisticsWhenRdbIsNotConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); for (StatisticInterval each : StatisticInterval.values()) { TaskResultStatistics actual = statisticManager.findLatestTaskResultStatistics(each); @@ -194,7 +194,7 @@ public void assertFindLatestTaskResultStatisticsWhenRdbIsNotConfigured() { } @Test - public void assertFindLatestTaskResultStatisticsWhenRdbIsConfigured() { + void assertFindLatestTaskResultStatisticsWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); for (StatisticInterval each : StatisticInterval.values()) { when(rdbRepository.findLatestTaskResultStatistics(each)) @@ -207,13 +207,13 @@ public void assertFindLatestTaskResultStatisticsWhenRdbIsConfigured() { } @Test - public void assertFindTaskResultStatisticsDailyWhenRdbIsNotConfigured() { + void assertFindTaskResultStatisticsDailyWhenRdbIsNotConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); assertTrue(statisticManager.findTaskResultStatisticsDaily().isEmpty()); } @Test - public void assertFindTaskResultStatisticsDailyWhenRdbIsConfigured() { + void assertFindTaskResultStatisticsDailyWhenRdbIsConfigured() { ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); when(rdbRepository.findTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) .thenReturn(Collections.singletonList(new TaskResultStatistics(10, 5, StatisticInterval.MINUTE, new Date()))); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java index 039d60c9b5..24a594c79a 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java @@ -32,7 +32,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class StatisticsSchedulerTest { +class StatisticsSchedulerTest { private StatisticsScheduler statisticsScheduler; @@ -40,20 +40,20 @@ public class StatisticsSchedulerTest { private Scheduler scheduler; @BeforeEach - public void setUp() { + void setUp() { statisticsScheduler = new StatisticsScheduler(); ReflectionUtils.setFieldValue(statisticsScheduler, "scheduler", scheduler); } @Test - public void assertRegister() throws SchedulerException { + void assertRegister() throws SchedulerException { StatisticJob job = new TestStatisticJob(); statisticsScheduler.register(job); verify(scheduler).scheduleJob(job.buildJobDetail(), job.buildTrigger()); } @Test - public void assertShutdown() throws SchedulerException { + void assertShutdown() throws SchedulerException { when(scheduler.isShutdown()).thenReturn(false); statisticsScheduler.shutdown(); when(scheduler.isShutdown()).thenReturn(true); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java index 8047204227..6fed73a2b8 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java @@ -23,17 +23,17 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public class TaskResultMetaDataTest { +class TaskResultMetaDataTest { private TaskResultMetaData metaData; @BeforeEach - public void setUp() { + void setUp() { metaData = new TaskResultMetaData(); } @Test - public void assertIncrementAndGet() { + void assertIncrementAndGet() { for (int i = 0; i < 100; i++) { assertThat(metaData.incrementAndGetSuccessCount(), is(i + 1)); assertThat(metaData.incrementAndGetFailedCount(), is(i + 1)); @@ -43,7 +43,7 @@ public void assertIncrementAndGet() { } @Test - public void assertReset() { + void assertReset() { for (int i = 0; i < 100; i++) { metaData.incrementAndGetSuccessCount(); metaData.incrementAndGetFailedCount(); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java index f732f2a909..922409aabc 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java @@ -27,27 +27,27 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public class BaseStatisticJobTest { +class BaseStatisticJobTest { private TestStatisticJob testStatisticJob; @BeforeEach - public void setUp() { + void setUp() { testStatisticJob = new TestStatisticJob(); } @Test - public void assertGetTriggerName() { + void assertGetTriggerName() { assertThat(testStatisticJob.getTriggerName(), is(TestStatisticJob.class.getSimpleName() + "Trigger")); } @Test - public void assertGetJobName() { + void assertGetJobName() { assertThat(testStatisticJob.getJobName(), is(TestStatisticJob.class.getSimpleName())); } @Test - public void assertFindBlankStatisticTimes() { + void assertFindBlankStatisticTimes() { for (StatisticInterval each : StatisticInterval.values()) { int num = -2; for (Date eachTime : testStatisticJob.findBlankStatisticTimes(StatisticTimeUtils.getStatisticTime(each, num - 1), each)) { diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java index 82103b9b99..0ffdc5a98e 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class JobRunningStatisticJobTest { +class JobRunningStatisticJobTest { @Mock private RunningService runningService; @@ -58,31 +58,31 @@ public class JobRunningStatisticJobTest { private JobRunningStatisticJob jobRunningStatisticJob; @BeforeEach - public void setUp() { + void setUp() { jobRunningStatisticJob = new JobRunningStatisticJob(); jobRunningStatisticJob.setRunningService(runningService); jobRunningStatisticJob.setRepository(repository); } @Test - public void assertBuildJobDetail() { + void assertBuildJobDetail() { assertThat(jobRunningStatisticJob.buildJobDetail().getKey().getName(), is(JobRunningStatisticJob.class.getSimpleName())); } @Test - public void assertBuildTrigger() { + void assertBuildTrigger() { Trigger trigger = jobRunningStatisticJob.buildTrigger(); assertThat(trigger.getKey().getName(), is(JobRunningStatisticJob.class.getSimpleName() + "Trigger")); } @Test - public void assertGetDataMap() { + void assertGetDataMap() { assertThat(jobRunningStatisticJob.getDataMap().get("runningService"), is(runningService)); assertThat(jobRunningStatisticJob.getDataMap().get("repository"), is(repository)); } @Test - public void assertExecuteWhenRepositoryIsEmpty() { + void assertExecuteWhenRepositoryIsEmpty() { Optional latestJobRunningStatistics = Optional.empty(); Optional latestTaskRunningStatistics = Optional.empty(); when(repository.findLatestJobRunningStatistics()).thenReturn(latestJobRunningStatistics); @@ -98,7 +98,7 @@ public void assertExecuteWhenRepositoryIsEmpty() { } @Test - public void assertExecute() { + void assertExecute() { Optional latestJobRunningStatistics = Optional.of(new JobRunningStatistics(0, StatisticTimeUtils.getStatisticTime(StatisticInterval.MINUTE, -3))); Optional latestTaskRunningStatistics = Optional.of(new TaskRunningStatistics(0, StatisticTimeUtils.getStatisticTime(StatisticInterval.MINUTE, -3))); when(repository.findLatestJobRunningStatistics()).thenReturn(latestJobRunningStatistics); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java index db32d5eb90..53593f5f37 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class RegisteredJobStatisticJobTest { +class RegisteredJobStatisticJobTest { @Mock private CloudJobConfigurationService configurationService; @@ -52,31 +52,31 @@ public class RegisteredJobStatisticJobTest { private RegisteredJobStatisticJob registeredJobStatisticJob; @BeforeEach - public void setUp() { + void setUp() { registeredJobStatisticJob = new RegisteredJobStatisticJob(); registeredJobStatisticJob.setConfigurationService(configurationService); registeredJobStatisticJob.setRepository(repository); } @Test - public void assertBuildJobDetail() { + void assertBuildJobDetail() { assertThat(registeredJobStatisticJob.buildJobDetail().getKey().getName(), is(RegisteredJobStatisticJob.class.getSimpleName())); } @Test - public void assertBuildTrigger() { + void assertBuildTrigger() { Trigger trigger = registeredJobStatisticJob.buildTrigger(); assertThat(trigger.getKey().getName(), is(RegisteredJobStatisticJob.class.getSimpleName() + "Trigger")); } @Test - public void assertGetDataMap() { + void assertGetDataMap() { assertThat(registeredJobStatisticJob.getDataMap().get("configurationService"), is(configurationService)); assertThat(registeredJobStatisticJob.getDataMap().get("repository"), is(repository)); } @Test - public void assertExecuteWhenRepositoryIsEmpty() { + void assertExecuteWhenRepositoryIsEmpty() { Optional latestOne = Optional.empty(); when(repository.findLatestJobRegisterStatistics()).thenReturn(latestOne); when(repository.add(any(JobRegisterStatistics.class))).thenReturn(true); @@ -88,7 +88,7 @@ public void assertExecuteWhenRepositoryIsEmpty() { } @Test - public void assertExecute() { + void assertExecute() { Optional latestOne = Optional.of(new JobRegisterStatistics(0, StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -3))); when(repository.findLatestJobRegisterStatistics()).thenReturn(latestOne); when(repository.add(any(JobRegisterStatistics.class))).thenReturn(true); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java index c06375aeba..e4f340e160 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class TaskResultStatisticJobTest { +class TaskResultStatisticJobTest { private final StatisticInterval statisticInterval = StatisticInterval.MINUTE; @@ -51,7 +51,7 @@ public class TaskResultStatisticJobTest { private TaskResultStatisticJob taskResultStatisticJob; @BeforeEach - public void setUp() { + void setUp() { taskResultStatisticJob = new TaskResultStatisticJob(); sharedData = new TaskResultMetaData(); taskResultStatisticJob.setStatisticInterval(statisticInterval); @@ -60,12 +60,12 @@ public void setUp() { } @Test - public void assertBuildJobDetail() { + void assertBuildJobDetail() { assertThat(taskResultStatisticJob.buildJobDetail().getKey().getName(), is(TaskResultStatisticJob.class.getSimpleName() + "_" + statisticInterval)); } @Test - public void assertBuildTrigger() { + void assertBuildTrigger() { for (StatisticInterval each : StatisticInterval.values()) { taskResultStatisticJob.setStatisticInterval(each); Trigger trigger = taskResultStatisticJob.buildTrigger(); @@ -74,14 +74,14 @@ public void assertBuildTrigger() { } @Test - public void assertGetDataMap() { + void assertGetDataMap() { assertThat(taskResultStatisticJob.getDataMap().get("statisticInterval"), is(statisticInterval)); assertThat(taskResultStatisticJob.getDataMap().get("sharedData"), is(sharedData)); assertThat(taskResultStatisticJob.getDataMap().get("repository"), is(repository)); } @Test - public void assertExecuteWhenRepositoryIsEmpty() { + void assertExecuteWhenRepositoryIsEmpty() { Optional latestOne = Optional.empty(); for (StatisticInterval each : StatisticInterval.values()) { taskResultStatisticJob.setStatisticInterval(each); @@ -94,7 +94,7 @@ public void assertExecuteWhenRepositoryIsEmpty() { } @Test - public void assertExecute() { + void assertExecute() { for (StatisticInterval each : StatisticInterval.values()) { taskResultStatisticJob.setStatisticInterval(each); Optional latestOne = Optional.of(new TaskResultStatistics(0, 0, each, StatisticTimeUtils.getStatisticTime(each, -3))); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java index 0e92ba7901..b13a1463e1 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java @@ -17,26 +17,26 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; +import org.junit.jupiter.api.Test; import java.text.SimpleDateFormat; import java.util.Date; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.junit.jupiter.api.Test; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; -public class StatisticTimeUtilsTest { +class StatisticTimeUtilsTest { @Test - public void assertGetCurrentStatisticTime() { + void assertGetCurrentStatisticTime() { assertThat(getTimeStr(StatisticTimeUtils.getCurrentStatisticTime(StatisticInterval.MINUTE), StatisticInterval.MINUTE), is(getTimeStr(getNow(), StatisticInterval.MINUTE))); assertThat(getTimeStr(StatisticTimeUtils.getCurrentStatisticTime(StatisticInterval.HOUR), StatisticInterval.HOUR), is(getTimeStr(getNow(), StatisticInterval.HOUR))); assertThat(getTimeStr(StatisticTimeUtils.getCurrentStatisticTime(StatisticInterval.DAY), StatisticInterval.DAY), is(getTimeStr(getNow(), StatisticInterval.DAY))); } @Test - public void assertGetStatisticTime() { + void assertGetStatisticTime() { assertThat(getTimeStr(StatisticTimeUtils.getStatisticTime(StatisticInterval.MINUTE, -1), StatisticInterval.MINUTE), is(getTimeStr(getLastMinute(), StatisticInterval.MINUTE))); assertThat(getTimeStr(StatisticTimeUtils.getStatisticTime(StatisticInterval.HOUR, -1), StatisticInterval.HOUR), is(getTimeStr(getLastHour(), StatisticInterval.HOUR))); assertThat(getTimeStr(StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -1), StatisticInterval.DAY), is(getTimeStr(getYesterday(), StatisticInterval.DAY))); diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java index 79567d986c..6a1f3591be 100644 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java @@ -17,34 +17,35 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.util; +import org.junit.jupiter.api.Test; + import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.StandardCharsets; -import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class IOUtilsTest { +class IOUtilsTest { @Test - public void assertToStringFromInputStream() throws Exception { + void assertToStringFromInputStream() throws Exception { byte[] b = "toStringFromInputStream".getBytes(StandardCharsets.UTF_8); InputStream in = new ByteArrayInputStream(b); assertThat(IOUtils.toString(in, null), is("toStringFromInputStream")); } @Test - public void assertToStringFromInputStreamWithEncoding() throws Exception { + void assertToStringFromInputStreamWithEncoding() throws Exception { byte[] b = "toStringFromInputStream".getBytes(StandardCharsets.UTF_8); InputStream in = new ByteArrayInputStream(b); assertThat(IOUtils.toString(in, "UTF-8"), is("toStringFromInputStream")); } @Test - public void assertToStringFromReader() throws Exception { + void assertToStringFromReader() throws Exception { byte[] b = "toStringFromReader".getBytes(StandardCharsets.UTF_8); InputStream is = new ByteArrayInputStream(b); Reader inr = new InputStreamReader(is, StandardCharsets.UTF_8); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index ec384a48f3..7cac93132b 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -28,15 +28,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class DingtalkJobErrorHandlerPropertiesValidatorTest { +class DingtalkJobErrorHandlerPropertiesValidatorTest { @BeforeEach - public void startup() { + void startup() { ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); } @Test - public void assertValidateWithNormal() { + void assertValidateWithNormal() { Properties properties = new Properties(); properties.setProperty(DingtalkPropertiesConstants.WEBHOOK, "webhook"); properties.setProperty(DingtalkPropertiesConstants.READ_TIMEOUT_MILLISECONDS, "1000"); @@ -46,7 +46,7 @@ public void assertValidateWithNormal() { } @Test - public void assertValidateWithPropsIsNull() { + void assertValidateWithPropsIsNull() { assertThrows(NullPointerException.class, () -> { DingtalkJobErrorHandlerPropertiesValidator actual = getValidator(); actual.validate(null); @@ -54,7 +54,7 @@ public void assertValidateWithPropsIsNull() { } @Test - public void assertValidateWithWebhookIsNull() { + void assertValidateWithWebhookIsNull() { DingtalkJobErrorHandlerPropertiesValidator actual = getValidator(); try { actual.validate(new Properties()); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index 2b78aa26e6..cf971e3a7a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -38,7 +38,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class DingtalkJobErrorHandlerTest { +class DingtalkJobErrorHandlerTest { private static final int PORT = 9875; @@ -50,7 +50,7 @@ public final class DingtalkJobErrorHandlerTest { @SuppressWarnings({"unchecked", "rawtypes"}) @BeforeAll - public static void init() { + static void init() { NettyRestfulServiceConfiguration config = new NettyRestfulServiceConfiguration(PORT); config.setHost(HOST); config.addControllerInstances(new DingtalkInternalController()); @@ -62,19 +62,19 @@ public static void init() { } @BeforeEach - public void setUp() { + void setUp() { appenderList.clear(); } @AfterAll - public static void close() { + static void close() { if (null != restfulService) { restfulService.shutdown(); } } @Test - public void assertHandleExceptionWithNotifySuccessful() { + void assertHandleExceptionWithNotifySuccessful() { DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:9875/send?access_token=mocked_token")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); @@ -84,7 +84,7 @@ public void assertHandleExceptionWithNotifySuccessful() { } @Test - public void assertHandleExceptionWithWrongToken() { + void assertHandleExceptionWithWrongToken() { DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:9875/send?access_token=wrong_token")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); @@ -94,7 +94,7 @@ public void assertHandleExceptionWithWrongToken() { } @Test - public void assertHandleExceptionWithUrlIsNotFound() { + void assertHandleExceptionWithUrlIsNotFound() { DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:9875/404")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); @@ -104,7 +104,7 @@ public void assertHandleExceptionWithUrlIsNotFound() { } @Test - public void assertHandleExceptionWithWrongUrl() { + void assertHandleExceptionWithWrongUrl() { DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createNoSignJobConfigurationProperties("http://wrongUrl")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); @@ -114,7 +114,7 @@ public void assertHandleExceptionWithWrongUrl() { } @Test - public void assertHandleExceptionWithNoSign() { + void assertHandleExceptionWithNoSign() { DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createNoSignJobConfigurationProperties("http://localhost:9875/send?access_token=mocked_token")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index adb0839a41..8fd94190f5 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -28,15 +28,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class EmailJobErrorHandlerPropertiesValidatorTest { +class EmailJobErrorHandlerPropertiesValidatorTest { @BeforeEach - public void startup() { + void startup() { ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); } @Test - public void assertValidateWithNormal() { + void assertValidateWithNormal() { Properties properties = new Properties(); properties.setProperty(EmailPropertiesConstants.HOST, "host"); properties.setProperty(EmailPropertiesConstants.SSL_TRUST, "*"); @@ -50,7 +50,7 @@ public void assertValidateWithNormal() { } @Test - public void assertValidateWithPropsIsNull() { + void assertValidateWithPropsIsNull() { assertThrows(NullPointerException.class, () -> { EmailJobErrorHandlerPropertiesValidator actual = getValidator(); actual.validate(null); @@ -58,7 +58,7 @@ public void assertValidateWithPropsIsNull() { } @Test - public void assertValidateWithHostIsNull() { + void assertValidateWithHostIsNull() { EmailJobErrorHandlerPropertiesValidator actual = getValidator(); try { actual.validate(new Properties()); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index bb2a4b5289..169f022872 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -46,7 +46,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class EmailJobErrorHandlerTest { +class EmailJobErrorHandlerTest { private static List appenderList; @@ -58,19 +58,19 @@ public final class EmailJobErrorHandlerTest { @SuppressWarnings({"unchecked", "rawtypes"}) @BeforeAll - public static void init() { + static void init() { ch.qos.logback.classic.Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(EmailJobErrorHandler.class); ListAppender appender = (ListAppender) log.getAppender("EmailJobErrorHandlerTestAppender"); appenderList = appender.list; } @BeforeEach - public void setUp() { + void setUp() { appenderList.clear(); } @Test - public void assertHandleExceptionWithMessagingException() { + void assertHandleExceptionWithMessagingException() { EmailJobErrorHandler emailJobErrorHandler = getEmailJobErrorHandler(createConfigurationProperties()); Throwable cause = new RuntimeException("test"); String jobName = "test_job"; @@ -82,7 +82,7 @@ public void assertHandleExceptionWithMessagingException() { @Test @SneakyThrows - public void assertHandleExceptionSucceedInSendingEmail() { + void assertHandleExceptionSucceedInSendingEmail() { EmailJobErrorHandler emailJobErrorHandler = getEmailJobErrorHandler(createConfigurationProperties()); setUpMockSession(session); setFieldValue(emailJobErrorHandler, "session", session); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java index c81f994dc4..d715f9dc94 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java @@ -28,20 +28,20 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class JobErrorHandlerFactoryTest { +class JobErrorHandlerFactoryTest { @Test - public void assertGetDefaultHandler() { + void assertGetDefaultHandler() { assertThat(JobErrorHandlerFactory.createHandler("", new Properties()).orElse(null), instanceOf(LogJobErrorHandler.class)); } @Test - public void assertGetInvalidHandler() { + void assertGetInvalidHandler() { assertThrows(JobConfigurationException.class, () -> JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException(""))); } @Test - public void assertGetHandler() { + void assertGetHandler() { assertThat(JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElse(null), instanceOf(ThrowJobErrorHandler.class)); } } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java index 0456d27c48..c574986ba3 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java @@ -38,13 +38,13 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class JobErrorHandlerReloadableTest { +class JobErrorHandlerReloadableTest { @Mock private JobErrorHandler mockJobErrorHandler; @Test - public void assertInitialize() { + void assertInitialize() { JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); String jobErrorHandlerType = "IGNORE"; JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(jobErrorHandlerType).build(); @@ -57,7 +57,7 @@ public void assertInitialize() { } @Test - public void assertReload() { + void assertReload() { JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); setField(jobErrorHandlerReloadable, "jobErrorHandler", mockJobErrorHandler); setField(jobErrorHandlerReloadable, "jobErrorHandlerType", "mock"); @@ -72,7 +72,7 @@ public void assertReload() { } @Test - public void assertUnnecessaryToReload() { + void assertUnnecessaryToReload() { JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); String jobErrorHandlerType = "IGNORE"; JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(jobErrorHandlerType).build(); @@ -84,7 +84,7 @@ public void assertUnnecessaryToReload() { } @Test - public void assertShutdown() { + void assertShutdown() { JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); setField(jobErrorHandlerReloadable, "jobErrorHandler", mockJobErrorHandler); jobErrorHandlerReloadable.close(); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java index 054ec2437c..fb92dbbe22 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java @@ -23,10 +23,10 @@ import java.util.Properties; -public final class IgnoreJobErrorHandlerTest { +class IgnoreJobErrorHandlerTest { @Test - public void assertHandleException() { + void assertHandleException() { JobErrorHandlerFactory.createHandler("IGNORE", new Properties()) .orElseThrow(() -> new JobConfigurationException("IGNORE error handler not found.")).handleException("test_job", new RuntimeException("test")); } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java index d487643763..f5bf335124 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java @@ -33,25 +33,25 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class LogJobErrorHandlerTest { +class LogJobErrorHandlerTest { private static List appenderList; @SuppressWarnings({"unchecked", "rawtypes"}) @BeforeAll - public static void setupLogger() { + static void setupLogger() { ch.qos.logback.classic.Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(LogJobErrorHandler.class); ListAppender appender = (ListAppender) log.getAppender("LogJobErrorHandlerTestAppender"); appenderList = appender.list; } @BeforeEach - public void setUp() { + void setUp() { appenderList.clear(); } @Test - public void assertHandleException() { + void assertHandleException() { LogJobErrorHandler actual = (LogJobErrorHandler) JobErrorHandlerFactory.createHandler("LOG", new Properties()).orElseThrow(() -> new JobConfigurationException("LOG error handler not found.")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java index 86b1ac5504..c9bfaa7d47 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java @@ -26,11 +26,11 @@ import static org.junit.jupiter.api.Assertions.assertThrows; -public final class ThrowJobErrorHandlerTest { +class ThrowJobErrorHandlerTest { @Test - public void assertHandleException() { - assertThrows(JobSystemException.class, () -> JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElseThrow(() -> new JobConfigurationException("THROW error handler not found.")) - .handleException("test_job", new RuntimeException("test"))); + void assertHandleException() { + assertThrows(JobSystemException.class, () -> JobErrorHandlerFactory.createHandler("THROW", new Properties()) + .orElseThrow(() -> new JobConfigurationException("THROW error handler not found.")).handleException("test_job", new RuntimeException("test"))); } } diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index 20e3353f2b..590ede1cbe 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -28,15 +28,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class WechatJobErrorHandlerPropertiesValidatorTest { +class WechatJobErrorHandlerPropertiesValidatorTest { @BeforeEach - public void startup() { + void startup() { ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); } @Test - public void assertValidateWithNormal() { + void assertValidateWithNormal() { Properties properties = new Properties(); properties.setProperty(WechatPropertiesConstants.WEBHOOK, "webhook"); properties.setProperty(WechatPropertiesConstants.READ_TIMEOUT_MILLISECONDS, "1000"); @@ -46,7 +46,7 @@ public void assertValidateWithNormal() { } @Test - public void assertValidateWithPropsIsNull() { + void assertValidateWithPropsIsNull() { assertThrows(NullPointerException.class, () -> { WechatJobErrorHandlerPropertiesValidator actual = getValidator(); actual.validate(null); @@ -54,7 +54,7 @@ public void assertValidateWithPropsIsNull() { } @Test - public void assertValidateWithWebhookIsNull() { + void assertValidateWithWebhookIsNull() { WechatJobErrorHandlerPropertiesValidator actual = getValidator(); try { actual.validate(new Properties()); diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index 790d19c6e4..b477210d45 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -38,7 +38,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class WechatJobErrorHandlerTest { +class WechatJobErrorHandlerTest { private static final int PORT = 9872; @@ -50,7 +50,7 @@ public final class WechatJobErrorHandlerTest { @SuppressWarnings({"unchecked", "rawtypes"}) @BeforeAll - public static void init() { + static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); configuration.addControllerInstances(new WechatInternalController()); @@ -62,19 +62,19 @@ public static void init() { } @BeforeEach - public void setUp() { + void setUp() { appenderList.clear(); } @AfterAll - public static void close() { + static void close() { if (null != restfulService) { restfulService.shutdown(); } } @Test - public void assertHandleExceptionWithNotifySuccessful() { + void assertHandleExceptionWithNotifySuccessful() { WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:9872/send?key=mocked_key")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); @@ -84,7 +84,7 @@ public void assertHandleExceptionWithNotifySuccessful() { } @Test - public void assertHandleExceptionWithWrongToken() { + void assertHandleExceptionWithWrongToken() { WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:9872/send?key=wrong_key")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); @@ -94,7 +94,7 @@ public void assertHandleExceptionWithWrongToken() { } @Test - public void assertHandleExceptionWithWrongUrl() { + void assertHandleExceptionWithWrongUrl() { WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://wrongUrl")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); @@ -104,7 +104,7 @@ public void assertHandleExceptionWithWrongUrl() { } @Test - public void assertHandleExceptionWithUrlIsNotFound() { + void assertHandleExceptionWithUrlIsNotFound() { WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:9872/404")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java index 46628780c6..2e3abe8cd8 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ElasticJobExecutorTest { +class ElasticJobExecutorTest { @Mock private FooJob fooJob; @@ -63,7 +63,7 @@ public final class ElasticJobExecutorTest { private ElasticJobExecutor elasticJobExecutor; @BeforeEach - public void setUp() { + void setUp() { jobConfig = createJobConfiguration(); when(jobFacade.loadJobConfiguration(anyBoolean())).thenReturn(jobConfig); elasticJobExecutor = new ElasticJobExecutor(fooJob, jobConfig, jobFacade); @@ -83,7 +83,7 @@ private void setJobItemExecutor() { } @Test - public void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() { + void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() { assertThrows(JobSystemException.class, () -> { doThrow(JobExecutionEnvironmentException.class).when(jobFacade).checkJobExecutionEnvironment(); try { @@ -95,7 +95,7 @@ public void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() { } @Test - public void assertExecuteWhenPreviousJobStillRunning() { + void assertExecuteWhenPreviousJobStillRunning() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 3, "", Collections.emptyMap()); when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); when(jobFacade.misfireIfRunning(shardingContexts.getShardingItemParameters().keySet())).thenReturn(true); @@ -107,7 +107,7 @@ public void assertExecuteWhenPreviousJobStillRunning() { } @Test - public void assertExecuteWhenShardingItemsIsEmpty() { + void assertExecuteWhenShardingItemsIsEmpty() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 3, "", Collections.emptyMap()); prepareForIsNotMisfire(jobFacade, shardingContexts); elasticJobExecutor.execute(); @@ -117,12 +117,12 @@ public void assertExecuteWhenShardingItemsIsEmpty() { } @Test - public void assertExecuteFailureWhenThrowExceptionForSingleShardingItem() { + void assertExecuteFailureWhenThrowExceptionForSingleShardingItem() { assertThrows(JobSystemException.class, () -> assertExecuteFailureWhenThrowException(createSingleShardingContexts())); } @Test - public void assertExecuteFailureWhenThrowExceptionForMultipleShardingItems() { + void assertExecuteFailureWhenThrowExceptionForMultipleShardingItems() { assertExecuteFailureWhenThrowException(createMultipleShardingContexts()); } @@ -148,12 +148,12 @@ private String getErrorMessage(final ShardingContexts shardingContexts) { } @Test - public void assertExecuteSuccessForSingleShardingItems() { + void assertExecuteSuccessForSingleShardingItems() { assertExecuteSuccess(createSingleShardingContexts()); } @Test - public void assertExecuteSuccessForMultipleShardingItems() { + void assertExecuteSuccessForMultipleShardingItems() { assertExecuteSuccess(createMultipleShardingContexts()); } @@ -167,7 +167,7 @@ private void assertExecuteSuccess(final ShardingContexts shardingContexts) { } @Test - public void assertExecuteWithMisfireIsEmpty() { + void assertExecuteWithMisfireIsEmpty() { ShardingContexts shardingContexts = createMultipleShardingContexts(); when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); elasticJobExecutor.execute(); @@ -176,7 +176,7 @@ public void assertExecuteWithMisfireIsEmpty() { } @Test - public void assertExecuteWithMisfireIsNotEmptyButIsNotEligibleForJobRunning() { + void assertExecuteWithMisfireIsNotEmptyButIsNotEligibleForJobRunning() { ShardingContexts shardingContexts = createMultipleShardingContexts(); when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); elasticJobExecutor.execute(); @@ -186,7 +186,7 @@ public void assertExecuteWithMisfireIsNotEmptyButIsNotEligibleForJobRunning() { } @Test - public void assertExecuteWithMisfire() { + void assertExecuteWithMisfire() { ShardingContexts shardingContexts = createMultipleShardingContexts(); when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); when(jobFacade.isExecuteMisfired(shardingContexts.getShardingItemParameters().keySet())).thenReturn(true, false); @@ -200,7 +200,7 @@ public void assertExecuteWithMisfire() { } @Test - public void assertBeforeJobExecutedFailure() { + void assertBeforeJobExecutedFailure() { assertThrows(JobSystemException.class, () -> { ShardingContexts shardingContexts = createMultipleShardingContexts(); when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); @@ -214,7 +214,7 @@ public void assertBeforeJobExecutedFailure() { } @Test - public void assertAfterJobExecutedFailure() { + void assertAfterJobExecutedFailure() { assertThrows(JobSystemException.class, () -> { ShardingContexts shardingContexts = createMultipleShardingContexts(); when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java index 08c0fe09b6..bd6b3dd158 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java @@ -29,30 +29,30 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class JobItemExecutorFactoryTest { +class JobItemExecutorFactoryTest { @Test - public void assertGetExecutorByClassFailureWithInvalidType() { + void assertGetExecutorByClassFailureWithInvalidType() { assertThrows(JobConfigurationException.class, () -> JobItemExecutorFactory.getExecutor(FailedJob.class)); } @Test - public void assertGetExecutorByClassSuccessWithCurrentClass() { + void assertGetExecutorByClassSuccessWithCurrentClass() { assertThat(JobItemExecutorFactory.getExecutor(FooJob.class), instanceOf(ClassedFooJobExecutor.class)); } @Test - public void assertGetExecutorByClassSuccessWithSubClass() { + void assertGetExecutorByClassSuccessWithSubClass() { assertThat(JobItemExecutorFactory.getExecutor(DetailedFooJob.class), instanceOf(ClassedFooJobExecutor.class)); } @Test - public void assertGetExecutorByTypeFailureWithInvalidType() { + void assertGetExecutorByTypeFailureWithInvalidType() { assertThrows(JobConfigurationException.class, () -> JobItemExecutorFactory.getExecutor("FAIL")); } @Test - public void assertGetExecutorByTypeSuccess() { + void assertGetExecutorByTypeSuccess() { assertThat(JobItemExecutorFactory.getExecutor("FOO"), instanceOf(TypedFooJobExecutor.class)); } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java index 7f1ed741f5..fa24700ed8 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class DataflowJobExecutorTest { +class DataflowJobExecutorTest { private DataflowJobExecutor jobExecutor; @@ -59,13 +59,13 @@ public final class DataflowJobExecutorTest { private Properties properties; @BeforeEach - public void createJobExecutor() { + void createJobExecutor() { jobExecutor = new DataflowJobExecutor(); } @SuppressWarnings("unchecked") @Test - public void assertProcessWithStreamingExecute() { + void assertProcessWithStreamingExecute() { List data = Arrays.asList("DataflowJob1", "DataflowJob2"); when(jobConfig.getProps()).thenReturn(properties); when(properties.getOrDefault(DataflowJobProperties.STREAM_PROCESS_KEY, false)).thenReturn("true"); @@ -77,7 +77,7 @@ public void assertProcessWithStreamingExecute() { @SuppressWarnings("unchecked") @Test - public void assertProcessWithOneOffExecute() { + void assertProcessWithOneOffExecute() { List data = Arrays.asList("DataflowJob1", "DataflowJob2"); when(jobConfig.getProps()).thenReturn(properties); when(properties.getOrDefault(DataflowJobProperties.STREAM_PROCESS_KEY, false)).thenReturn("false"); @@ -87,7 +87,7 @@ public void assertProcessWithOneOffExecute() { } @Test - public void assertGetElasticJobClass() { + void assertGetElasticJobClass() { assertThat(jobExecutor.getElasticJobClass(), is(DataflowJob.class)); } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 2d6b4c9c69..f025ef231d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -45,7 +45,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class HttpJobExecutorTest { +class HttpJobExecutorTest { private static final int PORT = 9876; @@ -72,7 +72,7 @@ public final class HttpJobExecutorTest { private HttpJobExecutor jobExecutor; @BeforeAll - public static void init() { + static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); configuration.addControllerInstances(new InternalController()); @@ -81,20 +81,20 @@ public static void init() { } @BeforeEach - public void setUp() { + void setUp() { lenient().when(jobConfig.getProps()).thenReturn(properties); jobExecutor = new HttpJobExecutor(); } @AfterAll - public static void close() { + static void close() { if (null != restfulService) { restfulService.shutdown(); } } @Test - public void assertUrlEmpty() { + void assertUrlEmpty() { assertThrows(JobConfigurationException.class, () -> { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(""); jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); @@ -102,7 +102,7 @@ public void assertUrlEmpty() { } @Test - public void assertMethodEmpty() { + void assertMethodEmpty() { assertThrows(JobConfigurationException.class, () -> { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/getName")); when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn(""); @@ -111,7 +111,7 @@ public void assertMethodEmpty() { } @Test - public void assertProcessWithoutSuccessCode() { + void assertProcessWithoutSuccessCode() { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/unknownMethod")); when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("GET"); when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn(""); @@ -121,7 +121,7 @@ public void assertProcessWithoutSuccessCode() { } @Test - public void assertProcessWithGet() { + void assertProcessWithGet() { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/getName")); when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("GET"); when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn(""); @@ -131,7 +131,7 @@ public void assertProcessWithGet() { } @Test - public void assertProcessHeader() { + void assertProcessHeader() { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/getShardingContext")); when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("GET"); when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("4000"); @@ -140,7 +140,7 @@ public void assertProcessHeader() { } @Test - public void assertProcessWithPost() { + void assertProcessWithPost() { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/updateName")); when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("POST"); when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn("name=elasticjob"); @@ -151,7 +151,7 @@ public void assertProcessWithPost() { } @Test - public void assertProcessWithIOException() { + void assertProcessWithIOException() { assertThrows(JobExecutionException.class, () -> { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/postWithTimeout")); when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("POST"); @@ -163,7 +163,7 @@ public void assertProcessWithIOException() { } @Test - public void assertGetType() { + void assertGetType() { assertThat(jobExecutor.getType(), is("HTTP")); } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index 3f3a9dfdd7..ea614cff1b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ScriptJobExecutorTest { +class ScriptJobExecutorTest { @Mock private ElasticJob elasticJob; @@ -60,12 +60,12 @@ public final class ScriptJobExecutorTest { private ScriptJobExecutor jobExecutor; @BeforeEach - public void setUp() { + void setUp() { jobExecutor = new ScriptJobExecutor(); } @Test - public void assertProcessWithJobConfigurationException() { + void assertProcessWithJobConfigurationException() { assertThrows(JobConfigurationException.class, () -> { when(jobConfig.getProps()).thenReturn(properties); jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); @@ -73,7 +73,7 @@ public void assertProcessWithJobConfigurationException() { } @Test - public void assertProcessWithJobSystemException() { + void assertProcessWithJobSystemException() { assertThrows(JobSystemException.class, () -> { when(jobConfig.getProps()).thenReturn(properties); when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn("demo.sh"); @@ -82,7 +82,7 @@ public void assertProcessWithJobSystemException() { } @Test - public void assertProcess() { + void assertProcess() { when(jobConfig.getProps()).thenReturn(properties); when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn(determineCommandByPlatform()); jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); @@ -101,7 +101,7 @@ private String getEcho() { } @Test - public void assertGetType() { + void assertGetType() { assertThat(jobExecutor.getType(), is("SCRIPT")); } } diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java index a0cd5667a0..3a5b202a7d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java @@ -34,7 +34,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class SimpleJobExecutorTest { +class SimpleJobExecutorTest { @Mock private FooSimpleJob fooSimpleJob; @@ -48,18 +48,18 @@ public final class SimpleJobExecutorTest { private SimpleJobExecutor jobExecutor; @BeforeEach - public void setUp() { + void setUp() { jobExecutor = new SimpleJobExecutor(); } @Test - public void assertProcess() { + void assertProcess() { jobExecutor.process(fooSimpleJob, jobConfig, jobFacade, any()); verify(fooSimpleJob, times(1)).execute(any()); } @Test - public void assertGetElasticJobClass() { + void assertGetElasticJobClass() { assertThat(jobExecutor.getElasticJobClass(), is(SimpleJob.class)); } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java index b85cc30a46..d1ba019871 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class JobTracingEventBusTest { +class JobTracingEventBusTest { @Mock private JobEventCaller jobEventCaller; @@ -49,13 +49,13 @@ public final class JobTracingEventBusTest { private JobTracingEventBus jobTracingEventBus; @Test - public void assertRegisterFailure() { + void assertRegisterFailure() { jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("FAIL", null)); assertIsRegistered(false); } @Test - public void assertPost() throws InterruptedException { + void assertPost() throws InterruptedException { jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("TEST", jobEventCaller)); assertIsRegistered(true); jobTracingEventBus.post(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); @@ -66,7 +66,7 @@ public void assertPost() throws InterruptedException { } @Test - public void assertPostWithoutListener() throws ReflectiveOperationException { + void assertPostWithoutListener() throws ReflectiveOperationException { jobTracingEventBus = new JobTracingEventBus(); assertIsRegistered(false); Field field = JobTracingEventBus.class.getDeclaredField("eventBus"); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java index 7a10039fe1..e83d4b886e 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java @@ -26,10 +26,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class JobExecutionEventTest { +class JobExecutionEventTest { @Test - public void assertNewJobExecutionEvent() { + void assertNewJobExecutionEvent() { JobExecutionEvent actual = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getSource(), is(JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER)); @@ -42,7 +42,7 @@ public void assertNewJobExecutionEvent() { } @Test - public void assertExecutionSuccess() { + void assertExecutionSuccess() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); JobExecutionEvent successEvent = startEvent.executionSuccess(); assertNotNull(successEvent.getCompleteTime()); @@ -50,7 +50,7 @@ public void assertExecutionSuccess() { } @Test - public void assertExecutionFailure() { + void assertExecutionFailure() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); JobExecutionEvent failureEvent = startEvent.executionFailure("java.lang.RuntimeException: failure"); assertNotNull(failureEvent.getCompleteTime()); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java index c284f5e553..f6ab431e9c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java @@ -27,20 +27,20 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class TracingListenerFactoryTest { +class TracingListenerFactoryTest { @Test - public void assertGetListenerWithNullType() { + void assertGetListenerWithNullType() { assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("", null))); } @Test - public void assertGetInvalidListener() { + void assertGetInvalidListener() { assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null))); } @Test - public void assertGetListener() throws TracingConfigurationException { + void assertGetListener() throws TracingConfigurationException { assertThat(TracingListenerFactory.getListener(new TracingConfiguration<>("TEST", new JobEventCallerConfiguration(() -> { }))), instanceOf(TestTracingListener.class)); } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java index 4f31edb5f1..760fc956a0 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java @@ -23,15 +23,15 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class TracingStorageConverterFactoryTest { +class TracingStorageConverterFactoryTest { @Test - public void assertConverterExists() { + void assertConverterExists() { assertTrue(TracingStorageConverterFactory.findConverter(JobEventCaller.class).isPresent()); } @Test - public void assertConverterNotFound() { + void assertConverterNotFound() { assertFalse(TracingStorageConverterFactory.findConverter(AClassWithoutCorrespondingConverter.class).isPresent()); } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java index 5cefd95961..3c14e97c6e 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -26,10 +26,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class YamlTracingConfigurationConverterTest { +class YamlTracingConfigurationConverterTest { @Test - public void assertConvertTracingConfiguration() { + void assertConvertTracingConfiguration() { JobEventCaller expectedStorage = () -> { }; TracingConfiguration tracingConfiguration = new TracingConfiguration<>("TEST", expectedStorage); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java index 442ec49f34..b8ddd1e149 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java @@ -35,10 +35,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; -public final class DataSourceConfigurationTest { +class DataSourceConfigurationTest { @Test - public void assertGetDataSourceConfiguration() throws SQLException { + void assertGetDataSourceConfiguration() throws SQLException { HikariDataSource actualDataSource = new HikariDataSource(); actualDataSource.setDriverClassName("org.h2.Driver"); actualDataSource.setJdbcUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL"); @@ -55,7 +55,7 @@ public void assertGetDataSourceConfiguration() throws SQLException { } @Test - public void assertCreateDataSource() { + void assertCreateDataSource() { Map props = new HashMap<>(16, 1); props.put("driverClassName", "org.h2.Driver"); props.put("jdbcUrl", "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL"); @@ -73,7 +73,7 @@ public void assertCreateDataSource() { } @Test - public void assertEquals() { + void assertEquals() { DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); assertThat(originalDataSourceConfig, is(originalDataSourceConfig)); @@ -84,7 +84,7 @@ public void assertEquals() { } @Test - public void assertNotEquals() { + void assertNotEquals() { DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); originalDataSourceConfig.getProps().put("username", "root"); @@ -93,12 +93,12 @@ public void assertNotEquals() { } @Test - public void assertEqualsWithNull() { + void assertEqualsWithNull() { assertFalse(new DataSourceConfiguration(HikariDataSource.class.getName()).equals(null)); } @Test - public void assertSameHashCode() { + void assertSameHashCode() { DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); assertThat(originalDataSourceConfig.hashCode(), is(targetDataSourceConfig.hashCode())); @@ -111,7 +111,7 @@ public void assertSameHashCode() { } @Test - public void assertDifferentHashCode() { + void assertDifferentHashCode() { DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); originalDataSourceConfig.getProps().put("username", "root"); @@ -125,7 +125,7 @@ public void assertDifferentHashCode() { @SuppressWarnings("unchecked") @Test - public void assertGetDataSourceConfigurationWithConnectionInitSqls() { + void assertGetDataSourceConfigurationWithConnectionInitSqls() { BasicDataSource actualDataSource = new BasicDataSource(); actualDataSource.setDriverClassName("org.h2.Driver"); actualDataSource.setUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL"); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java index f2e4e863b2..f419a081dc 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java @@ -32,13 +32,13 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class DataSourceRegistryTest { +class DataSourceRegistryTest { @Mock private DataSourceConfiguration dataSourceConfiguration; @Test - public void assertGetDataSourceBySameConfiguration() { + void assertGetDataSourceBySameConfiguration() { when(dataSourceConfiguration.createDataSource()).then(invocation -> mock(DataSource.class)); DataSource expected = DataSourceRegistry.getInstance().getDataSource(dataSourceConfiguration); DataSource actual = DataSourceRegistry.getInstance().getDataSource(dataSourceConfiguration); @@ -47,7 +47,7 @@ public void assertGetDataSourceBySameConfiguration() { } @Test - public void assertGetDataSourceWithDifferentConfiguration() { + void assertGetDataSourceWithDifferentConfiguration() { when(dataSourceConfiguration.createDataSource()).then(invocation -> mock(DataSource.class)); DataSourceConfiguration anotherDataSourceConfiguration = mock(DataSourceConfiguration.class); when(anotherDataSourceConfiguration.createDataSource()).then(invocation -> mock(DataSource.class)); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java index 5fcc05194b..0c467b6a5c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class DataSourceTracingStorageConverterTest { +class DataSourceTracingStorageConverterTest { @Mock private DataSource dataSource; @@ -52,7 +52,7 @@ public final class DataSourceTracingStorageConverterTest { private DatabaseMetaData databaseMetaData; @Test - public void assertConvert() throws SQLException { + void assertConvert() throws SQLException { when(dataSource.getConnection()).thenReturn(connection); when(connection.getMetaData()).thenReturn(databaseMetaData); when(databaseMetaData.getURL()).thenReturn("jdbc:url"); @@ -62,7 +62,7 @@ public void assertConvert() throws SQLException { } @Test - public void assertConvertFailed() { + void assertConvertFailed() { assertThrows(TracingStorageUnavailableException.class, () -> { DataSourceTracingStorageConverter converter = new DataSourceTracingStorageConverter(); doThrow(SQLException.class).when(dataSource).getConnection(); @@ -71,7 +71,7 @@ public void assertConvertFailed() { } @Test - public void assertStorageType() { + void assertStorageType() { TracingStorageConverter converter = TracingStorageConverterFactory.findConverter(HikariDataSource.class).orElse(null); assertNotNull(converter); assertThat(converter.storageType(), is(DataSource.class)); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java index 1bf7e064f7..781b3652fe 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java @@ -25,10 +25,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class RDBTracingListenerConfigurationTest { +class RDBTracingListenerConfigurationTest { @Test - public void assertCreateTracingListenerSuccess() throws TracingConfigurationException { + void assertCreateTracingListenerSuccess() throws TracingConfigurationException { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); dataSource.setUrl("jdbc:h2:mem:job_event_storage"); @@ -38,7 +38,7 @@ public void assertCreateTracingListenerSuccess() throws TracingConfigurationExce } @Test - public void assertCreateTracingListenerFailure() { + void assertCreateTracingListenerFailure() { assertThrows(TracingConfigurationException.class, () -> new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource())); } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 0a41349898..f16ecee1f5 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class RDBTracingListenerTest { +class RDBTracingListenerTest { private static final String JOB_NAME = "test_rdb_event_listener"; @@ -50,7 +50,7 @@ public final class RDBTracingListenerTest { private JobTracingEventBus jobTracingEventBus; @BeforeEach - public void setUp() throws SQLException { + void setUp() throws SQLException { BasicDataSource dataSource = new BasicDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); dataSource.setUrl("jdbc:h2:mem:job_event_storage"); @@ -69,14 +69,14 @@ private void setRepository(final RDBTracingListener tracingListener) { } @Test - public void assertPostJobExecutionEvent() { + void assertPostJobExecutionEvent() { JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", JOB_NAME, JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); jobTracingEventBus.post(jobExecutionEvent); verify(repository, atMost(1)).addJobExecutionEvent(jobExecutionEvent); } @Test - public void assertPostJobStatusTraceEvent() { + void assertPostJobStatusTraceEvent() { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(JOB_NAME, "fake_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "READY", "0", State.TASK_RUNNING, "message is empty."); jobTracingEventBus.post(jobStatusTraceEvent); verify(repository, atMost(1)).addJobStatusTraceEvent(jobStatusTraceEvent); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index 5fc5c40848..9f1b09c64f 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -36,14 +36,14 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class RDBJobEventStorageTest { +class RDBJobEventStorageTest { private RDBJobEventStorage storage; private BasicDataSource dataSource; @BeforeEach - public void setup() throws SQLException { + void setup() throws SQLException { dataSource = new BasicDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); dataSource.setUrl("jdbc:h2:mem:job_event_storage"); @@ -53,23 +53,23 @@ public void setup() throws SQLException { } @AfterEach - public void teardown() throws SQLException { + void teardown() throws SQLException { dataSource.close(); } @Test - public void assertAddJobExecutionEvent() { + void assertAddJobExecutionEvent() { assertTrue(storage.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0))); } @Test - public void assertAddJobStatusTraceEvent() { + void assertAddJobStatusTraceEvent() { assertTrue(storage.addJobStatusTraceEvent( new JobStatusTraceEvent("test_job", "fake_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "READY", "0", State.TASK_RUNNING, "message is empty."))); } @Test - public void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { + void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent( "test_job", "fake_failover_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "FAILOVER", "0", State.TASK_STAGING, "message is empty."); jobStatusTraceEvent.setOriginalTaskId("original_fake_failover_task_id"); @@ -79,7 +79,7 @@ public void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { } @Test - public void assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState() { + void assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState() { JobStatusTraceEvent stagingJobStatusTraceEvent = new JobStatusTraceEvent( "test_job", "fake_failed_failover_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "FAILOVER", "0", State.TASK_STAGING, "message is empty."); stagingJobStatusTraceEvent.setOriginalTaskId("original_fake_failed_failover_task_id"); @@ -95,7 +95,7 @@ public void assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState() { } @Test - public void assertUpdateJobExecutionEventWhenSuccess() { + void assertUpdateJobExecutionEventWhenSuccess() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); assertTrue(storage.addJobExecutionEvent(startEvent)); JobExecutionEvent successEvent = startEvent.executionSuccess(); @@ -103,7 +103,7 @@ public void assertUpdateJobExecutionEventWhenSuccess() { } @Test - public void assertUpdateJobExecutionEventWhenFailure() { + void assertUpdateJobExecutionEventWhenFailure() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); assertTrue(storage.addJobExecutionEvent(startEvent)); JobExecutionEvent failureEvent = startEvent.executionFailure("java.lang.RuntimeException: failure"); @@ -113,7 +113,7 @@ public void assertUpdateJobExecutionEventWhenFailure() { } @Test - public void assertUpdateJobExecutionEventWhenSuccessAndConflict() { + void assertUpdateJobExecutionEventWhenSuccessAndConflict() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); JobExecutionEvent successEvent = startEvent.executionSuccess(); assertTrue(storage.addJobExecutionEvent(successEvent)); @@ -121,7 +121,7 @@ public void assertUpdateJobExecutionEventWhenSuccessAndConflict() { } @Test - public void assertUpdateJobExecutionEventWhenFailureAndConflict() { + void assertUpdateJobExecutionEventWhenFailureAndConflict() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); JobExecutionEvent failureEvent = startEvent.executionFailure("java.lang.RuntimeException: failure"); assertTrue(storage.addJobExecutionEvent(failureEvent)); @@ -130,7 +130,7 @@ public void assertUpdateJobExecutionEventWhenFailureAndConflict() { } @Test - public void assertUpdateJobExecutionEventWhenFailureAndMessageExceed() { + void assertUpdateJobExecutionEventWhenFailureAndMessageExceed() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); assertTrue(storage.addJobExecutionEvent(startEvent)); StringBuilder failureMsg = new StringBuilder(); @@ -143,7 +143,7 @@ public void assertUpdateJobExecutionEventWhenFailureAndMessageExceed() { } @Test - public void assertFindJobExecutionEvent() { + void assertFindJobExecutionEvent() { storage.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java index 8113a08c08..9b0545cf06 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java @@ -28,10 +28,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class YamlDataSourceConfigurationConverterTest { +class YamlDataSourceConfigurationConverterTest { @Test - public void assertConvertDataSourceConfiguration() { + void assertConvertDataSourceConfiguration() { DataSourceConfiguration dataSourceConfiguration = new DataSourceConfiguration("org.h2.Driver"); dataSourceConfiguration.getProps().put("foo", "bar"); YamlDataSourceConfigurationConverter converter = new YamlDataSourceConfigurationConverter(); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index 47b990a437..b6eeb74f3d 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -28,12 +28,12 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ElasticJobExecutorServiceTest { +class ElasticJobExecutorServiceTest { private static boolean hasExecuted; @Test - public void assertCreateExecutorService() { + void assertCreateExecutorService() { ElasticJobExecutorService executorServiceObject = new ElasticJobExecutorService("executor-service-test", 1); assertThat(executorServiceObject.getActiveThreadCount(), is(0)); assertThat(executorServiceObject.getWorkQueueSize(), is(0)); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java index 6aa87e4856..c7856ef707 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java @@ -35,13 +35,13 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class ExecutorServiceReloadableTest { +class ExecutorServiceReloadableTest { @Mock private ExecutorService mockExecutorService; @Test - public void assertInitialize() { + void assertInitialize() { ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); String jobExecutorServiceHandlerType = "SINGLE_THREAD"; JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType).build(); @@ -55,7 +55,7 @@ public void assertInitialize() { } @Test - public void assertReload() { + void assertReload() { ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); setField(executorServiceReloadable, "jobExecutorServiceHandlerType", "mock"); setField(executorServiceReloadable, "executorService", mockExecutorService); @@ -69,7 +69,7 @@ public void assertReload() { } @Test - public void assertUnnecessaryToReload() { + void assertUnnecessaryToReload() { ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).build(); executorServiceReloadable.init(jobConfig); @@ -81,7 +81,7 @@ public void assertUnnecessaryToReload() { } @Test - public void assertShutdown() { + void assertShutdown() { ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); setField(executorServiceReloadable, "executorService", mockExecutorService); executorServiceReloadable.close(); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java index 040e44b06b..432efe2386 100755 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java @@ -28,25 +28,25 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class ShardingItemParametersTest { +class ShardingItemParametersTest { @Test - public void assertNewWhenPairFormatInvalid() { + void assertNewWhenPairFormatInvalid() { assertThrows(JobConfigurationException.class, () -> new ShardingItemParameters("xxx-xxx")); } @Test - public void assertNewWhenItemIsNotNumber() { + void assertNewWhenItemIsNotNumber() { assertThrows(JobConfigurationException.class, () -> new ShardingItemParameters("xxx=xxx")); } @Test - public void assertGetMapWhenIsEmpty() { + void assertGetMapWhenIsEmpty() { assertThat(new ShardingItemParameters("").getMap(), is(Collections.EMPTY_MAP)); } @Test - public void assertGetMap() { + void assertGetMap() { Map expected = new HashMap<>(3); expected.put(0, "A"); expected.put(1, "B"); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java index c65a15f749..c5f2f26fd0 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java @@ -29,10 +29,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class TaskContextTest { +class TaskContextTest { @Test - public void assertNew() { + void assertNew() { TaskContext actual = new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "slave-S0"); assertThat(actual.getMetaInfo().getJobName(), is("test_job")); assertThat(actual.getMetaInfo().getShardingItems().get(0), is(0)); @@ -42,19 +42,19 @@ public void assertNew() { } @Test - public void assertNewWithoutSlaveId() { + void assertNewWithoutSlaveId() { TaskContext actual = new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY); assertThat(actual.getSlaveId(), is("unassigned-slave")); } @Test - public void assertGetMetaInfo() { + void assertGetMetaInfo() { TaskContext actual = new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "slave-S0"); assertThat(actual.getMetaInfo().toString(), is("test_job@-@0")); } @Test - public void assertTaskContextFrom() { + void assertTaskContextFrom() { TaskContext actual = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); assertThat(actual.getId(), is(TaskNode.builder().build().getTaskNodeValue())); assertThat(actual.getMetaInfo().getJobName(), is("test_job")); @@ -64,52 +64,52 @@ public void assertTaskContextFrom() { } @Test - public void assertMetaInfoFromWithMetaInfo() { + void assertMetaInfoFromWithMetaInfo() { MetaInfo actual = MetaInfo.from("test_job@-@1"); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getShardingItems().get(0), is(1)); } @Test - public void assertMetaInfoFromWithTaskId() { + void assertMetaInfoFromWithTaskId() { MetaInfo actual = MetaInfo.from("test_job@-@1@-@READY@-@unassigned-slave@-@0"); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getShardingItems().get(0), is(1)); } @Test - public void assertMetaInfoFromWithMetaInfoWithoutShardingItems() { + void assertMetaInfoFromWithMetaInfoWithoutShardingItems() { MetaInfo actual = MetaInfo.from("test_job@-@"); assertThat(actual.getJobName(), is("test_job")); assertTrue(actual.getShardingItems().isEmpty()); } @Test - public void assertMetaInfoFromWithTaskIdWithoutShardingItems() { + void assertMetaInfoFromWithTaskIdWithoutShardingItems() { MetaInfo actual = MetaInfo.from("test_job@-@@-@READY@-@unassigned-slave@-@0"); assertThat(actual.getJobName(), is("test_job")); assertTrue(actual.getShardingItems().isEmpty()); } @Test - public void assertGetIdForUnassignedSlave() { + void assertGetIdForUnassignedSlave() { assertThat(TaskContext.getIdForUnassignedSlave("test_job@-@0@-@READY@-@slave-S0@-@0"), is("test_job@-@0@-@READY@-@unassigned-slave@-@0")); } @Test - public void assertGetTaskName() { + void assertGetTaskName() { TaskContext actual = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); assertThat(actual.getTaskName(), is("test_job@-@0@-@READY@-@slave-S0")); } @Test - public void assertGetExecutorId() { + void assertGetExecutorId() { TaskContext actual = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); assertThat(actual.getExecutorId("app"), is("app@-@slave-S0")); } @Test - public void assertSetSlaveId() { + void assertSetSlaveId() { TaskContext actual = new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "slave-S0"); assertThat(actual.getSlaveId(), is("slave-S0")); actual.setSlaveId("slave-S1"); @@ -117,7 +117,7 @@ public void assertSetSlaveId() { } @Test - public void assertSetIdle() { + void assertSetIdle() { TaskContext actual = new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "slave-S0"); assertFalse(actual.isIdle()); actual.setIdle(true); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java index fc91f356aa..db2d8b26a6 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java @@ -24,10 +24,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class HostExceptionTest { +class HostExceptionTest { @Test - public void assertGetCause() { + void assertGetCause() { IOException cause = new IOException(); assertThat(new HostException(cause).getCause(), is(cause)); } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index d88adb03df..49fbe4a05a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -37,16 +37,16 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -public final class IpUtilsTest { +class IpUtilsTest { @Test - public void assertGetIp() { + void assertGetIp() { assertNotNull(IpUtils.getIp()); } @Test @SneakyThrows - public void assertPreferredNetworkInterface() { + void assertPreferredNetworkInterface() { System.setProperty(IpUtils.PREFERRED_NETWORK_INTERFACE, "eth0"); Method declaredMethod = IpUtils.class.getDeclaredMethod("isPreferredNetworkInterface", NetworkInterface.class); declaredMethod.setAccessible(true); @@ -59,7 +59,7 @@ public void assertPreferredNetworkInterface() { @Test @SneakyThrows - public void assertPreferredNetworkAddress() { + void assertPreferredNetworkAddress() { Method declaredMethod = IpUtils.class.getDeclaredMethod("isPreferredAddress", InetAddress.class); declaredMethod.setAccessible(true); InetAddress inetAddress = mock(InetAddress.class); @@ -79,7 +79,7 @@ public void assertPreferredNetworkAddress() { @Test @SneakyThrows - public void assertGetFirstNetworkInterface() { + void assertGetFirstNetworkInterface() { InetAddress address1 = mock(Inet4Address.class); when(address1.isLoopbackAddress()).thenReturn(false); when(address1.isAnyLocalAddress()).thenReturn(false); @@ -114,7 +114,7 @@ public void assertGetFirstNetworkInterface() { @Test @SneakyThrows - public void assertGetHostName() { + void assertGetHostName() { assertNotNull(IpUtils.getHostName()); Field field = IpUtils.class.getDeclaredField("cachedHostName"); field.setAccessible(true); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java index d48b5c87b9..bf08ba5e6b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java @@ -21,12 +21,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue; -public class TimeServiceTest { +class TimeServiceTest { private final TimeService timeService = new TimeService(); @Test - public void assertGetCurrentMillis() { + void assertGetCurrentMillis() { assertTrue(timeService.getCurrentMillis() <= System.currentTimeMillis()); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java index d42f12baf1..2739b42350 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java @@ -23,20 +23,20 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ExceptionUtilsTest { +class ExceptionUtilsTest { @Test - public void assertTransformWithError() { + void assertTransformWithError() { assertTrue(ExceptionUtils.transform(new Error("Error")).startsWith("java.lang.Error")); } @Test - public void assertTransformWithException() { + void assertTransformWithException() { assertTrue(ExceptionUtils.transform(new Exception("Exception")).startsWith("java.lang.Exception")); } @Test - public void assertTransformWithNull() { + void assertTransformWithNull() { assertThat(ExceptionUtils.transform(null), is("")); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java index 0af136a9e3..4605f68929 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java @@ -23,15 +23,15 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobConfigurationExceptionTest { +class JobConfigurationExceptionTest { @Test - public void assertGetMessage() { + void assertGetMessage() { assertThat(new JobConfigurationException("message is: '%s'", "test").getMessage(), is("message is: 'test'")); } @Test - public void assertGetCause() { + void assertGetCause() { assertThat(new JobConfigurationException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java index 7b69ba07ce..fbbaf78cf6 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobExecutionEnvironmentExceptionTest { +class JobExecutionEnvironmentExceptionTest { @Test - public void assertGetMessage() { + void assertGetMessage() { assertThat(new JobExecutionEnvironmentException("message is: '%s'", "test").getMessage(), is("message is: 'test'")); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java index 0b904b655e..27b26aef5b 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; -public class JobStatisticExceptionTest { +class JobStatisticExceptionTest { @Test - public void assertGetCause() { + void assertGetCause() { assertThat(new JobStatisticException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java index 5b83660c08..89c2c78a10 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java @@ -23,22 +23,22 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobSystemExceptionTest { +class JobSystemExceptionTest { @Test - public void assertGetMessage() { + void assertGetMessage() { assertThat(new JobSystemException("message is: '%s'", "test").getMessage(), is("message is: 'test'")); } @Test - public void assertGetMessageCause() { + void assertGetMessageCause() { JobSystemException jobSystemException = new JobSystemException("message is: ", new RuntimeException()); assertThat(jobSystemException.getMessage(), is("message is: ")); assertThat(jobSystemException.getCause(), instanceOf(RuntimeException.class)); } @Test - public void assertGetCause() { + void assertGetCause() { assertThat(new JobSystemException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java index 2bbc181d50..eaa2963193 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java @@ -24,20 +24,20 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobInstanceTest { +class JobInstanceTest { @Test - public void assertGetJobInstanceId() { + void assertGetJobInstanceId() { assertThat(new JobInstance("127.0.0.1@-@0").getJobInstanceId(), is("127.0.0.1@-@0")); } @Test - public void assertGetIp() { + void assertGetIp() { assertThat(new JobInstance().getServerIp(), is(IpUtils.getIp())); } @Test - public void assertYamlConvert() { + void assertYamlConvert() { JobInstance actual = YamlEngine.unmarshal(YamlEngine.marshal(new JobInstance("id", "labels")), JobInstance.class); assertThat(actual.getJobInstanceId(), is("id")); assertThat(actual.getServerIp(), is(IpUtils.getIp())); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java index bbf9888d67..9db6376abc 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java @@ -26,20 +26,20 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class JobShardingStrategyFactoryTest { +class JobShardingStrategyFactoryTest { @Test - public void assertGetDefaultStrategy() { + void assertGetDefaultStrategy() { assertThat(JobShardingStrategyFactory.getStrategy(null), instanceOf(AverageAllocationJobShardingStrategy.class)); } @Test - public void assertGetInvalidStrategy() { + void assertGetInvalidStrategy() { assertThrows(JobConfigurationException.class, () -> JobShardingStrategyFactory.getStrategy("INVALID")); } @Test - public void assertGetStrategy() { + void assertGetStrategy() { assertThat(JobShardingStrategyFactory.getStrategy("ODEVITY"), instanceOf(OdevitySortByNameJobShardingStrategy.class)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java index e4b01e232d..b60a4f600e 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java @@ -30,24 +30,24 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class AverageAllocationJobShardingStrategyTest { +class AverageAllocationJobShardingStrategyTest { private final JobShardingStrategy jobShardingStrategy = new AverageAllocationJobShardingStrategy(); @Test - public void shardingForZeroServer() { + void shardingForZeroServer() { assertThat(jobShardingStrategy.sharding(Collections.emptyList(), "test_job", 3), is(Collections.>emptyMap())); } @Test - public void shardingForOneServer() { + void shardingForOneServer() { Map> expected = new LinkedHashMap<>(1, 1); expected.put(new JobInstance("host0@-@0"), Arrays.asList(0, 1, 2)); assertThat(jobShardingStrategy.sharding(Collections.singletonList(new JobInstance("host0@-@0")), "test_job", 3), is(expected)); } @Test - public void shardingForServersMoreThanShardingCount() { + void shardingForServersMoreThanShardingCount() { Map> expected = new LinkedHashMap<>(3, 1); expected.put(new JobInstance("host0@-@0"), Collections.singletonList(0)); expected.put(new JobInstance("host1@-@0"), Collections.singletonList(1)); @@ -56,7 +56,7 @@ public void shardingForServersMoreThanShardingCount() { } @Test - public void shardingForServersLessThanShardingCountAliquot() { + void shardingForServersLessThanShardingCountAliquot() { Map> expected = new LinkedHashMap<>(3, 1); expected.put(new JobInstance("host0@-@0"), Arrays.asList(0, 1, 2)); expected.put(new JobInstance("host1@-@0"), Arrays.asList(3, 4, 5)); @@ -65,7 +65,7 @@ public void shardingForServersLessThanShardingCountAliquot() { } @Test - public void shardingForServersLessThanShardingCountAliquantFor8ShardingCountAnd3Servers() { + void shardingForServersLessThanShardingCountAliquantFor8ShardingCountAnd3Servers() { Map> expected = new LinkedHashMap<>(3, 1); expected.put(new JobInstance("host0@-@0"), Arrays.asList(0, 1, 6)); expected.put(new JobInstance("host1@-@0"), Arrays.asList(2, 3, 7)); @@ -74,7 +74,7 @@ public void shardingForServersLessThanShardingCountAliquantFor8ShardingCountAnd3 } @Test - public void shardingForServersLessThanShardingCountAliquantFor10ShardingCountAnd3Servers() { + void shardingForServersLessThanShardingCountAliquantFor10ShardingCountAnd3Servers() { Map> expected = new LinkedHashMap<>(3, 1); expected.put(new JobInstance("host0@-@0"), Arrays.asList(0, 1, 2, 9)); expected.put(new JobInstance("host1@-@0"), Arrays.asList(3, 4, 5)); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java index 009078818a..dfe768ce69 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java @@ -29,12 +29,12 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class OdevitySortByNameJobShardingStrategyTest { +class OdevitySortByNameJobShardingStrategyTest { private final OdevitySortByNameJobShardingStrategy odevitySortByNameJobShardingStrategy = new OdevitySortByNameJobShardingStrategy(); @Test - public void assertShardingByAsc() { + void assertShardingByAsc() { Map> expected = new HashMap<>(); expected.put(new JobInstance("host0@-@0"), Collections.singletonList(0)); expected.put(new JobInstance("host1@-@0"), Collections.singletonList(1)); @@ -43,7 +43,7 @@ public void assertShardingByAsc() { } @Test - public void assertShardingByDesc() { + void assertShardingByDesc() { Map> expected = new HashMap<>(); expected.put(new JobInstance("host2@-@0"), Collections.singletonList(0)); expected.put(new JobInstance("host1@-@0"), Collections.singletonList(1)); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java index aa081a4537..4f159e6e75 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java @@ -29,12 +29,12 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class RotateServerByNameJobShardingStrategyTest { +class RotateServerByNameJobShardingStrategyTest { private final RoundRobinByNameJobShardingStrategy rotateServerByNameJobShardingStrategy = new RoundRobinByNameJobShardingStrategy(); @Test - public void assertSharding1() { + void assertSharding1() { Map> expected = new HashMap<>(); expected.put(new JobInstance("host1@-@0"), Collections.singletonList(0)); expected.put(new JobInstance("host2@-@0"), Collections.singletonList(1)); @@ -43,7 +43,7 @@ public void assertSharding1() { } @Test - public void assertSharding2() { + void assertSharding2() { Map> expected = new HashMap<>(); expected.put(new JobInstance("host2@-@0"), Collections.singletonList(0)); expected.put(new JobInstance("host0@-@0"), Collections.singletonList(1)); @@ -52,7 +52,7 @@ public void assertSharding2() { } @Test - public void assertSharding3() { + void assertSharding3() { Map> expected = new HashMap<>(); expected.put(new JobInstance("host0@-@0"), Collections.singletonList(0)); expected.put(new JobInstance("host1@-@0"), Collections.singletonList(1)); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java index b5f921c016..25758af9ec 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java @@ -26,20 +26,20 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class JobExecutorServiceHandlerFactoryTest { +class JobExecutorServiceHandlerFactoryTest { @Test - public void assertGetDefaultHandler() { + void assertGetDefaultHandler() { assertThat(JobExecutorServiceHandlerFactory.getHandler(""), instanceOf(CPUUsageJobExecutorServiceHandler.class)); } @Test - public void assertGetInvalidHandler() { + void assertGetInvalidHandler() { assertThrows(JobConfigurationException.class, () -> JobExecutorServiceHandlerFactory.getHandler("INVALID")); } @Test - public void assertGetHandler() { + void assertGetHandler() { assertThat(JobExecutorServiceHandlerFactory.getHandler("SINGLE_THREAD"), instanceOf(SingleThreadJobExecutorServiceHandler.class)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java index b2a3e9720c..6bea560a9f 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java @@ -23,10 +23,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class CPUUsageJobExecutorServiceHandlerTest { +class CPUUsageJobExecutorServiceHandlerTest { @Test - public void assertGetPoolSizeAndType() { + void assertGetPoolSizeAndType() { CPUUsageJobExecutorServiceHandler cpuUsageJobExecutorServiceHandler = (CPUUsageJobExecutorServiceHandler) JobExecutorServiceHandlerFactory.getHandler("CPU"); assertThat(cpuUsageJobExecutorServiceHandler.getPoolSize(), is(Runtime.getRuntime().availableProcessors() * 2)); assertThat(cpuUsageJobExecutorServiceHandler.getType(), is("CPU")); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java index f4b05ffc87..d0dd4ff31e 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java @@ -23,10 +23,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class SingleThreadJobExecutorServiceHandlerTest { +class SingleThreadJobExecutorServiceHandlerTest { @Test - public void assertGetPoolSizeAndType() { + void assertGetPoolSizeAndType() { SingleThreadJobExecutorServiceHandler singleThreadJobExecutorServiceHandler = (SingleThreadJobExecutorServiceHandler) JobExecutorServiceHandlerFactory.getHandler("SINGLE_THREAD"); assertThat(singleThreadJobExecutorServiceHandler.getPoolSize(), is(1)); assertThat(singleThreadJobExecutorServiceHandler.getType(), is("SINGLE_THREAD")); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java index 51d83b2011..38b542a551 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java @@ -30,15 +30,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class GsonFactoryTest { +class GsonFactoryTest { @Test - public void assertGetGson() { + void assertGetGson() { assertThat(GsonFactory.getGson(), is(GsonFactory.getGson())); } @Test - public void assertRegisterTypeAdapter() { + void assertRegisterTypeAdapter() { Gson beforeRegisterGson = GsonFactory.getGson(); GsonFactory.registerTypeAdapter(GsonFactoryTest.class, new TypeAdapter() { @@ -58,18 +58,18 @@ public void write(final JsonWriter out, final Object value) throws IOException { } @Test - public void assertGetJsonParser() { + void assertGetJsonParser() { assertThat(GsonFactory.getJsonParser(), is(GsonFactory.getJsonParser())); } @Test - public void assertParser() { + void assertParser() { String json = "{\"name\":\"test\"}"; assertThat(GsonFactory.getJsonParser().parse(json).getAsJsonObject().get("name").getAsString(), is("test")); } @Test - public void assertParserWithException() { + void assertParserWithException() { assertThrows(JsonParseException.class, () -> { String json = "{\"name\":\"test\""; assertThat(GsonFactory.getJsonParser().parse(json).getAsJsonObject().get("name").getAsString(), is("test")); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java index 4e0333e0d7..669316cc8a 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java @@ -25,15 +25,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class ElasticJobListenerFactoryTest { +class ElasticJobListenerFactoryTest { @Test - public void assertCreateInvalidJobListener() { + void assertCreateInvalidJobListener() { assertThrows(JobConfigurationException.class, () -> ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!"))); } @Test - public void assertCreatJobListener() { + void assertCreatJobListener() { assertThat(ElasticJobListenerFactory.createListener("fooElasticJobListener").orElse(null), instanceOf(FooElasticJobListener.class)); } } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java index 91375ad711..36139d5c17 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java @@ -26,10 +26,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class ShardingContextsTest { +class ShardingContextsTest { @Test - public void assertCreateShardingContext() { + void assertCreateShardingContext() { ShardingContexts shardingContexts = createShardingContexts(); ShardingContext actual = shardingContexts.createShardingContext(1); assertThat(actual.getJobName(), is(shardingContexts.getJobName())); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java index 4e8493abc0..87022c38f1 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java @@ -30,7 +30,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class JobConfigurationPOJOTest { +class JobConfigurationPOJOTest { private static final String YAML = "cron: 0/1 * * * * ?\n" + "description: Job description\n" @@ -65,7 +65,7 @@ public final class JobConfigurationPOJOTest { + "staticSharding: false\n"; @Test - public void assertToJobConfiguration() { + void assertToJobConfiguration() { JobConfigurationPOJO pojo = new JobConfigurationPOJO(); pojo.setJobName("test_job"); pojo.setCron("0/1 * * * * ?"); @@ -103,7 +103,7 @@ public void assertToJobConfiguration() { } @Test - public void assertFromJobConfiguration() { + void assertFromJobConfiguration() { JobConfiguration jobConfiguration = JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?") .shardingItemParameters("0=A,1=B,2=C").jobParameter("param") @@ -131,7 +131,7 @@ public void assertFromJobConfiguration() { } @Test - public void assertMarshal() { + void assertMarshal() { JobConfigurationPOJO actual = new JobConfigurationPOJO(); actual.setJobName("test_job"); actual.setCron("0/1 * * * * ?"); @@ -148,7 +148,7 @@ public void assertMarshal() { } @Test - public void assertMarshalWithNullValue() { + void assertMarshalWithNullValue() { JobConfigurationPOJO actual = new JobConfigurationPOJO(); actual.setJobName("test_job"); actual.setCron("0/1 * * * * ?"); @@ -158,7 +158,7 @@ public void assertMarshalWithNullValue() { } @Test - public void assertUnmarshal() { + void assertUnmarshal() { JobConfigurationPOJO actual = YamlEngine.unmarshal(YAML, JobConfigurationPOJO.class); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); @@ -176,7 +176,7 @@ public void assertUnmarshal() { } @Test - public void assertUnmarshalWithNullValue() { + void assertUnmarshalWithNullValue() { JobConfigurationPOJO actual = YamlEngine.unmarshal(YAML_WITH_NULL, JobConfigurationPOJO.class); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java index 350ce60876..e21af0f174 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java @@ -28,43 +28,43 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; -public final class ElasticJobServiceLoaderTest { +class ElasticJobServiceLoaderTest { @BeforeAll - public static void register() { + static void register() { ElasticJobServiceLoader.registerTypedService(TypedFooService.class); } @Test - public void assertGetCacheTypedService() { + void assertGetCacheTypedService() { assertThat(ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "typedFooServiceImpl").orElse(null), instanceOf(TypedFooService.class)); } @Test - public void assertNewTypedServiceInstance() { + void assertNewTypedServiceInstance() { assertThat(ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "typedFooServiceImpl").orElse(null), instanceOf(TypedFooService.class)); } @Test - public void assertGetCacheTypedServiceFailureWithUnRegisteredServiceInterface() { + void assertGetCacheTypedServiceFailureWithUnRegisteredServiceInterface() { Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new)); } @Test - public void assertGetCacheTypedServiceFailureWithInvalidType() { + void assertGetCacheTypedServiceFailureWithInvalidType() { Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new)); } @Test - public void assertNewTypedServiceInstanceFailureWithUnRegisteredServiceInterface() { + void assertNewTypedServiceInstanceFailureWithUnRegisteredServiceInterface() { Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader .newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new)); } @Test - public void assertNewTypedServiceInstanceFailureWithInvalidType() { + void assertNewTypedServiceInstanceFailureWithInvalidType() { Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.newTypedServiceInstance( TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new)); } diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java index 5f7e0e3c9c..c1a732a074 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java @@ -24,10 +24,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobPropertiesValidateRuleTest { +class JobPropertiesValidateRuleTest { @Test - public void assertValidateIsRequiredWithValidateError() { + void assertValidateIsRequiredWithValidateError() { try { JobPropertiesValidateRule.validateIsRequired(new Properties(), "key"); } catch (NullPointerException ex) { @@ -36,26 +36,26 @@ public void assertValidateIsRequiredWithValidateError() { } @Test - public void assertValidateIsRequiredWithNormal() { + void assertValidateIsRequiredWithNormal() { Properties properties = new Properties(); properties.setProperty("key", "value"); JobPropertiesValidateRule.validateIsRequired(properties, "key"); } @Test - public void assertValidateIsPositiveIntegerWithValueNoExist() { + void assertValidateIsPositiveIntegerWithValueNoExist() { JobPropertiesValidateRule.validateIsPositiveInteger(new Properties(), "key"); } @Test - public void assertValidateIsPositiveIntegerWithNormal() { + void assertValidateIsPositiveIntegerWithNormal() { Properties properties = new Properties(); properties.setProperty("key", "1"); JobPropertiesValidateRule.validateIsPositiveInteger(new Properties(), "key"); } @Test - public void assertValidateIsPositiveIntegerWithWrongString() { + void assertValidateIsPositiveIntegerWithWrongString() { Properties properties = new Properties(); properties.setProperty("key", "wrong_value"); try { @@ -66,7 +66,7 @@ public void assertValidateIsPositiveIntegerWithWrongString() { } @Test - public void assertValidateIsPositiveIntegerWithNegativeNumber() { + void assertValidateIsPositiveIntegerWithNegativeNumber() { Properties properties = new Properties(); properties.setProperty("key", "-1"); try { diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java index 9bebfef178..1e830b65ad 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; -public final class YamlEngineTest { +class YamlEngineTest { private static final String YAML = "bar: bar\n" + "foo: foo\n" @@ -39,7 +39,7 @@ public final class YamlEngineTest { private static final String PREFIX2 = "nest.bar"; @Test - public void assertMarshal() { + void assertMarshal() { FooYamlConfiguration actual = new FooYamlConfiguration(); actual.setFoo("foo"); actual.setBar("bar"); @@ -51,14 +51,14 @@ public void assertMarshal() { } @Test - public void assertMarshalWithNullValue() { + void assertMarshalWithNullValue() { FooYamlConfiguration actual = new FooYamlConfiguration(); actual.setFoo("foo"); assertThat(YamlEngine.marshal(actual), is(YAML_WITH_NULL)); } @Test - public void assertUnmarshal() { + void assertUnmarshal() { FooYamlConfiguration actual = YamlEngine.unmarshal(YAML, FooYamlConfiguration.class); assertThat(actual.getFoo(), is("foo")); assertThat(actual.getBar(), is("bar")); @@ -67,7 +67,7 @@ public void assertUnmarshal() { } @Test - public void assertUnmarshalWithNullValue() { + void assertUnmarshalWithNullValue() { FooYamlConfiguration actual = YamlEngine.unmarshal(YAML_WITH_NULL, FooYamlConfiguration.class); assertThat(actual.getFoo(), is("foo")); assertNull(actual.getBar()); diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java index 0de1734828..7d2a2f0946 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java +++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java @@ -21,14 +21,13 @@ import static org.junit.jupiter.api.Assertions.assertFalse; -public final class YamlConfigurationConverterFactoryTest { +class YamlConfigurationConverterFactoryTest { @Test - public void assertConverterNotFound() { + void assertConverterNotFound() { assertFalse(YamlConfigurationConverterFactory.findConverter(AClassWithoutCorrespondingConverter.class).isPresent()); } private static class AClassWithoutCorrespondingConverter { - } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java index dc268358c5..a29a10f3af 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java @@ -30,7 +30,7 @@ enum State { RECONNECTED, - UNAVAILABLE, + UNAVAILABLE } /** diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java index bf382a5366..a4d5ec50d7 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java @@ -23,10 +23,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class TransactionOperationTest { +class TransactionOperationTest { @Test - public void assertOpAdd() { + void assertOpAdd() { TransactionOperation actual = TransactionOperation.opAdd("key", "value"); assertThat(actual.getType(), is(Type.ADD)); assertThat(actual.getKey(), is("key")); @@ -34,7 +34,7 @@ public void assertOpAdd() { } @Test - public void assertOpUpdate() { + void assertOpUpdate() { TransactionOperation actual = TransactionOperation.opUpdate("key", "value"); assertThat(actual.getType(), is(Type.UPDATE)); assertThat(actual.getKey(), is("key")); @@ -42,14 +42,14 @@ public void assertOpUpdate() { } @Test - public void assertOpDelete() { + void assertOpDelete() { TransactionOperation actual = TransactionOperation.opDelete("key"); assertThat(actual.getType(), is(Type.DELETE)); assertThat(actual.getKey(), is("key")); } @Test - public void assertOpCheckExists() { + void assertOpCheckExists() { TransactionOperation actual = TransactionOperation.opCheckExists("key"); assertThat(actual.getType(), is(Type.CHECK_EXISTS)); assertThat(actual.getKey(), is("key")); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java index 01c0e1e575..0622e7c0b9 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java @@ -22,22 +22,22 @@ import static org.junit.jupiter.api.Assertions.assertThrows; -public final class RegExceptionHandlerTest { +class RegExceptionHandlerTest { @Test @Disabled // TODO throw InterruptedException will cause zookeeper TestingServer break. Ignore first, fix it later. - public void assertHandleExceptionWithInterruptedException() { + void assertHandleExceptionWithInterruptedException() { RegExceptionHandler.handleException(new InterruptedException()); } @Test - public void assertHandleExceptionWithNull() { + void assertHandleExceptionWithNull() { RegExceptionHandler.handleException(null); } @Test - public void assertHandleExceptionWithOtherException() { + void assertHandleExceptionWithOtherException() { assertThrows(RegException.class, () -> RegExceptionHandler.handleException(new RuntimeException())); } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java index f02943e254..3320dde803 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class ZookeeperConfigurationTest { +class ZookeeperConfigurationTest { @Test - public void assertNewZookeeperConfigurationForServerListsAndNamespace() { + void assertNewZookeeperConfigurationForServerListsAndNamespace() { ZookeeperConfiguration zkConfig = new ZookeeperConfiguration("localhost:2181", "myNamespace"); assertThat(zkConfig.getServerLists(), is("localhost:2181")); assertThat(zkConfig.getNamespace(), is("myNamespace")); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 5edb311d47..ec14a7a951 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public class ZookeeperElectionServiceTest { +class ZookeeperElectionServiceTest { private static final String HOST_AND_PORT = "localhost:8899"; @@ -50,12 +50,12 @@ public class ZookeeperElectionServiceTest { private ElectionCandidate electionCandidate; @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); } @Test - public void assertContend() throws Exception { + void assertContend() throws Exception { CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); client.start(); client.blockUntilConnected(); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java index bc8e215b14..ec43699cc4 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -public final class ZookeeperRegistryCenterExecuteInLeaderTest { +class ZookeeperRegistryCenterExecuteInLeaderTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterExecuteInLeaderTest.class.getName()); @@ -39,7 +39,7 @@ public final class ZookeeperRegistryCenterExecuteInLeaderTest { private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); @@ -47,13 +47,13 @@ public static void setUp() { } @AfterAll - public static void tearDown() { + static void tearDown() { zkRegCenter.close(); } @Test @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) - public void assertExecuteInLeader() throws InterruptedException { + void assertExecuteInLeader() throws InterruptedException { final int threads = 10; CountDownLatch countDownLatch = new CountDownLatch(threads); SerialOnlyExecutionCallback serialOnlyExecutionCallback = new SerialOnlyExecutionCallback(countDownLatch, Thread.currentThread()); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index d4f4fe7167..c86f4396f8 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -31,7 +31,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class ZookeeperRegistryCenterForAuthTest { +class ZookeeperRegistryCenterForAuthTest { private static final String NAME_SPACE = ZookeeperRegistryCenterForAuthTest.class.getName(); @@ -40,7 +40,7 @@ public final class ZookeeperRegistryCenterForAuthTest { private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); ZOOKEEPER_CONFIGURATION.setDigest("digest:password"); ZOOKEEPER_CONFIGURATION.setSessionTimeoutMilliseconds(5000); @@ -51,12 +51,12 @@ public static void setUp() { } @AfterAll - public static void tearDown() { + static void tearDown() { zkRegCenter.close(); } @Test - public void assertInitWithDigestSuccess() throws Exception { + void assertInitWithDigestSuccess() throws Exception { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(EmbedTestingServer.getConnectionString()) .retryPolicy(new RetryOneTime(2000)) @@ -67,7 +67,7 @@ public void assertInitWithDigestSuccess() throws Exception { } @Test - public void assertInitWithDigestFailure() { + void assertInitWithDigestFailure() { assertThrows(NoAuthException.class, () -> { CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); client.start(); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java index dc59f3ad97..e32e51a966 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java @@ -22,10 +22,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; -public final class ZookeeperRegistryCenterInitFailureTest { +class ZookeeperRegistryCenterInitFailureTest { @Test - public void assertInitFailure() { + void assertInitFailure() { assertThrows(RegException.class, () -> { ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("localhost:1", ZookeeperRegistryCenterInitFailureTest.class.getName())); zkRegCenter.init(); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java index a5e84a63fb..1b1657b417 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java @@ -42,7 +42,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public class ZookeeperRegistryCenterListenerTest { +class ZookeeperRegistryCenterListenerTest { @Mock private Map caches; @@ -64,14 +64,14 @@ public class ZookeeperRegistryCenterListenerTest { private final String jobPath = "/test_job"; @BeforeEach - public void setUp() { + void setUp() { regCenter = new ZookeeperRegistryCenter(null); ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "caches", caches); ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "client", client); } @Test - public void testAddConnectionStateChangedEventListener() { + void testAddConnectionStateChangedEventListener() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); regCenter.addConnectionStateChangedEventListener(jobPath, null); verify(client.getConnectionStateListenable()).addListener(any()); @@ -79,7 +79,7 @@ public void testAddConnectionStateChangedEventListener() { } @Test - public void testWatch() { + void testWatch() { when(caches.get(jobPath + "/")).thenReturn(cache); when(cache.listenable()).thenReturn(dataListenable); regCenter.watch(jobPath, null, null); @@ -88,7 +88,7 @@ public void testWatch() { } @Test - public void testRemoveDataListenersNonCache() { + void testRemoveDataListenersNonCache() { when(cache.listenable()).thenReturn(dataListenable); regCenter.removeDataListeners(jobPath); verify(cache.listenable(), never()).removeListener(any()); @@ -96,7 +96,7 @@ public void testRemoveDataListenersNonCache() { } @Test - public void testRemoveDataListenersHasCache() { + void testRemoveDataListenersHasCache() { when(caches.get(jobPath + "/")).thenReturn(cache); when(cache.listenable()).thenReturn(dataListenable); List list = new ArrayList<>(); @@ -109,7 +109,7 @@ public void testRemoveDataListenersHasCache() { } @Test - public void testRemoveDataListenersHasCacheEmptyListeners() { + void testRemoveDataListenersHasCacheEmptyListeners() { when(caches.get(jobPath + "/")).thenReturn(cache); when(cache.listenable()).thenReturn(dataListenable); regCenter.removeDataListeners(jobPath); @@ -118,7 +118,7 @@ public void testRemoveDataListenersHasCacheEmptyListeners() { } @Test - public void testRemoveConnStateListener() { + void testRemoveConnStateListener() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); List list = new ArrayList<>(); list.add(null); @@ -131,7 +131,7 @@ public void testRemoveConnStateListener() { } @Test - public void testRemoveConnStateListenerEmptyListeners() { + void testRemoveConnStateListenerEmptyListeners() { when(client.getConnectionStateListenable()).thenReturn(connStateListenable); regCenter.removeConnStateListener(jobPath); assertNull(getConnStateListeners().get(jobPath)); @@ -140,13 +140,11 @@ public void testRemoveConnStateListenerEmptyListeners() { @SuppressWarnings("unchecked") private Map> getConnStateListeners() { - return (Map>) ZookeeperRegistryCenterTestUtil - .getFieldValue(regCenter, "connStateListeners"); + return (Map>) ZookeeperRegistryCenterTestUtil.getFieldValue(regCenter, "connStateListeners"); } @SuppressWarnings("unchecked") private Map> getDataListeners() { - return (Map>) ZookeeperRegistryCenterTestUtil - .getFieldValue(regCenter, "dataListeners"); + return (Map>) ZookeeperRegistryCenterTestUtil.getFieldValue(regCenter, "dataListeners"); } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java index 119335b6f0..d5fc1fe656 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java @@ -28,7 +28,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class ZookeeperRegistryCenterMiscellaneousTest { +class ZookeeperRegistryCenterMiscellaneousTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterMiscellaneousTest.class.getName()); @@ -36,7 +36,7 @@ public final class ZookeeperRegistryCenterMiscellaneousTest { private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); @@ -45,23 +45,23 @@ public static void setUp() { } @AfterAll - public static void tearDown() { + static void tearDown() { zkRegCenter.close(); } @Test - public void assertGetRawClient() { + void assertGetRawClient() { assertThat(zkRegCenter.getRawClient(), instanceOf(CuratorFramework.class)); assertThat(((CuratorFramework) zkRegCenter.getRawClient()).getNamespace(), is(ZookeeperRegistryCenterMiscellaneousTest.class.getName())); } @Test - public void assertGetRawCache() { + void assertGetRawCache() { assertThat(zkRegCenter.getRawCache("/test"), instanceOf(CuratorCache.class)); } @Test - public void assertGetZkConfig() { + void assertGetZkConfig() { ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); assertThat(zkRegCenter.getZkConfig(), is(ZOOKEEPER_CONFIGURATION)); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index 10da179f00..5736390517 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -35,14 +35,14 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ZookeeperRegistryCenterModifyTest { +class ZookeeperRegistryCenterModifyTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterModifyTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); @@ -51,12 +51,12 @@ public static void setUp() { } @AfterAll - public static void tearDown() { + static void tearDown() { zkRegCenter.close(); } @Test - public void assertPersist() { + void assertPersist() { zkRegCenter.persist("/test", "test_update"); zkRegCenter.persist("/persist/new", "new_value"); assertThat(zkRegCenter.get("/test"), is("test_update")); @@ -64,14 +64,14 @@ public void assertPersist() { } @Test - public void assertUpdate() { + void assertUpdate() { zkRegCenter.persist("/update", "before_update"); zkRegCenter.update("/update", "after_update"); assertThat(zkRegCenter.getDirectly("/update"), is("after_update")); } @Test - public void assertPersistEphemeral() throws Exception { + void assertPersistEphemeral() throws Exception { zkRegCenter.persist("/persist", "persist_value"); zkRegCenter.persistEphemeral("/ephemeral", "ephemeral_value"); assertThat(zkRegCenter.get("/persist"), is("persist_value")); @@ -86,7 +86,7 @@ public void assertPersistEphemeral() throws Exception { } @Test - public void assertPersistSequential() throws Exception { + void assertPersistSequential() throws Exception { assertThat(zkRegCenter.persistSequential("/sequential/test_sequential", "test_value"), startsWith("/sequential/test_sequential")); assertThat(zkRegCenter.persistSequential("/sequential/test_sequential", "test_value"), startsWith("/sequential/test_sequential")); CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); @@ -103,7 +103,7 @@ public void assertPersistSequential() throws Exception { } @Test - public void assertPersistEphemeralSequential() throws Exception { + void assertPersistEphemeralSequential() throws Exception { zkRegCenter.persistEphemeralSequential("/sequential/test_ephemeral_sequential"); zkRegCenter.persistEphemeralSequential("/sequential/test_ephemeral_sequential"); CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); @@ -121,7 +121,7 @@ public void assertPersistEphemeralSequential() throws Exception { } @Test - public void assertRemove() { + void assertRemove() { zkRegCenter.remove("/test"); assertFalse(zkRegCenter.isExisted("/test")); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index 3b22d66051..7a54c80851 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -27,7 +27,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; -public final class ZookeeperRegistryCenterQueryWithCacheTest { +class ZookeeperRegistryCenterQueryWithCacheTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithCacheTest.class.getName()); @@ -35,7 +35,7 @@ public final class ZookeeperRegistryCenterQueryWithCacheTest { private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); @@ -45,17 +45,17 @@ public static void setUp() { } @AfterAll - public static void tearDown() { + static void tearDown() { zkRegCenter.close(); } @Test - public void assertGetWithoutValue() { + void assertGetWithoutValue() { assertNull(zkRegCenter.get("/test/null")); } @Test - public void assertGetFromCache() { + void assertGetFromCache() { assertThat(zkRegCenter.get("/test"), is("test")); assertThat(zkRegCenter.get("/test/deep/nested"), is("deepNested")); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index 94e630d291..c15e81dd26 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ZookeeperRegistryCenterQueryWithoutCacheTest { +class ZookeeperRegistryCenterQueryWithoutCacheTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithoutCacheTest.class.getName()); @@ -40,7 +40,7 @@ public final class ZookeeperRegistryCenterQueryWithoutCacheTest { private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); @@ -50,18 +50,18 @@ public static void setUp() { } @AfterAll - public static void tearDown() { + static void tearDown() { zkRegCenter.close(); } @Test - public void assertGetFromServer() { + void assertGetFromServer() { assertThat(zkRegCenter.get("/test"), is("test")); assertThat(zkRegCenter.get("/test/deep/nested"), is("deepNested")); } @Test - public void assertGetChildrenKeys() { + void assertGetChildrenKeys() { assertThat(zkRegCenter.getChildrenKeys("/test"), is(Arrays.asList("deep", "child"))); assertThat(zkRegCenter.getChildrenKeys("/test/deep"), is(Collections.singletonList("nested"))); assertThat(zkRegCenter.getChildrenKeys("/test/child"), is(Collections.emptyList())); @@ -69,7 +69,7 @@ public void assertGetChildrenKeys() { } @Test - public void assertGetNumChildren() { + void assertGetNumChildren() { assertThat(zkRegCenter.getNumChildren("/test"), is(2)); assertThat(zkRegCenter.getNumChildren("/test/deep"), is(1)); assertThat(zkRegCenter.getNumChildren("/test/child"), is(0)); @@ -77,14 +77,14 @@ public void assertGetNumChildren() { } @Test - public void assertIsExisted() { + void assertIsExisted() { assertTrue(zkRegCenter.isExisted("/test")); assertTrue(zkRegCenter.isExisted("/test/deep/nested")); assertFalse(zkRegCenter.isExisted("/notExisted")); } @Test - public void assertGetRegistryCenterTime() { + void assertGetRegistryCenterTime() { long regCenterTime = zkRegCenter.getRegistryCenterTime("/_systemTime/current"); assertTrue(regCenterTime <= System.currentTimeMillis()); long updatedRegCenterTime = zkRegCenter.getRegistryCenterTime("/_systemTime/current"); @@ -92,7 +92,7 @@ public void assertGetRegistryCenterTime() { } @Test - public void assertGetWithoutNode() { + void assertGetWithoutNode() { assertNull(zkRegCenter.get("/notExisted")); } } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index 4f5c08a730..6ff7882c12 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -32,7 +32,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; -public final class ZookeeperRegistryCenterTransactionTest { +class ZookeeperRegistryCenterTransactionTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); @@ -40,7 +40,7 @@ public final class ZookeeperRegistryCenterTransactionTest { private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); @@ -48,12 +48,12 @@ public static void setUp() { } @BeforeEach - public void setup() { + void setup() { ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); } @Test - public void assertExecuteInTransactionSucceeded() throws Exception { + void assertExecuteInTransactionSucceeded() throws Exception { List operations = new ArrayList<>(3); operations.add(TransactionOperation.opCheckExists("/test")); operations.add(TransactionOperation.opCheckExists("/test/child")); @@ -64,7 +64,7 @@ public void assertExecuteInTransactionSucceeded() throws Exception { } @Test - public void assertExecuteInTransactionFailed() throws Exception { + void assertExecuteInTransactionFailed() throws Exception { List operations = new ArrayList<>(3); operations.add(TransactionOperation.opAdd("/test/shouldnotexists", "")); operations.add(TransactionOperation.opCheckExists("/test/notexists")); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index f6a0eeaf07..8720358229 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -35,14 +35,14 @@ import static org.hamcrest.CoreMatchers.startsWith; import static org.hamcrest.MatcherAssert.assertThat; -public final class ZookeeperRegistryCenterWatchTest { +class ZookeeperRegistryCenterWatchTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void setUp() { + static void setUp() { EmbedTestingServer.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); @@ -51,13 +51,13 @@ public static void setUp() { } @AfterAll - public static void tearDown() { + static void tearDown() { zkRegCenter.close(); } @Test @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) - public void assertWatchWithoutExecutor() throws InterruptedException { + void assertWatchWithoutExecutor() throws InterruptedException { CountDownLatch waitingForCountDownValue = new CountDownLatch(1); String key = "/test-watch-without-executor"; zkRegCenter.addCacheData(key); @@ -76,7 +76,7 @@ public void assertWatchWithoutExecutor() throws InterruptedException { @Test @Timeout(value = 10000L, unit = TimeUnit.MILLISECONDS) - public void assertWatchWithExecutor() throws InterruptedException { + void assertWatchWithExecutor() throws InterruptedException { CountDownLatch waitingForCountDownValue = new CountDownLatch(1); String key = "/test-watch-with-executor"; zkRegCenter.addCacheData(key); diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java index 70109d83e0..a953548540 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java @@ -28,10 +28,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class ZookeeperCuratorIgnoredExceptionProviderTest { +class ZookeeperCuratorIgnoredExceptionProviderTest { @Test - public void assertIgnoredException() { + void assertIgnoredException() { List> expected = Arrays.asList(ConnectionLossException.class, NoNodeException.class, NodeExistsException.class); assertThat(new ZookeeperCuratorIgnoredExceptionProvider().getIgnoredExceptions(), is(expected)); } diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java index e9f8da443b..dc16f0dd99 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java @@ -25,7 +25,7 @@ import java.lang.reflect.Field; @NoArgsConstructor(access = AccessLevel.PRIVATE) -public class ZookeeperRegistryCenterTestUtil { +public final class ZookeeperRegistryCenterTestUtil { /** * Persist the data to registry center. diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java index 0eff5f0be5..6a32a59aeb 100644 --- a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java +++ b/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java @@ -46,5 +46,5 @@ public enum ParamSource { /** * Unknown source. */ - UNKNOWN, + UNKNOWN } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java index 6770959ca9..5126e3df52 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java @@ -29,10 +29,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class RegexPathMatcherTest { +class RegexPathMatcherTest { @Test - public void assertCaptureTemplate() { + void assertCaptureTemplate() { PathMatcher pathMatcher = new RegexPathMatcher(); Map variables = pathMatcher.captureVariables("/app/{jobName}/disable/{until}/done", "/app/myJob/disable/20201231/done?name=some_name&value=some_value"); assertFalse(variables.isEmpty()); @@ -43,20 +43,20 @@ public void assertCaptureTemplate() { } @Test - public void assertCapturePatternWithoutTemplate() { + void assertCapturePatternWithoutTemplate() { PathMatcher pathMatcher = new RegexPathMatcher(); Map variables = pathMatcher.captureVariables("/app", "/app"); assertTrue(variables.isEmpty()); } @Test - public void assertPathMatch() { + void assertPathMatch() { PathMatcher pathMatcher = new RegexPathMatcher(); assertTrue(pathMatcher.matches("/app/{jobName}", "/app/myJob")); } @Test - public void assertValidatePathPattern() { + void assertValidatePathPattern() { PathMatcher pathMatcher = new RegexPathMatcher(); assertTrue(pathMatcher.isValidPathPattern("/")); assertTrue(pathMatcher.isValidPathPattern("/app")); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java index f124f4ab45..1a83142144 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java @@ -27,10 +27,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class RegexUrlPatternMapTest { +class RegexUrlPatternMapTest { @Test - public void assertRegexUrlPatternMap() { + void assertRegexUrlPatternMap() { RegexUrlPatternMap urlPatternMap = new RegexUrlPatternMap<>(); urlPatternMap.put("/app/{jobName}", 1); urlPatternMap.put("/app/list", 2); @@ -49,7 +49,7 @@ public void assertRegexUrlPatternMap() { } @Test - public void assertAmbiguous() { + void assertAmbiguous() { RegexUrlPatternMap urlPatternMap = new RegexUrlPatternMap<>(); urlPatternMap.put("/foo/{bar}/{fooName}/status", 10); urlPatternMap.put("/foo/{bar}/operate/{metrics}", 11); @@ -60,7 +60,7 @@ public void assertAmbiguous() { } @Test - public void assertDuplicate() { + void assertDuplicate() { assertThrows(IllegalArgumentException.class, () -> { RegexUrlPatternMap urlPatternMap = new RegexUrlPatternMap<>(); urlPatternMap.put("/app/{jobName}/enable", 0); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java index 0376b03458..26cf3eb53e 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java @@ -23,16 +23,16 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class RequestBodyDeserializerFactoryTest { +class RequestBodyDeserializerFactoryTest { @Test - public void assertGetJsonDefaultDeserializer() { + void assertGetJsonDefaultDeserializer() { RequestBodyDeserializer deserializer = RequestBodyDeserializerFactory.getRequestBodyDeserializer(HttpHeaderValues.APPLICATION_JSON.toString()); assertNotNull(deserializer); } @Test - public void assertDeserializerNotFound() { + void assertDeserializerNotFound() { assertThrows(RequestBodyDeserializerNotFoundException.class, () -> RequestBodyDeserializerFactory.getRequestBodyDeserializer("Unknown")); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java index d3dc3f022c..719937b9ef 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java @@ -44,7 +44,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class DefaultFilterChainTest { +class DefaultFilterChainTest { @Mock private ChannelHandlerContext ctx; @@ -58,12 +58,12 @@ public final class DefaultFilterChainTest { private HandleContext handleContext; @BeforeEach - public void setUp() { + void setUp() { handleContext = new HandleContext<>(httpRequest, httpResponse); } @Test - public void assertNoFilter() { + void assertNoFilter() { DefaultFilterChain filterChain = new DefaultFilterChain(Collections.emptyList(), ctx, handleContext); filterChain.next(httpRequest); verify(ctx, never()).writeAndFlush(httpResponse); @@ -73,7 +73,7 @@ public void assertNoFilter() { } @Test - public void assertWithSingleFilterPassed() { + void assertWithSingleFilterPassed() { Filter passableFilter = spy(new PassableFilter()); DefaultFilterChain filterChain = new DefaultFilterChain(Collections.singletonList(passableFilter), ctx, handleContext); filterChain.next(httpRequest); @@ -85,7 +85,7 @@ public void assertWithSingleFilterPassed() { } @Test - public void assertWithSingleFilterDoResponse() { + void assertWithSingleFilterDoResponse() { Filter impassableFilter = mock(Filter.class); DefaultFilterChain filterChain = new DefaultFilterChain(Collections.singletonList(impassableFilter), ctx, handleContext); filterChain.next(httpRequest); @@ -97,7 +97,7 @@ public void assertWithSingleFilterDoResponse() { } @Test - public void assertWithThreeFiltersPassed() { + void assertWithThreeFiltersPassed() { Filter firstFilter = spy(new PassableFilter()); Filter secondFilter = spy(new PassableFilter()); Filter thirdFilter = spy(new PassableFilter()); @@ -113,7 +113,7 @@ public void assertWithThreeFiltersPassed() { } @Test - public void assertWithThreeFiltersDoResponseByTheSecond() { + void assertWithThreeFiltersDoResponseByTheSecond() { Filter firstFilter = spy(new PassableFilter()); Filter secondFilter = mock(Filter.class); Filter thirdFilter = spy(new PassableFilter()); @@ -129,7 +129,7 @@ public void assertWithThreeFiltersDoResponseByTheSecond() { } @Test - public void assertInvokeFinishedFilterChainWithoutFilter() { + void assertInvokeFinishedFilterChainWithoutFilter() { assertThrows(IllegalStateException.class, () -> { DefaultFilterChain filterChain = new DefaultFilterChain(Collections.emptyList(), ctx, handleContext); filterChain.next(httpRequest); @@ -138,7 +138,7 @@ public void assertInvokeFinishedFilterChainWithoutFilter() { } @Test - public void assertInvokePassedThroughFilterChainWithTwoFilters() { + void assertInvokePassedThroughFilterChainWithTwoFilters() { assertThrows(IllegalStateException.class, () -> { Filter firstFilter = spy(new PassableFilter()); Filter secondFilter = spy(new PassableFilter()); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java index f3f95c3dbc..67cc066545 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java @@ -36,7 +36,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class FilterChainInboundHandlerTest { +class FilterChainInboundHandlerTest { @Mock private List filterInstances; @@ -47,20 +47,20 @@ public final class FilterChainInboundHandlerTest { private EmbeddedChannel channel; @BeforeEach - public void setUp() { + void setUp() { channel = new EmbeddedChannel(new FilterChainInboundHandler(filterInstances)); } @Test @SneakyThrows - public void assertNoFilter() { + void assertNoFilter() { when(filterInstances.isEmpty()).thenReturn(true); channel.writeOneInbound(handleContext); verify(handleContext, never()).getHttpRequest(); } @Test - public void assertFilterExists() { + void assertFilterExists() { when(filterInstances.isEmpty()).thenReturn(false); channel.writeOneInbound(handleContext); verify(handleContext, atLeastOnce()).getHttpRequest(); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java index 7af51ce1ad..ed909a3e4a 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java @@ -43,12 +43,12 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class HandlerParameterDecoderTest { +class HandlerParameterDecoderTest { private EmbeddedChannel channel; @BeforeEach - public void setUp() { + void setUp() { ContextInitializationInboundHandler contextInitializationInboundHandler = new ContextInitializationInboundHandler(); HttpRequestDispatcher httpRequestDispatcher = new HttpRequestDispatcher(Collections.singletonList(new DecoderTestController()), false); HandlerParameterDecoder handlerParameterDecoder = new HandlerParameterDecoder(); @@ -57,7 +57,7 @@ public void setUp() { } @Test - public void assertDecodeParameters() { + void assertDecodeParameters() { QueryStringEncoder queryStringEncoder = new QueryStringEncoder("/myApp/C"); queryStringEncoder.addParam("cron", "0 * * * * ?"); queryStringEncoder.addParam("integer", "30"); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java index 185bcf1a3c..12027a5d89 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java @@ -30,10 +30,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; -public final class HttpRequestDispatcherTest { +class HttpRequestDispatcherTest { @Test - public void assertDispatcherHandlerNotFound() { + void assertDispatcherHandlerNotFound() { assertThrows(HandlerNotFoundException.class, () -> { EmbeddedChannel channel = new EmbeddedChannel(new HttpRequestDispatcher(Lists.newArrayList(new JobController()), false)); FullHttpRequest fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/hello/myJob/myCron"); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java index 253b013e80..bb6654a88f 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java @@ -47,7 +47,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; -public final class NettyRestfulServiceTest { +class NettyRestfulServiceTest { private static final long TESTCASE_TIMEOUT = 10000L; @@ -58,7 +58,7 @@ public final class NettyRestfulServiceTest { private static RestfulService restfulService; @BeforeAll - public static void init() { + static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); configuration.addControllerInstances(new JobController(), new IndexController()); @@ -70,7 +70,7 @@ public static void init() { @SneakyThrows @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertRequestWithParameters() { + void assertRequestWithParameters() { String cron = "0 * * * * ?"; String uri = String.format("/job/myGroup/myJob?cron=%s", URLEncoder.encode(cron, "UTF-8")); String description = "Descriptions about this job."; @@ -93,7 +93,7 @@ public void assertRequestWithParameters() { @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertCustomExceptionHandler() { + void assertCustomExceptionHandler() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/job/throw/IllegalState"); request.headers().set("Exception-Message", "An illegal state exception message."); HttpClient.request(HOST, PORT, request, httpResponse -> { @@ -104,7 +104,7 @@ public void assertCustomExceptionHandler() { @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertUsingDefaultExceptionHandler() { + void assertUsingDefaultExceptionHandler() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/job/throw/IllegalArgument"); request.headers().set("Exception-Message", "An illegal argument exception message."); HttpClient.request(HOST, PORT, request, httpResponse -> { @@ -115,42 +115,34 @@ public void assertUsingDefaultExceptionHandler() { @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertReturnStatusCode() { + void assertReturnStatusCode() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/job/code/204"); - HttpClient.request(HOST, PORT, request, httpResponse -> { - assertThat(httpResponse.status().code(), is(204)); - }, TESTCASE_TIMEOUT); + HttpClient.request(HOST, PORT, request, httpResponse -> assertThat(httpResponse.status().code(), is(204)), TESTCASE_TIMEOUT); } @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertHandlerNotFound() { + void assertHandlerNotFound() { DefaultFullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/not/found"); - HttpClient.request(HOST, PORT, request, httpResponse -> { - assertThat(httpResponse.status().code(), is(404)); - }, TESTCASE_TIMEOUT); + HttpClient.request(HOST, PORT, request, httpResponse -> assertThat(httpResponse.status().code(), is(404)), TESTCASE_TIMEOUT); } @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertRequestIndexWithSlash() { + void assertRequestIndexWithSlash() { DefaultFullHttpRequest requestWithSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/"); - HttpClient.request(HOST, PORT, requestWithSlash, httpResponse -> { - assertThat(httpResponse.status().code(), is(200)); - }, TESTCASE_TIMEOUT); + HttpClient.request(HOST, PORT, requestWithSlash, httpResponse -> assertThat(httpResponse.status().code(), is(200)), TESTCASE_TIMEOUT); } @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertRequestIndexWithoutSlash() { + void assertRequestIndexWithoutSlash() { DefaultFullHttpRequest requestWithoutSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, ""); - HttpClient.request(HOST, PORT, requestWithoutSlash, httpResponse -> { - assertThat(httpResponse.status().code(), is(200)); - }, TESTCASE_TIMEOUT); + HttpClient.request(HOST, PORT, requestWithoutSlash, httpResponse -> assertThat(httpResponse.status().code(), is(200)), TESTCASE_TIMEOUT); } @AfterAll - public static void tearDown() { + static void tearDown() { if (null != restfulService) { restfulService.shutdown(); } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java index a0bf589597..a8f32f85b3 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java @@ -25,14 +25,14 @@ import static org.junit.jupiter.api.Assertions.assertThrows; -public final class NettyRestfulServiceTrailingSlashInsensitiveTest { +class NettyRestfulServiceTrailingSlashInsensitiveTest { private static final String HOST = "localhost"; private static final int PORT = 18082; @Test - public void assertPathDuplicateWhenTrailingSlashInsensitive() { + void assertPathDuplicateWhenTrailingSlashInsensitive() { assertThrows(IllegalArgumentException.class, () -> { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java index 2146168e9c..46dd288d2f 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java @@ -36,7 +36,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class NettyRestfulServiceTrailingSlashSensitiveTest { +class NettyRestfulServiceTrailingSlashSensitiveTest { private static final long TESTCASE_TIMEOUT = 10000L; @@ -47,7 +47,7 @@ public final class NettyRestfulServiceTrailingSlashSensitiveTest { private static RestfulService restfulService; @BeforeAll - public static void init() { + static void init() { NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); configuration.setHost(HOST); configuration.setTrailingSlashSensitive(true); @@ -58,7 +58,7 @@ public static void init() { @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertWithoutTrailingSlash() { + void assertWithoutTrailingSlash() { DefaultFullHttpRequest requestWithSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/trailing/slash"); HttpClient.request(HOST, PORT, requestWithSlash, httpResponse -> { assertThat(httpResponse.status().code(), is(200)); @@ -70,7 +70,7 @@ public void assertWithoutTrailingSlash() { @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - public void assertWithTrailingSlash() { + void assertWithTrailingSlash() { DefaultFullHttpRequest requestWithoutSlash = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/trailing/slash/"); HttpClient.request(HOST, PORT, requestWithoutSlash, httpResponse -> { assertThat(httpResponse.status().code(), is(200)); @@ -81,7 +81,7 @@ public void assertWithTrailingSlash() { } @AfterAll - public static void tearDown() { + static void tearDown() { if (null != restfulService) { restfulService.shutdown(); } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java index b32934535b..69d263144d 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java @@ -23,16 +23,16 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class ResponseBodySerializerFactoryTest { +class ResponseBodySerializerFactoryTest { @Test - public void assertGetJsonDefaultSerializer() { + void assertGetJsonDefaultSerializer() { ResponseBodySerializer serializer = ResponseBodySerializerFactory.getResponseBodySerializer(HttpHeaderValues.APPLICATION_JSON.toString()); assertNotNull(serializer); } @Test - public void assertSerializerNotFound() { + void assertSerializerNotFound() { assertThrows(ResponseBodySerializerNotFoundException.class, () -> ResponseBodySerializerFactory.getResponseBodySerializer("Unknown")); } } diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java index a50a3a1182..a5523b19c0 100644 --- a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java +++ b/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java @@ -30,10 +30,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; -public final class QueryParameterMapTest { +class QueryParameterMapTest { @Test - public void assertGetFirst() { + void assertGetFirst() { QueryParameterMap queryParameterMap = new QueryParameterMap(); queryParameterMap.add("name", "foo"); assertThat(queryParameterMap.getFirst("name"), is("foo")); @@ -41,7 +41,7 @@ public void assertGetFirst() { } @Test - public void assertConvertToSingleValueMap() { + void assertConvertToSingleValueMap() { Map> queries = new LinkedHashMap<>(1 << 2); queries.put("foo", new LinkedList<>(Arrays.asList("first_foo", "second_foo"))); queries.put("bar", new LinkedList<>(Arrays.asList("first_bar", "second_bar"))); @@ -52,7 +52,7 @@ public void assertConvertToSingleValueMap() { } @Test - public void assertGetEntrySet() { + void assertGetEntrySet() { QueryParameterMap queryParameterMap = new QueryParameterMap(); queryParameterMap.put("foo", new LinkedList<>(Arrays.asList("first_foo", "second_foo"))); queryParameterMap.put("bar", new LinkedList<>(Arrays.asList("first_bar", "second_bar"))); diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileService.java index 20afc622c4..b3e410c7fb 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileService.java +++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileService.java @@ -53,7 +53,7 @@ public ReconcileService(final CoordinatorRegistryCenter regCenter, final String @Override protected void runOneIteration() { int reconcileIntervalMinutes = configService.load(true).getReconcileIntervalMinutes(); - if (reconcileIntervalMinutes > 0 && (System.currentTimeMillis() - lastReconcileTime >= reconcileIntervalMinutes * 60 * 1000)) { + if (reconcileIntervalMinutes > 0 && System.currentTimeMillis() - lastReconcileTime >= (long) reconcileIntervalMinutes * 60 * 1000) { lastReconcileTime = System.currentTimeMillis(); if (!shardingService.isNeedSharding() && shardingService.hasShardingInfoInOfflineServers() && !(isStaticSharding() && hasShardingInfo())) { log.warn("Elastic Job: job status node has inconsistent value,start reconciling..."); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java index fd93cf0c45..0ff75c46cb 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class OneOffJobBootstrapTest { +class OneOffJobBootstrapTest { private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), OneOffJobBootstrapTest.class.getSimpleName()); @@ -49,29 +49,29 @@ public final class OneOffJobBootstrapTest { private ZookeeperRegistryCenter zkRegCenter; @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); } @BeforeEach - public void setUp() { + void setUp() { zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); zkRegCenter.init(); } @AfterEach - public void teardown() { + void teardown() { zkRegCenter.close(); } @Test - public void assertConfigFailedWithCron() { + void assertConfigFailedWithCron() { assertThrows(IllegalArgumentException.class, () -> new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> { }, JobConfiguration.newBuilder("test_one_off_job_execute_with_config_cron", SHARDING_TOTAL_COUNT).cron("0/5 * * * * ?").build())); } @Test - public void assertExecute() { + void assertExecute() { AtomicInteger counter = new AtomicInteger(0); final OneOffJobBootstrap oneOffJobBootstrap = new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> counter.incrementAndGet(), JobConfiguration.newBuilder("test_one_off_job_execute", SHARDING_TOTAL_COUNT).build()); @@ -82,7 +82,7 @@ public void assertExecute() { } @Test - public void assertShutdown() throws SchedulerException { + void assertShutdown() throws SchedulerException { OneOffJobBootstrap oneOffJobBootstrap = new OneOffJobBootstrap(zkRegCenter, (SimpleJob) shardingContext -> { }, JobConfiguration.newBuilder("test_one_off_job_shutdown", SHARDING_TOTAL_COUNT).build()); oneOffJobBootstrap.shutdown(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java index e90776a581..04b047e48b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class DistributeOnceElasticJobListenerTest { +class DistributeOnceElasticJobListenerTest { @Mock private GuaranteeService guaranteeService; @@ -57,7 +57,7 @@ public final class DistributeOnceElasticJobListenerTest { private TestDistributeOnceElasticJobListener distributeOnceElasticJobListener; @BeforeEach - public void setUp() { + void setUp() { distributeOnceElasticJobListener = new TestDistributeOnceElasticJobListener(elasticJobListenerCaller); distributeOnceElasticJobListener.setGuaranteeService(guaranteeService); ReflectionUtils.setSuperclassFieldValue(distributeOnceElasticJobListener, "timeService", timeService); @@ -68,7 +68,7 @@ public void setUp() { } @Test - public void assertBeforeJobExecutedWhenIsAllStarted() { + void assertBeforeJobExecutedWhenIsAllStarted() { when(guaranteeService.isRegisterStartSuccess(Sets.newHashSet(0, 1))).thenReturn(true); when(guaranteeService.isAllStarted()).thenReturn(true); distributeOnceElasticJobListener.beforeJobExecuted(shardingContexts); @@ -77,7 +77,7 @@ public void assertBeforeJobExecutedWhenIsAllStarted() { } @Test - public void assertBeforeJobExecutedWhenIsNotAllStartedAndNotTimeout() { + void assertBeforeJobExecutedWhenIsNotAllStartedAndNotTimeout() { when(guaranteeService.isRegisterStartSuccess(Sets.newHashSet(0, 1))).thenReturn(true); when(guaranteeService.isAllStarted()).thenReturn(false); when(timeService.getCurrentMillis()).thenReturn(0L); @@ -87,7 +87,7 @@ public void assertBeforeJobExecutedWhenIsNotAllStartedAndNotTimeout() { } @Test - public void assertBeforeJobExecutedWhenIsNotAllStartedAndTimeout() { + void assertBeforeJobExecutedWhenIsNotAllStartedAndTimeout() { assertThrows(JobSystemException.class, () -> { when(guaranteeService.isRegisterStartSuccess(Sets.newHashSet(0, 1))).thenReturn(true); when(guaranteeService.isAllStarted()).thenReturn(false); @@ -99,7 +99,7 @@ public void assertBeforeJobExecutedWhenIsNotAllStartedAndTimeout() { } @Test - public void assertAfterJobExecutedWhenIsAllCompleted() { + void assertAfterJobExecutedWhenIsAllCompleted() { when(guaranteeService.isRegisterCompleteSuccess(Sets.newHashSet(0, 1))).thenReturn(true); when(guaranteeService.isAllCompleted()).thenReturn(true); distributeOnceElasticJobListener.afterJobExecuted(shardingContexts); @@ -108,7 +108,7 @@ public void assertAfterJobExecutedWhenIsAllCompleted() { } @Test - public void assertAfterJobExecutedWhenIsAllCompletedAndNotTimeout() { + void assertAfterJobExecutedWhenIsAllCompletedAndNotTimeout() { when(guaranteeService.isRegisterCompleteSuccess(Sets.newHashSet(0, 1))).thenReturn(true); when(guaranteeService.isAllCompleted()).thenReturn(false); when(timeService.getCurrentMillis()).thenReturn(0L); @@ -118,7 +118,7 @@ public void assertAfterJobExecutedWhenIsAllCompletedAndNotTimeout() { } @Test - public void assertAfterJobExecutedWhenIsAllCompletedAndTimeout() { + void assertAfterJobExecutedWhenIsAllCompletedAndTimeout() { assertThrows(JobSystemException.class, () -> { when(guaranteeService.isRegisterCompleteSuccess(Sets.newHashSet(0, 1))).thenReturn(true); when(guaranteeService.isAllCompleted()).thenReturn(false); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java index 23a7bcec7d..881c14a7a3 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java @@ -34,41 +34,37 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class JobInstanceRegistryTest { +class JobInstanceRegistryTest { @Mock private CoordinatorRegistryCenter regCenter; @Test - public void assertListenWithoutConfigPath() { - JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id")); - jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName", "")); + void assertListenWithoutConfigPath() { + new JobInstanceRegistry(regCenter, new JobInstance("id")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName", "")); verify(regCenter, times(0)).get("/jobName"); } @Test - public void assertListenLabelNotMatch() { - JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id", "label1,label2")); + void assertListenLabelNotMatch() { String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).label("label").build()); - jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); + new JobInstanceRegistry(regCenter, new JobInstance("id", "label1,label2")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); verify(regCenter, times(0)).get("/jobName"); } @Test - public void assertListenScheduleJob() { + void assertListenScheduleJob() { assertThrows(RuntimeException.class, () -> { - JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id")); String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).cron("0/1 * * * * ?").label("label").build()); - jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); + new JobInstanceRegistry(regCenter, new JobInstance("id")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); }); } @Test - public void assertListenOneOffJob() { + void assertListenOneOffJob() { assertThrows(RuntimeException.class, () -> { - JobInstanceRegistry jobInstanceRegistry = new JobInstanceRegistry(regCenter, new JobInstance("id", "label")); String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).label("label").build()); - jobInstanceRegistry.new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); + new JobInstanceRegistry(regCenter, new JobInstance("id", "label")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); }); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java index 0cf2fbf780..0a6aa35986 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java @@ -74,14 +74,14 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el } @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REGISTRY_CENTER.init(); } @BeforeEach - public void setUp() { + void setUp() { if (jobBootstrap instanceof ScheduleJobBootstrap) { ((ScheduleJobBootstrap) jobBootstrap).schedule(); } else { @@ -90,7 +90,7 @@ public void setUp() { } @AfterEach - public void tearDown() { + void tearDown() { jobBootstrap.shutdown(); ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java index e131a4ffcb..220dde4cdb 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java @@ -20,9 +20,9 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.junit.jupiter.api.Test; -public final class OneOffDisabledJobIntegrateTest extends DisabledJobIntegrateTest { +class OneOffDisabledJobIntegrateTest extends DisabledJobIntegrateTest { - public OneOffDisabledJobIntegrateTest() { + OneOffDisabledJobIntegrateTest() { super(TestType.ONE_OFF); } @@ -33,7 +33,7 @@ protected JobConfiguration getJobConfiguration(final String jobName) { } @Test - public void assertJobRunning() { + void assertJobRunning() { assertDisabledRegCenterInfo(); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java index 14974c1198..0b2a3e2cf8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java @@ -30,9 +30,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrateTest { +class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrateTest { - public ScheduleDisabledJobIntegrateTest() { + ScheduleDisabledJobIntegrateTest() { super(TestType.SCHEDULE); } @@ -43,7 +43,7 @@ protected JobConfiguration getJobConfiguration(final String jobName) { } @Test - public void assertJobRunning() { + void assertJobRunning() { assertDisabledRegCenterInfo(); setJobEnable(); Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true))); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java index b220b2b38d..2698f08ed4 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java @@ -40,7 +40,7 @@ protected EnabledJobIntegrateTest(final TestType type, final ElasticJob elasticJ } @BeforeEach - public final void assertEnabledRegCenterInfo() { + void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java index 1809deea17..375812ead9 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java @@ -28,9 +28,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class OneOffEnabledJobIntegrateTest extends EnabledJobIntegrateTest { +class OneOffEnabledJobIntegrateTest extends EnabledJobIntegrateTest { - public OneOffEnabledJobIntegrateTest() { + OneOffEnabledJobIntegrateTest() { super(TestType.ONE_OFF, new DetailedFooJob()); } @@ -41,7 +41,7 @@ protected JobConfiguration getJobConfiguration(final String jobName) { } @Test - public void assertJobInit() { + void assertJobInit() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java index 3d994336bd..26f26d4045 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java @@ -28,9 +28,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ScheduleEnabledJobIntegrateTest extends EnabledJobIntegrateTest { +class ScheduleEnabledJobIntegrateTest extends EnabledJobIntegrateTest { - public ScheduleEnabledJobIntegrateTest() { + ScheduleEnabledJobIntegrateTest() { super(TestType.SCHEDULE, new DetailedFooJob()); } @@ -41,7 +41,7 @@ protected JobConfiguration getJobConfiguration(final String jobName) { } @Test - public void assertJobInit() { + void assertJobInit() { Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java index 221be372a0..acdabbf6d4 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java @@ -27,10 +27,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class JobAnnotationBuilderTest { +class JobAnnotationBuilderTest { @Test - public void assertGenerateJobConfiguration() { + void assertGenerateJobConfiguration() { JobConfiguration jobConfiguration = JobAnnotationBuilder.generateJobConfiguration(AnnotationSimpleJob.class); assertThat(jobConfiguration.getJobName(), is("AnnotationSimpleJob")); assertThat(jobConfiguration.getShardingTotalCount(), is(3)); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java index a09ebafbce..a3d878e000 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java @@ -74,14 +74,14 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el } @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REGISTRY_CENTER.init(); } @BeforeEach - public void setUp() { + void setUp() { if (jobBootstrap instanceof ScheduleJobBootstrap) { ((ScheduleJobBootstrap) jobBootstrap).schedule(); } else { @@ -90,7 +90,7 @@ public void setUp() { } @AfterEach - public void tearDown() { + void tearDown() { jobBootstrap.shutdown(); ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java index 75a8615299..bd1ae65a87 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -35,14 +35,14 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class OneOffEnabledJobTest extends BaseAnnotationTest { +class OneOffEnabledJobTest extends BaseAnnotationTest { - public OneOffEnabledJobTest() { + OneOffEnabledJobTest() { super(TestType.ONE_OFF, new AnnotationUnShardingJob()); } @BeforeEach - public void assertEnabledRegCenterInfo() { + void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(1)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); @@ -56,7 +56,7 @@ public void assertEnabledRegCenterInfo() { } @Test - public void assertJobInit() { + void assertJobInit() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((AnnotationUnShardingJob) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java index cc4c4d3d66..82333eaafd 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -35,14 +35,14 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ScheduleEnabledJobTest extends BaseAnnotationTest { +class ScheduleEnabledJobTest extends BaseAnnotationTest { - public ScheduleEnabledJobTest() { + ScheduleEnabledJobTest() { super(TestType.SCHEDULE, new AnnotationSimpleJob()); } @BeforeEach - public void assertEnabledRegCenterInfo() { + void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); @@ -58,7 +58,7 @@ public void assertEnabledRegCenterInfo() { } @Test - public void assertJobInit() { + void assertJobInit() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((AnnotationSimpleJob) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java index 96bfdc0d6a..6bab8143d3 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java @@ -21,12 +21,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ConfigurationNodeTest { +class ConfigurationNodeTest { private final ConfigurationNode configurationNode = new ConfigurationNode("test_job"); @Test - public void assertIsConfigPath() { + void assertIsConfigPath() { assertTrue(configurationNode.isConfigPath("/test_job/config")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java index 5ae1541aa7..51167d7eb0 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ConfigurationServiceTest { +class ConfigurationServiceTest { @Mock private JobNodeStorage jobNodeStorage; @@ -48,12 +48,12 @@ public final class ConfigurationServiceTest { private final ConfigurationService configService = new ConfigurationService(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(configService, "jobNodeStorage", jobNodeStorage); } @Test - public void assertLoadDirectly() { + void assertLoadDirectly() { when(jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); JobConfiguration actual = configService.load(false); assertThat(actual.getJobName(), is("test_job")); @@ -62,7 +62,7 @@ public void assertLoadDirectly() { } @Test - public void assertLoadFromCache() { + void assertLoadFromCache() { when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); JobConfiguration actual = configService.load(true); assertThat(actual.getJobName(), is("test_job")); @@ -71,7 +71,7 @@ public void assertLoadFromCache() { } @Test - public void assertLoadFromCacheButNull() { + void assertLoadFromCacheButNull() { when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(null); when(jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); JobConfiguration actual = configService.load(true); @@ -81,7 +81,7 @@ public void assertLoadFromCacheButNull() { } @Test - public void assertSetUpJobConfigurationJobConfigurationForJobConflict() { + void assertSetUpJobConfigurationJobConfigurationForJobConflict() { assertThrows(JobConfigurationException.class, () -> { when(jobNodeStorage.isJobRootNodeExisted()).thenReturn(true); when(jobNodeStorage.getJobRootNodeData()).thenReturn("org.apache.shardingsphere.elasticjob.lite.api.script.api.ScriptJob"); @@ -95,14 +95,14 @@ public void assertSetUpJobConfigurationJobConfigurationForJobConflict() { } @Test - public void assertSetUpJobConfigurationNewJobConfiguration() { + void assertSetUpJobConfigurationNewJobConfiguration() { JobConfiguration jobConfig = JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build(); assertThat(configService.setUpJobConfiguration(ElasticJob.class.getName(), jobConfig), is(jobConfig)); verify(jobNodeStorage).replaceJobNode("config", YamlEngine.marshal(JobConfigurationPOJO.fromJobConfiguration(jobConfig))); } @Test - public void assertSetUpJobConfigurationExistedJobConfigurationAndOverwrite() { + void assertSetUpJobConfigurationExistedJobConfigurationAndOverwrite() { when(jobNodeStorage.isJobNodeExisted(ConfigurationNode.ROOT)).thenReturn(true); JobConfiguration jobConfig = JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").overwrite(true).build(); assertThat(configService.setUpJobConfiguration(ElasticJob.class.getName(), jobConfig), is(jobConfig)); @@ -110,7 +110,7 @@ public void assertSetUpJobConfigurationExistedJobConfigurationAndOverwrite() { } @Test - public void assertSetUpJobConfigurationExistedJobConfigurationAndNotOverwrite() { + void assertSetUpJobConfigurationExistedJobConfigurationAndNotOverwrite() { when(jobNodeStorage.isJobNodeExisted(ConfigurationNode.ROOT)).thenReturn(true); when(jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT)).thenReturn( YamlEngine.marshal(JobConfigurationPOJO.fromJobConfiguration(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()))); @@ -120,13 +120,13 @@ public void assertSetUpJobConfigurationExistedJobConfigurationAndNotOverwrite() } @Test - public void assertIsMaxTimeDiffSecondsTolerableWithDefaultValue() throws JobExecutionEnvironmentException { + void assertIsMaxTimeDiffSecondsTolerableWithDefaultValue() throws JobExecutionEnvironmentException { when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml(-1)); configService.checkMaxTimeDiffSecondsTolerable(); } @Test - public void assertIsMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { + void assertIsMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); when(jobNodeStorage.getRegistryCenterTime()).thenReturn(System.currentTimeMillis()); configService.checkMaxTimeDiffSecondsTolerable(); @@ -134,7 +134,7 @@ public void assertIsMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironment } @Test - public void assertIsNotMaxTimeDiffSecondsTolerable() { + void assertIsNotMaxTimeDiffSecondsTolerable() { assertThrows(JobExecutionEnvironmentException.class, () -> { when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); when(jobNodeStorage.getRegistryCenterTime()).thenReturn(0L); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java index 61a02bdf52..ee04859410 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java @@ -37,7 +37,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class RescheduleListenerManagerTest { +class RescheduleListenerManagerTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -51,36 +51,36 @@ public final class RescheduleListenerManagerTest { private final RescheduleListenerManager rescheduleListenerManager = new RescheduleListenerManager(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setSuperclassFieldValue(rescheduleListenerManager, "jobNodeStorage", jobNodeStorage); } @Test - public void assertStart() { + void assertStart() { rescheduleListenerManager.start(); verify(jobNodeStorage).addDataListener(ArgumentMatchers.any()); } @Test - public void assertCronSettingChangedJobListenerWhenIsNotCronPath() { + void assertCronSettingChangedJobListenerWhenIsNotCronPath() { rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/config/other", LiteYamlConstants.getJobYaml())); verify(jobScheduleController, times(0)).rescheduleJob(any(), any()); } @Test - public void assertCronSettingChangedJobListenerWhenIsCronPathButNotUpdate() { + void assertCronSettingChangedJobListenerWhenIsCronPathButNotUpdate() { rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/config", LiteYamlConstants.getJobYaml())); verify(jobScheduleController, times(0)).rescheduleJob(any(), any()); } @Test - public void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateButCannotFindJob() { + void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateButCannotFindJob() { rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); verify(jobScheduleController, times(0)).rescheduleJob(any(), any()); } @Test - public void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateAndFindJob() { + void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateAndFindJob() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java index 390b2b0414..25f524fd23 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ElectionListenerManagerTest { +class ElectionListenerManagerTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -59,7 +59,7 @@ public final class ElectionListenerManagerTest { private final ElectionListenerManager electionListenerManager = new ElectionListenerManager(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); ReflectionUtils.setSuperclassFieldValue(electionListenerManager, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(electionListenerManager, "leaderService", leaderService); @@ -67,37 +67,37 @@ public void setUp() { } @Test - public void assertStart() { + void assertStart() { electionListenerManager.start(); verify(jobNodeStorage, times(2)).addDataListener(ArgumentMatchers.any()); } @Test - public void assertIsNotLeaderInstancePathAndServerPath() { + void assertIsNotLeaderInstancePathAndServerPath() { electionListenerManager.new LeaderElectionJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.DELETED, "/test_job/leader/election/other", "127.0.0.1")); verify(leaderService, times(0)).electLeader(); } @Test - public void assertLeaderElectionWhenAddLeaderInstancePath() { + void assertLeaderElectionWhenAddLeaderInstancePath() { electionListenerManager.new LeaderElectionJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/leader/election/instance", "127.0.0.1")); verify(leaderService, times(0)).electLeader(); } @Test - public void assertLeaderElectionWhenRemoveLeaderInstancePathWithoutAvailableServers() { + void assertLeaderElectionWhenRemoveLeaderInstancePathWithoutAvailableServers() { electionListenerManager.new LeaderElectionJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/leader/election/instance", "127.0.0.1")); verify(leaderService, times(0)).electLeader(); } @Test - public void assertLeaderElectionWhenRemoveLeaderInstancePathWithAvailableServerButJobInstanceIsShutdown() { + void assertLeaderElectionWhenRemoveLeaderInstancePathWithAvailableServerButJobInstanceIsShutdown() { electionListenerManager.new LeaderElectionJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/leader/election/instance", "127.0.0.1")); verify(leaderService, times(0)).electLeader(); } @Test - public void assertLeaderElectionWhenRemoveLeaderInstancePathWithAvailableServer() { + void assertLeaderElectionWhenRemoveLeaderInstancePathWithAvailableServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(serverService.isAvailableServer("127.0.0.1")).thenReturn(true); @@ -107,19 +107,19 @@ public void assertLeaderElectionWhenRemoveLeaderInstancePathWithAvailableServer( } @Test - public void assertLeaderElectionWhenServerDisableWithoutLeader() { + void assertLeaderElectionWhenServerDisableWithoutLeader() { electionListenerManager.new LeaderElectionJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/servers/127.0.0.1", ServerStatus.DISABLED.name())); verify(leaderService, times(0)).electLeader(); } @Test - public void assertLeaderElectionWhenServerEnableWithLeader() { + void assertLeaderElectionWhenServerEnableWithLeader() { electionListenerManager.new LeaderElectionJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/servers/127.0.0.1", "")); verify(leaderService, times(0)).electLeader(); } @Test - public void assertLeaderElectionWhenServerEnableWithoutLeader() { + void assertLeaderElectionWhenServerEnableWithoutLeader() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); electionListenerManager.new LeaderElectionJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/servers/127.0.0.1", "")); @@ -128,13 +128,13 @@ public void assertLeaderElectionWhenServerEnableWithoutLeader() { } @Test - public void assertLeaderAbdicationWhenFollowerDisable() { + void assertLeaderAbdicationWhenFollowerDisable() { electionListenerManager.new LeaderAbdicationJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/servers/127.0.0.1", ServerStatus.DISABLED.name())); verify(leaderService, times(0)).removeLeader(); } @Test - public void assertLeaderAbdicationWhenLeaderDisable() { + void assertLeaderAbdicationWhenLeaderDisable() { when(leaderService.isLeader()).thenReturn(true); electionListenerManager.new LeaderAbdicationJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/servers/127.0.0.1", ServerStatus.DISABLED.name())); verify(leaderService).removeLeader(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java index 3158ce5f7c..9fd5b56eca 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java @@ -22,17 +22,17 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class LeaderNodeTest { +class LeaderNodeTest { private final LeaderNode leaderNode = new LeaderNode("test_job"); @Test - public void assertIsLeaderInstancePath() { + void assertIsLeaderInstancePath() { assertTrue(leaderNode.isLeaderInstancePath("/test_job/leader/election/instance")); } @Test - public void assertIsNotLeaderInstancePath() { + void assertIsNotLeaderInstancePath() { assertFalse(leaderNode.isLeaderInstancePath("/test_job/leader/election/instance1")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java index 8fe0bb3b8e..f00e72ac14 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class LeaderServiceTest { +class LeaderServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -57,7 +57,7 @@ public final class LeaderServiceTest { private LeaderService leaderService; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); leaderService = new LeaderService(null, "test_job"); ReflectionUtils.setFieldValue(leaderService, "jobNodeStorage", jobNodeStorage); @@ -65,13 +65,13 @@ public void setUp() { } @Test - public void assertElectLeader() { + void assertElectLeader() { leaderService.electLeader(); verify(jobNodeStorage).executeInLeader(eq("leader/election/latch"), ArgumentMatchers.any()); } @Test - public void assertIsLeaderUntilBlockWithLeader() { + void assertIsLeaderUntilBlockWithLeader() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(jobNodeStorage.isJobNodeExisted("leader/election/instance")).thenReturn(true); @@ -82,21 +82,21 @@ public void assertIsLeaderUntilBlockWithLeader() { } @Test - public void assertIsLeaderUntilBlockWithoutLeaderAndAvailableServers() { + void assertIsLeaderUntilBlockWithoutLeaderAndAvailableServers() { when(jobNodeStorage.isJobNodeExisted("leader/election/instance")).thenReturn(false); assertFalse(leaderService.isLeaderUntilBlock()); verify(jobNodeStorage, times(0)).executeInLeader(eq("leader/election/latch"), ArgumentMatchers.any()); } @Test - public void assertIsLeaderUntilBlockWithoutLeaderWithAvailableServers() { + void assertIsLeaderUntilBlockWithoutLeaderWithAvailableServers() { when(jobNodeStorage.isJobNodeExisted("leader/election/instance")).thenReturn(false, true); assertFalse(leaderService.isLeaderUntilBlock()); verify(jobNodeStorage, times(0)).executeInLeader(eq("leader/election/latch"), ArgumentMatchers.any()); } @Test - public void assertIsLeaderUntilBlockWhenHasLeader() { + void assertIsLeaderUntilBlockWhenHasLeader() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(jobNodeStorage.isJobNodeExisted("leader/election/instance")).thenReturn(false, true); @@ -109,7 +109,7 @@ public void assertIsLeaderUntilBlockWhenHasLeader() { } @Test - public void assertIsLeader() { + void assertIsLeader() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(jobNodeStorage.getJobNodeData("leader/election/instance")).thenReturn("127.0.0.1@-@0"); @@ -118,26 +118,26 @@ public void assertIsLeader() { } @Test - public void assertHasLeader() { + void assertHasLeader() { when(jobNodeStorage.isJobNodeExisted("leader/election/instance")).thenReturn(true); assertTrue(leaderService.hasLeader()); } @Test - public void assertRemoveLeader() { + void assertRemoveLeader() { leaderService.removeLeader(); verify(jobNodeStorage).removeJobNodeIfExisted("leader/election/instance"); } @Test - public void assertElectLeaderExecutionCallbackWithLeader() { + void assertElectLeaderExecutionCallbackWithLeader() { when(jobNodeStorage.isJobNodeExisted("leader/election/instance")).thenReturn(true); leaderService.new LeaderElectionExecutionCallback().execute(); verify(jobNodeStorage, times(0)).fillEphemeralJobNode("leader/election/instance", "127.0.0.1@-@0"); } @Test - public void assertElectLeaderExecutionCallbackWithoutLeader() { + void assertElectLeaderExecutionCallbackWithoutLeader() { leaderService.new LeaderElectionExecutionCallback().execute(); verify(jobNodeStorage).fillEphemeralJobNode("leader/election/instance", "127.0.0.1@-@0"); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java index c78e78df4d..db4acd39f9 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java @@ -51,7 +51,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class FailoverListenerManagerTest { +class FailoverListenerManagerTest { @Mock private JobNodeStorage jobNodeStorage; @@ -80,7 +80,7 @@ public final class FailoverListenerManagerTest { private final FailoverListenerManager failoverListenerManager = new FailoverListenerManager(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setSuperclassFieldValue(failoverListenerManager, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(failoverListenerManager, "configService", configService); ReflectionUtils.setFieldValue(failoverListenerManager, "shardingService", shardingService); @@ -91,19 +91,19 @@ public void setUp() { } @Test - public void assertStart() { + void assertStart() { failoverListenerManager.start(); verify(jobNodeStorage, times(3)).addDataListener(ArgumentMatchers.any(DataChangedEventListener.class)); } @Test - public void assertJobCrashedJobListenerWhenFailoverDisabled() { + void assertJobCrashedJobListenerWhenFailoverDisabled() { failoverListenerManager.new JobCrashedJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/instances/127.0.0.1@-@0", "")); verify(failoverService, times(0)).failoverIfNecessary(); } @Test - public void assertJobCrashedJobListenerWhenIsNotNodeRemoved() { + void assertJobCrashedJobListenerWhenIsNotNodeRemoved() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).build()); @@ -113,7 +113,7 @@ public void assertJobCrashedJobListenerWhenIsNotNodeRemoved() { } @Test - public void assertJobCrashedJobListenerWhenIsNotInstancesPath() { + void assertJobCrashedJobListenerWhenIsNotInstancesPath() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).build()); @@ -123,7 +123,7 @@ public void assertJobCrashedJobListenerWhenIsNotInstancesPath() { } @Test - public void assertJobCrashedJobListenerWhenIsSameInstance() { + void assertJobCrashedJobListenerWhenIsSameInstance() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).build()); @@ -133,7 +133,7 @@ public void assertJobCrashedJobListenerWhenIsSameInstance() { } @Test - public void assertJobCrashedJobListenerWhenIsOtherInstanceCrashed() { + void assertJobCrashedJobListenerWhenIsOtherInstanceCrashed() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).build()); @@ -148,7 +148,7 @@ public void assertJobCrashedJobListenerWhenIsOtherInstanceCrashed() { } @Test - public void assertJobCrashedJobListenerWhenIsOtherFailoverInstanceCrashed() { + void assertJobCrashedJobListenerWhenIsOtherFailoverInstanceCrashed() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).build()); @@ -162,31 +162,31 @@ public void assertJobCrashedJobListenerWhenIsOtherFailoverInstanceCrashed() { } @Test - public void assertFailoverSettingsChangedJobListenerWhenIsNotFailoverPath() { + void assertFailoverSettingsChangedJobListenerWhenIsNotFailoverPath() { failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/other", LiteYamlConstants.getJobYaml())); verify(failoverService, times(0)).removeFailoverInfo(); } @Test - public void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathButNotUpdate() { + void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathButNotUpdate() { failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", "")); verify(failoverService, times(0)).removeFailoverInfo(); } @Test - public void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButEnableFailover() { + void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButEnableFailover() { failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); verify(failoverService, times(0)).removeFailoverInfo(); } @Test - public void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButDisableFailover() { + void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButDisableFailover() { failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYamlWithFailover(false))); verify(failoverService).removeFailoverInfo(); } @Test - public void assertLegacyCrashedRunningItemListenerWhenRunningItemsArePresent() { + void assertLegacyCrashedRunningItemListenerWhenRunningItemsArePresent() { JobInstance jobInstance = new JobInstance("127.0.0.1@-@1"); JobRegistry.getInstance().registerJob("test_job", mock(JobScheduleController.class)); JobRegistry.getInstance().addJobInstance("test_job", jobInstance); @@ -208,7 +208,7 @@ public void assertLegacyCrashedRunningItemListenerWhenRunningItemsArePresent() { } @Test - public void assertLegacyCrashedRunningItemListenerWhenJobInstanceAbsent() { + void assertLegacyCrashedRunningItemListenerWhenJobInstanceAbsent() { failoverListenerManager.new LegacyCrashedRunningItemListener().onChange(new DataChangedEvent(Type.ADDED, "", "")); verifyNoInteractions(instanceNode); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java index 27ce6ff398..c2fde69823 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java @@ -23,32 +23,32 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; -public final class FailoverNodeTest { +class FailoverNodeTest { private final FailoverNode failoverNode = new FailoverNode("test_job"); @Test - public void assertGetItemsNode() { + void assertGetItemsNode() { assertThat(FailoverNode.getItemsNode(0), is("leader/failover/items/0")); } @Test - public void assertGetExecutionFailoverNode() { + void assertGetExecutionFailoverNode() { assertThat(FailoverNode.getExecutionFailoverNode(0), is("sharding/0/failover")); } @Test - public void assertGetItemWhenNotExecutionFailoverPath() { + void assertGetItemWhenNotExecutionFailoverPath() { assertNull(failoverNode.getItemByExecutionFailoverPath("/test_job/sharding/0/completed")); } @Test - public void assertGetItemByExecutionFailoverPath() { + void assertGetItemByExecutionFailoverPath() { assertThat(failoverNode.getItemByExecutionFailoverPath("/test_job/sharding/0/failover"), is(0)); } @Test - public void assertGetProcessingFailoverNode() { + void assertGetProcessingFailoverNode() { assertThat(FailoverNode.getExecutingFailoverNode(0), is("sharding/0/failovering")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java index 0ec86e8bbe..b204338ec6 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java @@ -46,7 +46,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class FailoverServiceTest { +class FailoverServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -66,7 +66,7 @@ public final class FailoverServiceTest { private final FailoverService failoverService = new FailoverService(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(failoverService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(failoverService, "shardingService", shardingService); ReflectionUtils.setFieldValue(failoverService, "jobName", "test_job"); @@ -75,7 +75,7 @@ public void setUp() { } @Test - public void assertSetCrashedFailoverFlagWhenItemIsNotAssigned() { + void assertSetCrashedFailoverFlagWhenItemIsNotAssigned() { when(jobNodeStorage.isJobNodeExisted("sharding/0/failover")).thenReturn(true); failoverService.setCrashedFailoverFlag(0); verify(jobNodeStorage).isJobNodeExisted("sharding/0/failover"); @@ -83,7 +83,7 @@ public void assertSetCrashedFailoverFlagWhenItemIsNotAssigned() { } @Test - public void assertSetCrashedFailoverFlagWhenItemIsAssigned() { + void assertSetCrashedFailoverFlagWhenItemIsAssigned() { when(jobNodeStorage.isJobNodeExisted("sharding/0/failover")).thenReturn(false); failoverService.setCrashedFailoverFlag(0); verify(jobNodeStorage).isJobNodeExisted("sharding/0/failover"); @@ -91,13 +91,13 @@ public void assertSetCrashedFailoverFlagWhenItemIsAssigned() { } @Test - public void assertSetCrashedFailoverFlagDirectly() { + void assertSetCrashedFailoverFlagDirectly() { failoverService.setCrashedFailoverFlagDirectly(0); verify(jobNodeStorage).createJobNodeIfNeeded("leader/failover/items/0"); } @Test - public void assertFailoverIfUnnecessaryWhenItemsRootNodeNotExisted() { + void assertFailoverIfUnnecessaryWhenItemsRootNodeNotExisted() { when(jobNodeStorage.isJobNodeExisted("leader/failover/items")).thenReturn(false); failoverService.failoverIfNecessary(); verify(jobNodeStorage).isJobNodeExisted("leader/failover/items"); @@ -105,7 +105,7 @@ public void assertFailoverIfUnnecessaryWhenItemsRootNodeNotExisted() { } @Test - public void assertFailoverIfUnnecessaryWhenItemsRootNodeIsEmpty() { + void assertFailoverIfUnnecessaryWhenItemsRootNodeIsEmpty() { when(jobNodeStorage.isJobNodeExisted("leader/failover/items")).thenReturn(true); when(jobNodeStorage.getJobNodeChildrenKeys("leader/failover/items")).thenReturn(Collections.emptyList()); failoverService.failoverIfNecessary(); @@ -115,7 +115,7 @@ public void assertFailoverIfUnnecessaryWhenItemsRootNodeIsEmpty() { } @Test - public void assertFailoverIfUnnecessaryWhenServerIsNotReady() { + void assertFailoverIfUnnecessaryWhenServerIsNotReady() { JobRegistry.getInstance().setJobRunning("test_job", true); when(jobNodeStorage.isJobNodeExisted("leader/failover/items")).thenReturn(true); when(jobNodeStorage.getJobNodeChildrenKeys("leader/failover/items")).thenReturn(Arrays.asList("0", "1", "2")); @@ -126,7 +126,7 @@ public void assertFailoverIfUnnecessaryWhenServerIsNotReady() { } @Test - public void assertFailoverIfNecessary() { + void assertFailoverIfNecessary() { JobRegistry.getInstance().setJobRunning("test_job", false); when(jobNodeStorage.isJobNodeExisted("leader/failover/items")).thenReturn(true); when(jobNodeStorage.getJobNodeChildrenKeys("leader/failover/items")).thenReturn(Arrays.asList("0", "1", "2")); @@ -138,7 +138,7 @@ public void assertFailoverIfNecessary() { } @Test - public void assertFailoverLeaderExecutionCallbackIfNotNecessary() { + void assertFailoverLeaderExecutionCallbackIfNotNecessary() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); JobRegistry.getInstance().setJobRunning("test_job", false); @@ -150,7 +150,7 @@ public void assertFailoverLeaderExecutionCallbackIfNotNecessary() { } @Test - public void assertFailoverLeaderExecutionCallbackIfNecessary() { + void assertFailoverLeaderExecutionCallbackIfNecessary() { JobRegistry.getInstance().setJobRunning("test_job", false); when(jobNodeStorage.isJobNodeExisted("leader/failover/items")).thenReturn(true); when(jobNodeStorage.getJobNodeChildrenKeys("leader/failover/items")).thenReturn(Arrays.asList("0", "1", "2")); @@ -168,7 +168,7 @@ public void assertFailoverLeaderExecutionCallbackIfNecessary() { } @Test - public void assertGetFailoveringItems() { + void assertGetFailoveringItems() { JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(jobNodeStorage.getJobNodeChildrenKeys("sharding")).thenReturn(Arrays.asList("0", "1", "2")); when(jobNodeStorage.isJobNodeExisted("sharding/0/failovering")).thenReturn(true); @@ -186,14 +186,14 @@ public void assertGetFailoveringItems() { } @Test - public void assertUpdateFailoverComplete() { + void assertUpdateFailoverComplete() { failoverService.updateFailoverComplete(Arrays.asList(0, 1)); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/0/failover"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/1/failover"); } @Test - public void assertGetFailoverItems() { + void assertGetFailoverItems() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(jobNodeStorage.getJobNodeChildrenKeys("sharding")).thenReturn(Arrays.asList("0", "1", "2")); @@ -212,13 +212,13 @@ public void assertGetFailoverItems() { } @Test - public void assertGetLocalFailoverItemsIfShutdown() { + void assertGetLocalFailoverItemsIfShutdown() { assertThat(failoverService.getLocalFailoverItems(), is(Collections.emptyList())); verify(jobNodeStorage, times(0)).getJobNodeChildrenKeys("sharding"); } @Test - public void assertGetLocalFailoverItems() { + void assertGetLocalFailoverItems() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(jobNodeStorage.getJobNodeChildrenKeys("sharding")).thenReturn(Arrays.asList("0", "1", "2")); @@ -237,7 +237,7 @@ public void assertGetLocalFailoverItems() { } @Test - public void assertGetLocalTakeOffItems() { + void assertGetLocalTakeOffItems() { when(shardingService.getLocalShardingItems()).thenReturn(Arrays.asList(0, 1, 2)); when(jobNodeStorage.isJobNodeExisted("sharding/0/failover")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("sharding/1/failover")).thenReturn(true); @@ -250,7 +250,7 @@ public void assertGetLocalTakeOffItems() { } @Test - public void assertGetAllFailoveringItems() { + void assertGetAllFailoveringItems() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).build()); String jobInstanceId = "127.0.0.1@-@1"; when(jobNodeStorage.getJobNodeData("sharding/0/failovering")).thenReturn(jobInstanceId); @@ -262,13 +262,13 @@ public void assertGetAllFailoveringItems() { } @Test - public void assertClearFailoveringItem() { + void assertClearFailoveringItem() { failoverService.clearFailoveringItem(0); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/0/failovering"); } @Test - public void assertRemoveFailoverInfo() { + void assertRemoveFailoverInfo() { when(jobNodeStorage.getJobNodeChildrenKeys("sharding")).thenReturn(Arrays.asList("0", "1", "2")); failoverService.removeFailoverInfo(); verify(jobNodeStorage).getJobNodeChildrenKeys("sharding"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java index 52591a5803..e5f8ea2585 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java @@ -37,7 +37,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class GuaranteeListenerManagerTest { +class GuaranteeListenerManagerTest { @Mock private JobNodeStorage jobNodeStorage; @@ -51,49 +51,49 @@ public final class GuaranteeListenerManagerTest { private GuaranteeListenerManager guaranteeListenerManager; @BeforeEach - public void setUp() { + void setUp() { guaranteeListenerManager = new GuaranteeListenerManager(null, "test_job", Arrays.asList(elasticJobListener, distributeOnceElasticJobListener)); ReflectionUtils.setSuperclassFieldValue(guaranteeListenerManager, "jobNodeStorage", jobNodeStorage); } @Test - public void assertStart() { + void assertStart() { guaranteeListenerManager.start(); verify(jobNodeStorage, times(2)).addDataListener(any(DataChangedEventListener.class)); } @Test - public void assertStartedNodeRemovedJobListenerWhenIsNotRemoved() { + void assertStartedNodeRemovedJobListenerWhenIsNotRemoved() { guaranteeListenerManager.new StartedNodeRemovedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.UPDATED, "/test_job/guarantee/started", "")); verify(distributeOnceElasticJobListener, times(0)).notifyWaitingTaskStart(); } @Test - public void assertStartedNodeRemovedJobListenerWhenIsNotStartedNode() { + void assertStartedNodeRemovedJobListenerWhenIsNotStartedNode() { guaranteeListenerManager.new StartedNodeRemovedJobListener().onChange(new DataChangedEvent(Type.DELETED, "/other_job/guarantee/started", "")); verify(distributeOnceElasticJobListener, times(0)).notifyWaitingTaskStart(); } @Test - public void assertStartedNodeRemovedJobListenerWhenIsRemovedAndStartedNode() { + void assertStartedNodeRemovedJobListenerWhenIsRemovedAndStartedNode() { guaranteeListenerManager.new StartedNodeRemovedJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/guarantee/started", "")); verify(distributeOnceElasticJobListener).notifyWaitingTaskStart(); } @Test - public void assertCompletedNodeRemovedJobListenerWhenIsNotRemoved() { + void assertCompletedNodeRemovedJobListenerWhenIsNotRemoved() { guaranteeListenerManager.new CompletedNodeRemovedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/guarantee/completed", "")); verify(distributeOnceElasticJobListener, times(0)).notifyWaitingTaskStart(); } @Test - public void assertCompletedNodeRemovedJobListenerWhenIsNotCompletedNode() { + void assertCompletedNodeRemovedJobListenerWhenIsNotCompletedNode() { guaranteeListenerManager.new CompletedNodeRemovedJobListener().onChange(new DataChangedEvent(Type.DELETED, "/other_job/guarantee/completed", "")); verify(distributeOnceElasticJobListener, times(0)).notifyWaitingTaskStart(); } @Test - public void assertCompletedNodeRemovedJobListenerWhenIsRemovedAndCompletedNode() { + void assertCompletedNodeRemovedJobListenerWhenIsRemovedAndCompletedNode() { guaranteeListenerManager.new CompletedNodeRemovedJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/guarantee/completed", "")); verify(distributeOnceElasticJobListener).notifyWaitingTaskComplete(); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java index bb45e46b60..aa260748a5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java @@ -24,37 +24,37 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class GuaranteeNodeTest { +class GuaranteeNodeTest { private final GuaranteeNode guaranteeNode = new GuaranteeNode("test_job"); @Test - public void assertGetStartedNode() { + void assertGetStartedNode() { assertThat(GuaranteeNode.getStartedNode(1), is("guarantee/started/1")); } @Test - public void assertGetCompletedNode() { + void assertGetCompletedNode() { assertThat(GuaranteeNode.getCompletedNode(1), is("guarantee/completed/1")); } @Test - public void assertIsStartedRootNode() { + void assertIsStartedRootNode() { assertTrue(guaranteeNode.isStartedRootNode("/test_job/guarantee/started")); } @Test - public void assertIsNotStartedRootNode() { + void assertIsNotStartedRootNode() { assertFalse(guaranteeNode.isStartedRootNode("/otherJob/guarantee/started")); } @Test - public void assertIsCompletedRootNode() { + void assertIsCompletedRootNode() { assertTrue(guaranteeNode.isCompletedRootNode("/test_job/guarantee/completed")); } @Test - public void assertIsNotCompletedRootNode() { + void assertIsNotCompletedRootNode() { assertFalse(guaranteeNode.isCompletedRootNode("/otherJob/guarantee/completed")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java index ca0b4b897f..33aa82743a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class GuaranteeServiceTest { +class GuaranteeServiceTest { @Mock private JobNodeStorage jobNodeStorage; @@ -55,38 +55,38 @@ public final class GuaranteeServiceTest { private final GuaranteeService guaranteeService = new GuaranteeService(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(guaranteeService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(guaranteeService, "configService", configService); } @Test - public void assertRegisterStart() { + void assertRegisterStart() { guaranteeService.registerStart(Arrays.asList(0, 1)); verify(jobNodeStorage).createJobNodeIfNeeded("guarantee/started/0"); verify(jobNodeStorage).createJobNodeIfNeeded("guarantee/started/1"); } @Test - public void assertIsNotRegisterStartSuccess() { + void assertIsNotRegisterStartSuccess() { assertFalse(guaranteeService.isRegisterStartSuccess(Arrays.asList(0, 1))); } @Test - public void assertIsRegisterStartSuccess() { + void assertIsRegisterStartSuccess() { when(jobNodeStorage.isJobNodeExisted("guarantee/started/0")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("guarantee/started/1")).thenReturn(true); assertTrue(guaranteeService.isRegisterStartSuccess(Arrays.asList(0, 1))); } @Test - public void assertIsNotAllStartedWhenRootNodeIsNotExisted() { + void assertIsNotAllStartedWhenRootNodeIsNotExisted() { when(jobNodeStorage.isJobNodeExisted("guarantee/started")).thenReturn(false); assertFalse(guaranteeService.isAllStarted()); } @Test - public void assertIsNotAllStarted() { + void assertIsNotAllStarted() { when(configService.load(false)).thenReturn( JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").setProperty("streaming.process", Boolean.TRUE.toString()).build()); when(jobNodeStorage.isJobNodeExisted("guarantee/started")).thenReturn(true); @@ -95,7 +95,7 @@ public void assertIsNotAllStarted() { } @Test - public void assertIsAllStarted() { + void assertIsAllStarted() { when(jobNodeStorage.isJobNodeExisted("guarantee/started")).thenReturn(true); when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.getJobNodeChildrenKeys("guarantee/started")).thenReturn(Arrays.asList("0", "1", "2")); @@ -103,44 +103,44 @@ public void assertIsAllStarted() { } @Test - public void assertClearAllStartedInfo() { + void assertClearAllStartedInfo() { guaranteeService.clearAllStartedInfo(); verify(jobNodeStorage).removeJobNodeIfExisted("guarantee/started"); } @Test - public void assertRegisterComplete() { + void assertRegisterComplete() { guaranteeService.registerComplete(Arrays.asList(0, 1)); verify(jobNodeStorage).createJobNodeIfNeeded("guarantee/completed/0"); verify(jobNodeStorage).createJobNodeIfNeeded("guarantee/completed/1"); } @Test - public void assertIsNotRegisterCompleteSuccess() { + void assertIsNotRegisterCompleteSuccess() { assertFalse(guaranteeService.isRegisterCompleteSuccess(Arrays.asList(0, 1))); } @Test - public void assertIsRegisterCompleteSuccess() { + void assertIsRegisterCompleteSuccess() { when(jobNodeStorage.isJobNodeExisted("guarantee/completed/0")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("guarantee/completed/1")).thenReturn(true); assertTrue(guaranteeService.isRegisterCompleteSuccess(Arrays.asList(0, 1))); } @Test - public void assertIsNotAllCompletedWhenRootNodeIsNotExisted() { + void assertIsNotAllCompletedWhenRootNodeIsNotExisted() { when(jobNodeStorage.isJobNodeExisted("guarantee/completed")).thenReturn(false); assertFalse(guaranteeService.isAllCompleted()); } @Test - public void assertIsNotAllCompleted() { + void assertIsNotAllCompleted() { when(jobNodeStorage.isJobNodeExisted("guarantee/completed")).thenReturn(false); assertFalse(guaranteeService.isAllCompleted()); } @Test - public void assertIsAllCompleted() { + void assertIsAllCompleted() { when(jobNodeStorage.isJobNodeExisted("guarantee/completed")).thenReturn(true); when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.getJobNodeChildrenKeys("guarantee/completed")).thenReturn(Arrays.asList("0", "1", "2")); @@ -148,13 +148,13 @@ public void assertIsAllCompleted() { } @Test - public void assertClearAllCompletedInfo() { + void assertClearAllCompletedInfo() { guaranteeService.clearAllCompletedInfo(); verify(jobNodeStorage).removeJobNodeIfExisted("guarantee/completed"); } @Test - public void assertExecuteInLeaderForLastCompleted() { + void assertExecuteInLeaderForLastCompleted() { when(jobNodeStorage.isJobNodeExisted("guarantee/completed")).thenReturn(true); when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.getJobNodeChildrenKeys("guarantee/completed")).thenReturn(Arrays.asList("0", "1", "2")); @@ -163,14 +163,14 @@ public void assertExecuteInLeaderForLastCompleted() { } @Test - public void assertExecuteInLeaderForNotLastCompleted() { + void assertExecuteInLeaderForNotLastCompleted() { when(jobNodeStorage.isJobNodeExisted("guarantee/completed")).thenReturn(false); guaranteeService.new LeaderExecutionCallbackForLastCompleted(listener, shardingContexts).execute(); verify(listener, never()).doAfterJobExecutedAtLastCompleted(shardingContexts); } @Test - public void assertExecuteInLeaderForLastStarted() { + void assertExecuteInLeaderForLastStarted() { when(jobNodeStorage.isJobNodeExisted("guarantee/started")).thenReturn(true); when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.getJobNodeChildrenKeys("guarantee/started")).thenReturn(Arrays.asList("0", "1", "2")); @@ -179,7 +179,7 @@ public void assertExecuteInLeaderForLastStarted() { } @Test - public void assertExecuteInLeaderForNotLastStarted() { + void assertExecuteInLeaderForNotLastStarted() { when(jobNodeStorage.isJobNodeExisted("guarantee/started")).thenReturn(false); guaranteeService.new LeaderExecutionCallbackForLastStarted(listener, shardingContexts).execute(); verify(listener, never()).doBeforeJobExecutedAtLastStarted(shardingContexts); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java index 403016c983..14eac7dc9f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java @@ -27,48 +27,48 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class InstanceNodeTest { +class InstanceNodeTest { private static InstanceNode instanceNode; @BeforeAll - public static void setUp() { + static void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); instanceNode = new InstanceNode("test_job"); } @Test - public void assertGetInstanceFullPath() { + void assertGetInstanceFullPath() { assertThat(instanceNode.getInstanceFullPath(), is("/test_job/instances")); } @Test - public void assertIsInstancePath() { + void assertIsInstancePath() { assertTrue(instanceNode.isInstancePath("/test_job/instances/127.0.0.1@-@0")); } @Test - public void assertIsNotInstancePath() { + void assertIsNotInstancePath() { assertFalse(instanceNode.isInstancePath("/test_job/other/127.0.0.1@-@0")); } @Test - public void assertIsLocalInstancePath() { + void assertIsLocalInstancePath() { assertTrue(instanceNode.isLocalInstancePath("/test_job/instances/127.0.0.1@-@0")); } @Test - public void assertIsNotLocalInstancePath() { + void assertIsNotLocalInstancePath() { assertFalse(instanceNode.isLocalInstancePath("/test_job/instances/127.0.0.2@-@0")); } @Test - public void assertGetLocalInstancePath() { + void assertGetLocalInstancePath() { assertThat(instanceNode.getLocalInstancePath(), is("instances/127.0.0.1@-@0")); } @Test - public void assertGetInstancePath() { + void assertGetInstancePath() { assertThat(instanceNode.getInstancePath("127.0.0.1@-@0"), is("instances/127.0.0.1@-@0")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java index 3ab2b42d66..3c811b6ddc 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class InstanceServiceTest { +class InstanceServiceTest { @Mock private JobNodeStorage jobNodeStorage; @@ -49,7 +49,7 @@ public final class InstanceServiceTest { private InstanceService instanceService; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); instanceService = new InstanceService(null, "test_job"); InstanceNode instanceNode = new InstanceNode("test_job"); @@ -59,19 +59,19 @@ public void setUp() { } @Test - public void assertPersistOnline() { + void assertPersistOnline() { instanceService.persistOnline(); verify(jobNodeStorage).fillEphemeralJobNode("instances/127.0.0.1@-@0", "jobInstanceId: 127.0.0.1@-@0\nserverIp: 127.0.0.1\n"); } @Test - public void assertRemoveInstance() { + void assertRemoveInstance() { instanceService.removeInstance(); verify(jobNodeStorage).removeJobNodeIfExisted("instances/127.0.0.1@-@0"); } @Test - public void assertGetAvailableJobInstances() { + void assertGetAvailableJobInstances() { when(jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)).thenReturn(Arrays.asList("127.0.0.1@-@0", "127.0.0.2@-@0")); when(jobNodeStorage.getJobNodeData("instances/127.0.0.1@-@0")).thenReturn("jobInstanceId: 127.0.0.1@-@0\nlabels: labels\nserverIp: 127.0.0.1\n"); when(jobNodeStorage.getJobNodeData("instances/127.0.0.2@-@0")).thenReturn("jobInstanceId: 127.0.0.2@-@0\nlabels: labels\nserverIp: 127.0.0.2\n"); @@ -80,7 +80,7 @@ public void assertGetAvailableJobInstances() { } @Test - public void assertGetAvailableJobInstancesWhenInstanceRemoving() { + void assertGetAvailableJobInstancesWhenInstanceRemoving() { when(jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)).thenReturn(Arrays.asList("127.0.0.1@-@0", "127.0.0.2@-@0")); when(jobNodeStorage.getJobNodeData("instances/127.0.0.1@-@0")).thenReturn("jobInstanceId: 127.0.0.1@-@0\nlabels: labels\nserverIp: 127.0.0.1\n"); when(serverService.isEnableServer("127.0.0.1")).thenReturn(true); @@ -88,13 +88,13 @@ public void assertGetAvailableJobInstancesWhenInstanceRemoving() { } @Test - public void assertIsLocalJobInstanceExisted() { + void assertIsLocalJobInstanceExisted() { when(jobNodeStorage.isJobNodeExisted("instances/127.0.0.1@-@0")).thenReturn(true); assertTrue(instanceService.isLocalJobInstanceExisted()); } @Test - public void assertTriggerAllInstances() { + void assertTriggerAllInstances() { when(jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)).thenReturn(Arrays.asList("127.0.0.1@-@0", "127.0.0.2@-@0")); instanceService.triggerAllInstances(); verify(jobNodeStorage).createJobNodeIfNeeded("trigger/127.0.0.1@-@0"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java index fec37fc1d3..4d17553c95 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ShutdownListenerManagerTest { +class ShutdownListenerManagerTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -59,7 +59,7 @@ public final class ShutdownListenerManagerTest { private ShutdownListenerManager shutdownListenerManager; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); shutdownListenerManager = new ShutdownListenerManager(null, "test_job"); ReflectionUtils.setFieldValue(shutdownListenerManager, "instanceService", instanceService); @@ -68,24 +68,24 @@ public void setUp() { } @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown("test_job"); } @Test - public void assertStart() { + void assertStart() { shutdownListenerManager.start(); verify(jobNodeStorage).addDataListener(ArgumentMatchers.any()); } @Test - public void assertIsShutdownAlready() { + void assertIsShutdownAlready() { shutdownListenerManager.new InstanceShutdownStatusJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/instances/127.0.0.1@-@0", "")); verify(schedulerFacade, times(0)).shutdownInstance(); } @Test - public void assertIsNotLocalInstancePath() { + void assertIsNotLocalInstancePath() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); shutdownListenerManager.new InstanceShutdownStatusJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/instances/127.0.0.2@-@0", "")); @@ -93,7 +93,7 @@ public void assertIsNotLocalInstancePath() { } @Test - public void assertUpdateLocalInstancePath() { + void assertUpdateLocalInstancePath() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); shutdownListenerManager.new InstanceShutdownStatusJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/instances/127.0.0.1@-@0", "")); @@ -101,7 +101,7 @@ public void assertUpdateLocalInstancePath() { } @Test - public void assertRemoveLocalInstancePathForPausedJob() { + void assertRemoveLocalInstancePathForPausedJob() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(jobScheduleController.isPaused()).thenReturn(true); @@ -110,7 +110,7 @@ public void assertRemoveLocalInstancePathForPausedJob() { } @Test - public void assertRemoveLocalInstancePathForReconnectedRegistryCenter() { + void assertRemoveLocalInstancePathForReconnectedRegistryCenter() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(instanceService.isLocalJobInstanceExisted()).thenReturn(true); @@ -119,7 +119,7 @@ public void assertRemoveLocalInstancePathForReconnectedRegistryCenter() { } @Test - public void assertRemoveLocalInstancePath() { + void assertRemoveLocalInstancePath() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); shutdownListenerManager.new InstanceShutdownStatusJobListener().onChange(new DataChangedEvent(Type.DELETED, "/test_job/instances/127.0.0.1@-@0", "")); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java index 00386e42ad..a2deec2d5c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class ListenerManagerTest { +class ListenerManagerTest { @Mock private JobNodeStorage jobNodeStorage; @@ -73,7 +73,7 @@ public final class ListenerManagerTest { private final ListenerManager listenerManager = new ListenerManager(null, "test_job", Collections.emptyList()); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(listenerManager, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(listenerManager, "electionListenerManager", electionListenerManager); ReflectionUtils.setFieldValue(listenerManager, "shardingListenerManager", shardingListenerManager); @@ -87,7 +87,7 @@ public void setUp() { } @Test - public void assertStartAllListeners() { + void assertStartAllListeners() { listenerManager.startAllListeners(); verify(electionListenerManager).start(); verify(shardingListenerManager).start(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java index 126b369033..8affd3481b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java @@ -27,17 +27,17 @@ import static org.hamcrest.MatcherAssert.assertThat; @ExtendWith(MockitoExtension.class) -public class ListenerNotifierManagerTest { +class ListenerNotifierManagerTest { @Test - public void assertRegisterAndGetJobNotifyExecutor() { + void assertRegisterAndGetJobNotifyExecutor() { String jobName = "test_job"; ListenerNotifierManager.getInstance().registerJobNotifyExecutor(jobName); assertThat(ListenerNotifierManager.getInstance().getJobNotifyExecutor(jobName), notNullValue(Executor.class)); } @Test - public void assertRemoveAndShutDownJobNotifyExecutor() { + void assertRemoveAndShutDownJobNotifyExecutor() { String jobName = "test_job"; ListenerNotifierManager.getInstance().registerJobNotifyExecutor(jobName); ListenerNotifierManager.getInstance().removeJobNotifyExecutor(jobName); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java index df2d796297..65efcea0ea 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java @@ -40,7 +40,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class RegistryCenterConnectionStateListenerTest { +class RegistryCenterConnectionStateListenerTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -63,7 +63,7 @@ public final class RegistryCenterConnectionStateListenerTest { private RegistryCenterConnectionStateListener regCenterConnectionStateListener; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); regCenterConnectionStateListener = new RegistryCenterConnectionStateListener(null, "test_job"); ReflectionUtils.setFieldValue(regCenterConnectionStateListener, "serverService", serverService); @@ -73,7 +73,7 @@ public void setUp() { } @Test - public void assertConnectionLostListenerWhenConnectionStateIsLost() { + void assertConnectionLostListenerWhenConnectionStateIsLost() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); regCenterConnectionStateListener.onStateChanged(null, State.UNAVAILABLE); @@ -82,14 +82,14 @@ public void assertConnectionLostListenerWhenConnectionStateIsLost() { } @Test - public void assertConnectionLostListenerWhenConnectionStateIsLostButIsShutdown() { + void assertConnectionLostListenerWhenConnectionStateIsLostButIsShutdown() { regCenterConnectionStateListener.onStateChanged(null, State.UNAVAILABLE); verify(jobScheduleController, times(0)).pauseJob(); verify(jobScheduleController, times(0)).resumeJob(); } @Test - public void assertConnectionLostListenerWhenConnectionStateIsReconnected() { + void assertConnectionLostListenerWhenConnectionStateIsReconnected() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(shardingService.getLocalShardingItems()).thenReturn(Arrays.asList(0, 1)); @@ -102,14 +102,14 @@ public void assertConnectionLostListenerWhenConnectionStateIsReconnected() { } @Test - public void assertConnectionLostListenerWhenConnectionStateIsReconnectedButIsShutdown() { + void assertConnectionLostListenerWhenConnectionStateIsReconnectedButIsShutdown() { regCenterConnectionStateListener.onStateChanged(null, State.RECONNECTED); verify(jobScheduleController, times(0)).pauseJob(); verify(jobScheduleController, times(0)).resumeJob(); } @Test - public void assertConnectionLostListenerWhenConnectionStateIsOther() { + void assertConnectionLostListenerWhenConnectionStateIsOther() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); regCenterConnectionStateListener.onStateChanged(null, State.CONNECTED); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java index 425b298161..16fb642e2c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java @@ -36,7 +36,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ReconcileServiceTest { +class ReconcileServiceTest { @Mock private ConfigurationService configService; @@ -50,7 +50,7 @@ public final class ReconcileServiceTest { private ReconcileService reconcileService; @BeforeEach - public void setup() { + void setup() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); reconcileService = new ReconcileService(regCenter, "test_job"); ReflectionUtils.setFieldValue(reconcileService, "lastReconcileTime", 1L); @@ -59,7 +59,7 @@ public void setup() { } @Test - public void assertReconcile() { + void assertReconcile() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").reconcileIntervalMinutes(1).build()); when(shardingService.isNeedSharding()).thenReturn(false); when(shardingService.hasShardingInfoInOfflineServers()).thenReturn(true); @@ -70,7 +70,7 @@ public void assertReconcile() { } @Test - public void assertReconcileWithStaticSharding() { + void assertReconcileWithStaticSharding() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").reconcileIntervalMinutes(1).staticSharding(true).build()); when(shardingService.isNeedSharding()).thenReturn(false); when(shardingService.hasShardingInfoInOfflineServers()).thenReturn(true); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java index 804c367c08..df3bca64e4 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java @@ -29,53 +29,53 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -public final class JobRegistryTest { +class JobRegistryTest { @Test - public void assertRegisterJob() { + void assertRegisterJob() { JobScheduleController jobScheduleController = mock(JobScheduleController.class); JobRegistry.getInstance().registerJob("test_job_scheduler_for_add", jobScheduleController); assertThat(JobRegistry.getInstance().getJobScheduleController("test_job_scheduler_for_add"), is(jobScheduleController)); } @Test - public void assertGetJobInstance() { + void assertGetJobInstance() { JobRegistry.getInstance().addJobInstance("exist_job_instance", new JobInstance("127.0.0.1@-@0")); assertThat(JobRegistry.getInstance().getJobInstance("exist_job_instance"), is(new JobInstance("127.0.0.1@-@0"))); } @Test - public void assertGetRegCenter() { + void assertGetRegCenter() { CoordinatorRegistryCenter regCenter = mock(CoordinatorRegistryCenter.class); JobRegistry.getInstance().registerRegistryCenter("test_job_scheduler_for_add", regCenter); assertThat(JobRegistry.getInstance().getRegCenter("test_job_scheduler_for_add"), is(regCenter)); } @Test - public void assertIsJobRunningIfNull() { + void assertIsJobRunningIfNull() { assertFalse(JobRegistry.getInstance().isJobRunning("null_job_instance")); } @Test - public void assertIsJobRunningIfNotNull() { + void assertIsJobRunningIfNotNull() { JobRegistry.getInstance().setJobRunning("exist_job_instance", true); assertTrue(JobRegistry.getInstance().isJobRunning("exist_job_instance")); } @Test - public void assertGetCurrentShardingTotalCountIfNull() { + void assertGetCurrentShardingTotalCountIfNull() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount("exist_job_instance"), is(0)); } @Test - public void assertGetCurrentShardingTotalCountIfNotNull() { + void assertGetCurrentShardingTotalCountIfNotNull() { JobRegistry.getInstance().setCurrentShardingTotalCount("exist_job_instance", 10); assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount("exist_job_instance"), is(10)); ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); } @Test - public void assertShutdown() { + void assertShutdown() { JobScheduleController jobScheduleController = mock(JobScheduleController.class); CoordinatorRegistryCenter regCenter = mock(CoordinatorRegistryCenter.class); JobRegistry.getInstance().registerRegistryCenter("test_job_for_shutdown", regCenter); @@ -86,12 +86,12 @@ public void assertShutdown() { } @Test - public void assertIsShutdownForJobSchedulerNull() { + void assertIsShutdownForJobSchedulerNull() { assertTrue(JobRegistry.getInstance().isShutdown("test_job_for_job_scheduler_null")); } @Test - public void assertIsShutdownForJobInstanceNull() { + void assertIsShutdownForJobInstanceNull() { JobScheduleController jobScheduleController = mock(JobScheduleController.class); CoordinatorRegistryCenter regCenter = mock(CoordinatorRegistryCenter.class); JobRegistry.getInstance().registerRegistryCenter("test_job_for_job_instance_null", regCenter); @@ -100,7 +100,7 @@ public void assertIsShutdownForJobInstanceNull() { } @Test - public void assertIsNotShutdown() { + void assertIsNotShutdown() { JobScheduleController jobScheduleController = mock(JobScheduleController.class); CoordinatorRegistryCenter regCenter = mock(CoordinatorRegistryCenter.class); JobRegistry.getInstance().registerRegistryCenter("test_job_for_job_not_shutdown", regCenter); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java index 5d690953db..92b0dfa0f5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java @@ -44,7 +44,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class JobScheduleControllerTest { +class JobScheduleControllerTest { @Mock private Scheduler scheduler; @@ -55,12 +55,12 @@ public final class JobScheduleControllerTest { private JobScheduleController jobScheduleController; @BeforeEach - public void setUp() { + void setUp() { jobScheduleController = new JobScheduleController(scheduler, jobDetail, "test_job_Trigger"); } @Test - public void assertIsPausedFailure() { + void assertIsPausedFailure() { assertThrows(JobSystemException.class, () -> { doThrow(SchedulerException.class).when(scheduler).getTriggerState(new TriggerKey("test_job_Trigger")); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); @@ -73,28 +73,28 @@ public void assertIsPausedFailure() { } @Test - public void assertIsPausedIfTriggerStateIsNormal() throws SchedulerException { + void assertIsPausedIfTriggerStateIsNormal() throws SchedulerException { when(scheduler.getTriggerState(new TriggerKey("test_job_Trigger"))).thenReturn(Trigger.TriggerState.NORMAL); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); assertFalse(jobScheduleController.isPaused()); } @Test - public void assertIsPausedIfTriggerStateIsPaused() throws SchedulerException { + void assertIsPausedIfTriggerStateIsPaused() throws SchedulerException { when(scheduler.getTriggerState(new TriggerKey("test_job_Trigger"))).thenReturn(Trigger.TriggerState.PAUSED); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); assertTrue(jobScheduleController.isPaused()); } @Test - public void assertIsPauseJobIfShutdown() throws SchedulerException { + void assertIsPauseJobIfShutdown() throws SchedulerException { when(scheduler.isShutdown()).thenReturn(true); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); assertFalse(jobScheduleController.isPaused()); } @Test - public void assertPauseJobIfShutdown() throws SchedulerException { + void assertPauseJobIfShutdown() throws SchedulerException { when(scheduler.isShutdown()).thenReturn(true); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.pauseJob(); @@ -102,7 +102,7 @@ public void assertPauseJobIfShutdown() throws SchedulerException { } @Test - public void assertPauseJobFailure() { + void assertPauseJobFailure() { assertThrows(JobSystemException.class, () -> { doThrow(SchedulerException.class).when(scheduler).pauseAll(); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); @@ -115,14 +115,14 @@ public void assertPauseJobFailure() { } @Test - public void assertPauseJobSuccess() throws SchedulerException { + void assertPauseJobSuccess() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.pauseJob(); verify(scheduler).pauseAll(); } @Test - public void assertResumeJobIfShutdown() throws SchedulerException { + void assertResumeJobIfShutdown() throws SchedulerException { when(scheduler.isShutdown()).thenReturn(true); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.resumeJob(); @@ -130,7 +130,7 @@ public void assertResumeJobIfShutdown() throws SchedulerException { } @Test - public void assertResumeJobFailure() { + void assertResumeJobFailure() { assertThrows(JobSystemException.class, () -> { doThrow(SchedulerException.class).when(scheduler).resumeAll(); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); @@ -143,14 +143,14 @@ public void assertResumeJobFailure() { } @Test - public void assertResumeJobSuccess() throws SchedulerException { + void assertResumeJobSuccess() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.resumeJob(); verify(scheduler).resumeAll(); } @Test - public void assertTriggerJobIfShutdown() throws SchedulerException { + void assertTriggerJobIfShutdown() throws SchedulerException { when(scheduler.isShutdown()).thenReturn(true); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); ReflectionUtils.setFieldValue(jobScheduleController, "jobDetail", jobDetail); @@ -160,7 +160,7 @@ public void assertTriggerJobIfShutdown() throws SchedulerException { } @Test - public void assertTriggerJobFailure() { + void assertTriggerJobFailure() { assertThrows(JobSystemException.class, () -> { JobKey jobKey = new JobKey("test_job"); when(jobDetail.getKey()).thenReturn(jobKey); @@ -178,7 +178,7 @@ public void assertTriggerJobFailure() { } @Test - public void assertTriggerJobSuccess() throws SchedulerException { + void assertTriggerJobSuccess() throws SchedulerException { JobKey jobKey = new JobKey("test_job"); when(jobDetail.getKey()).thenReturn(jobKey); when(scheduler.checkExists(any(JobKey.class))).thenReturn(true); @@ -190,7 +190,7 @@ public void assertTriggerJobSuccess() throws SchedulerException { } @Test - public void assertTriggerOneOffJobSuccess() throws SchedulerException { + void assertTriggerOneOffJobSuccess() throws SchedulerException { JobKey jobKey = new JobKey("test_job"); when(jobDetail.getKey()).thenReturn(jobKey); when(scheduler.checkExists(jobDetail.getKey())).thenReturn(false); @@ -203,7 +203,7 @@ public void assertTriggerOneOffJobSuccess() throws SchedulerException { } @Test - public void assertShutdownJobIfShutdown() throws SchedulerException { + void assertShutdownJobIfShutdown() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); when(scheduler.isShutdown()).thenReturn(true); jobScheduleController.shutdown(); @@ -211,7 +211,7 @@ public void assertShutdownJobIfShutdown() throws SchedulerException { } @Test - public void assertShutdownFailure() { + void assertShutdownFailure() { assertThrows(JobSystemException.class, () -> { doThrow(SchedulerException.class).when(scheduler).shutdown(false); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); @@ -224,14 +224,14 @@ public void assertShutdownFailure() { } @Test - public void assertShutdownSuccess() throws SchedulerException { + void assertShutdownSuccess() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.shutdown(); verify(scheduler).shutdown(false); } @Test - public void assertRescheduleJobIfShutdown() throws SchedulerException { + void assertRescheduleJobIfShutdown() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); when(scheduler.isShutdown()).thenReturn(true); jobScheduleController.rescheduleJob("0/1 * * * * ?", null); @@ -239,7 +239,7 @@ public void assertRescheduleJobIfShutdown() throws SchedulerException { } @Test - public void assertRescheduleJobFailure() { + void assertRescheduleJobFailure() { assertThrows(JobSystemException.class, () -> { when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new CronTriggerImpl()); doThrow(SchedulerException.class).when(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); @@ -253,7 +253,7 @@ public void assertRescheduleJobFailure() { } @Test - public void assertRescheduleJobSuccess() throws SchedulerException { + void assertRescheduleJobSuccess() throws SchedulerException { when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new CronTriggerImpl()); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.rescheduleJob("0/1 * * * * ?", null); @@ -261,14 +261,14 @@ public void assertRescheduleJobSuccess() throws SchedulerException { } @Test - public void assertRescheduleJobWhenTriggerIsNull() throws SchedulerException { + void assertRescheduleJobWhenTriggerIsNull() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.rescheduleJob("0/1 * * * * ?", null); verify(scheduler, times(0)).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); } @Test - public void assertRescheduleJobIfShutdownForOneOffJob() throws SchedulerException { + void assertRescheduleJobIfShutdownForOneOffJob() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); when(scheduler.isShutdown()).thenReturn(true); jobScheduleController.rescheduleJob(); @@ -276,7 +276,7 @@ public void assertRescheduleJobIfShutdownForOneOffJob() throws SchedulerExceptio } @Test - public void assertRescheduleJobFailureForOneOffJob() { + void assertRescheduleJobFailureForOneOffJob() { assertThrows(JobSystemException.class, () -> { when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new SimpleTriggerImpl()); doThrow(SchedulerException.class).when(scheduler).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); @@ -290,7 +290,7 @@ public void assertRescheduleJobFailureForOneOffJob() { } @Test - public void assertRescheduleJobSuccessForOneOffJob() throws SchedulerException { + void assertRescheduleJobSuccessForOneOffJob() throws SchedulerException { when(scheduler.getTrigger(TriggerKey.triggerKey("test_job_Trigger"))).thenReturn(new SimpleTriggerImpl()); ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.rescheduleJob(); @@ -298,7 +298,7 @@ public void assertRescheduleJobSuccessForOneOffJob() throws SchedulerException { } @Test - public void assertRescheduleJobWhenTriggerIsNullForOneOffJob() throws SchedulerException { + void assertRescheduleJobWhenTriggerIsNullForOneOffJob() throws SchedulerException { ReflectionUtils.setFieldValue(jobScheduleController, "scheduler", scheduler); jobScheduleController.rescheduleJob(); verify(scheduler, times(0)).rescheduleJob(eq(TriggerKey.triggerKey("test_job_Trigger")), any()); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java index db1ead14fa..36ee33a689 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java @@ -36,7 +36,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class JobTriggerListenerTest { +class JobTriggerListenerTest { @Mock private ExecutionService executionService; @@ -50,23 +50,23 @@ public final class JobTriggerListenerTest { private JobTriggerListener jobTriggerListener; @BeforeEach - public void setUp() { + void setUp() { jobTriggerListener = new JobTriggerListener(executionService, shardingService); } @Test - public void assertGetName() { + void assertGetName() { assertThat(jobTriggerListener.getName(), is("JobTriggerListener")); } @Test - public void assertTriggerMisfiredWhenPreviousFireTimeIsNull() { + void assertTriggerMisfiredWhenPreviousFireTimeIsNull() { jobTriggerListener.triggerMisfired(trigger); verify(executionService, times(0)).setMisfire(Collections.singletonList(0)); } @Test - public void assertTriggerMisfiredWhenPreviousFireTimeIsNotNull() { + void assertTriggerMisfiredWhenPreviousFireTimeIsNotNull() { when(shardingService.getLocalShardingItems()).thenReturn(Collections.singletonList(0)); when(trigger.getPreviousFireTime()).thenReturn(new Date()); jobTriggerListener.triggerMisfired(trigger); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java index 8d8a1dc68d..5ac6645d49 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java @@ -46,7 +46,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class LiteJobFacadeTest { +class LiteJobFacadeTest { @Mock private ConfigurationService configService; @@ -74,7 +74,7 @@ public final class LiteJobFacadeTest { private StringBuilder orderResult; @BeforeEach - public void setUp() { + void setUp() { orderResult = new StringBuilder(); TestElasticJobListener l1 = new TestElasticJobListener(caller, "l1", 2, orderResult); TestElasticJobListener l2 = new TestElasticJobListener(caller, "l2", 1, orderResult); @@ -88,41 +88,41 @@ public void setUp() { } @Test - public void assertLoad() { + void assertLoad() { JobConfiguration expected = JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build(); when(configService.load(true)).thenReturn(expected); assertThat(liteJobFacade.loadJobConfiguration(true), is(expected)); } @Test - public void assertCheckMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { + void assertCheckMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { liteJobFacade.checkJobExecutionEnvironment(); verify(configService).checkMaxTimeDiffSecondsTolerable(); } @Test - public void assertFailoverIfUnnecessary() { + void assertFailoverIfUnnecessary() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); liteJobFacade.failoverIfNecessary(); verify(failoverService, times(0)).failoverIfNecessary(); } @Test - public void assertFailoverIfNecessary() { + void assertFailoverIfNecessary() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).monitorExecution(true).build()); liteJobFacade.failoverIfNecessary(); verify(failoverService).failoverIfNecessary(); } @Test - public void assertRegisterJobBegin() { + void assertRegisterJobBegin() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); liteJobFacade.registerJobBegin(shardingContexts); verify(executionService).registerJobBegin(shardingContexts); } @Test - public void assertRegisterJobCompletedWhenFailoverDisabled() { + void assertRegisterJobCompletedWhenFailoverDisabled() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); liteJobFacade.registerJobCompleted(shardingContexts); @@ -131,7 +131,7 @@ public void assertRegisterJobCompletedWhenFailoverDisabled() { } @Test - public void assertRegisterJobCompletedWhenFailoverEnabled() { + void assertRegisterJobCompletedWhenFailoverEnabled() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).monitorExecution(true).build()); liteJobFacade.registerJobCompleted(shardingContexts); @@ -140,7 +140,7 @@ public void assertRegisterJobCompletedWhenFailoverEnabled() { } @Test - public void assertGetShardingContextWhenIsFailoverEnableAndFailover() { + void assertGetShardingContextWhenIsFailoverEnableAndFailover() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).monitorExecution(true).build()); when(failoverService.getLocalFailoverItems()).thenReturn(Collections.singletonList(1)); @@ -150,7 +150,7 @@ public void assertGetShardingContextWhenIsFailoverEnableAndFailover() { } @Test - public void assertGetShardingContextWhenIsFailoverEnableAndNotFailover() { + void assertGetShardingContextWhenIsFailoverEnableAndNotFailover() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).monitorExecution(true).build()); when(failoverService.getLocalFailoverItems()).thenReturn(Collections.emptyList()); @@ -162,7 +162,7 @@ public void assertGetShardingContextWhenIsFailoverEnableAndNotFailover() { } @Test - public void assertGetShardingContextWhenIsFailoverDisable() { + void assertGetShardingContextWhenIsFailoverDisable() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); when(shardingService.getLocalShardingItems()).thenReturn(Arrays.asList(0, 1)); @@ -172,7 +172,7 @@ public void assertGetShardingContextWhenIsFailoverDisable() { } @Test - public void assertGetShardingContextWhenHasDisabledItems() { + void assertGetShardingContextWhenHasDisabledItems() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); when(shardingService.getLocalShardingItems()).thenReturn(Lists.newArrayList(0, 1)); @@ -183,39 +183,39 @@ public void assertGetShardingContextWhenHasDisabledItems() { } @Test - public void assertMisfireIfRunning() { + void assertMisfireIfRunning() { when(executionService.misfireIfHasRunningItems(Arrays.asList(0, 1))).thenReturn(true); assertThat(liteJobFacade.misfireIfRunning(Arrays.asList(0, 1)), is(true)); } @Test - public void assertClearMisfire() { + void assertClearMisfire() { liteJobFacade.clearMisfire(Arrays.asList(0, 1)); verify(executionService).clearMisfire(Arrays.asList(0, 1)); } @Test - public void assertIsNeedSharding() { + void assertIsNeedSharding() { when(shardingService.isNeedSharding()).thenReturn(true); assertThat(liteJobFacade.isNeedSharding(), is(true)); } @Test - public void assertBeforeJobExecuted() { + void assertBeforeJobExecuted() { liteJobFacade.beforeJobExecuted(new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap())); verify(caller, times(2)).before(); assertThat(orderResult.toString(), is("l2l1")); } @Test - public void assertAfterJobExecuted() { + void assertAfterJobExecuted() { liteJobFacade.afterJobExecuted(new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap())); verify(caller, times(2)).after(); assertThat(orderResult.toString(), is("l2l1")); } @Test - public void assertPostJobExecutionEvent() { + void assertPostJobExecutionEvent() { liteJobFacade.postJobExecutionEvent(null); verify(jobTracingEventBus).post(null); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java index 1609fa9bca..8ab368ac3c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java @@ -33,7 +33,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class SchedulerFacadeTest { +class SchedulerFacadeTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -50,7 +50,7 @@ public final class SchedulerFacadeTest { private SchedulerFacade schedulerFacade; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); schedulerFacade = new SchedulerFacade(null, "test_job"); ReflectionUtils.setFieldValue(schedulerFacade, "leaderService", leaderService); @@ -58,7 +58,7 @@ public void setUp() { } @Test - public void assertShutdownInstanceIfNotLeaderAndReconcileServiceIsNotRunning() { + void assertShutdownInstanceIfNotLeaderAndReconcileServiceIsNotRunning() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); schedulerFacade.shutdownInstance(); @@ -67,7 +67,7 @@ public void assertShutdownInstanceIfNotLeaderAndReconcileServiceIsNotRunning() { } @Test - public void assertShutdownInstanceIfLeaderAndReconcileServiceIsRunning() { + void assertShutdownInstanceIfLeaderAndReconcileServiceIsRunning() { when(leaderService.isLeader()).thenReturn(true); JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java index 2613122f56..1f6ca05d20 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java @@ -27,37 +27,37 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class ServerNodeTest { +class ServerNodeTest { private final ServerNode serverNode = new ServerNode("test_job"); @BeforeAll - public static void setUp() { + static void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); } @Test - public void assertIsServerPath() { + void assertIsServerPath() { assertTrue(serverNode.isServerPath("/test_job/servers/127.0.0.1")); } @Test - public void assertIsNotServerPath() { + void assertIsNotServerPath() { assertFalse(serverNode.isServerPath("/test_job/servers/255.255.255.256")); } @Test - public void assertIsLocalServerPath() { + void assertIsLocalServerPath() { assertTrue(serverNode.isLocalServerPath("/test_job/servers/127.0.0.1")); } @Test - public void assertIsNotLocalServerPath() { + void assertIsNotLocalServerPath() { assertFalse(serverNode.isLocalServerPath("/test_job/servers/127.0.0.2")); } @Test - public void assertGetServerNode() { + void assertGetServerNode() { assertThat(serverNode.getServerNode("127.0.0.1"), is("servers/127.0.0.1")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java index d775045c6a..9884d74f2a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ServerServiceTest { +class ServerServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -53,7 +53,7 @@ public final class ServerServiceTest { private ServerService serverService; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0", null, "127.0.0.1")); serverService = new ServerService(null, "test_job"); ServerNode serverNode = new ServerNode("test_job"); @@ -62,14 +62,14 @@ public void setUp() { } @Test - public void assertPersistOnlineForInstanceShutdown() { + void assertPersistOnlineForInstanceShutdown() { JobRegistry.getInstance().shutdown("test_job"); serverService.persistOnline(false); verify(jobNodeStorage, times(0)).fillJobNode("servers/127.0.0.1", ServerStatus.DISABLED.name()); } @Test - public void assertPersistOnlineForDisabledServer() { + void assertPersistOnlineForDisabledServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); serverService.persistOnline(false); @@ -78,7 +78,7 @@ public void assertPersistOnlineForDisabledServer() { } @Test - public void assertPersistOnlineForEnabledServer() { + void assertPersistOnlineForEnabledServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); serverService.persistOnline(true); @@ -87,7 +87,7 @@ public void assertPersistOnlineForEnabledServer() { } @Test - public void assertHasAvailableServers() { + void assertHasAvailableServers() { when(jobNodeStorage.getJobNodeChildrenKeys("servers")).thenReturn(Arrays.asList("127.0.0.1", "127.0.0.2", "127.0.0.3")); when(jobNodeStorage.getJobNodeData("servers/127.0.0.1")).thenReturn(ServerStatus.DISABLED.name()); when(jobNodeStorage.getJobNodeData("servers/127.0.0.2")).thenReturn(ServerStatus.ENABLED.name()); @@ -97,7 +97,7 @@ public void assertHasAvailableServers() { } @Test - public void assertHasNotAvailableServers() { + void assertHasNotAvailableServers() { when(jobNodeStorage.getJobNodeChildrenKeys("servers")).thenReturn(Arrays.asList("127.0.0.1", "127.0.0.2")); when(jobNodeStorage.getJobNodeData("servers/127.0.0.1")).thenReturn(ServerStatus.DISABLED.name()); when(jobNodeStorage.getJobNodeData("servers/127.0.0.2")).thenReturn(ServerStatus.DISABLED.name()); @@ -105,39 +105,39 @@ public void assertHasNotAvailableServers() { } @Test - public void assertIsNotAvailableServerWhenDisabled() { + void assertIsNotAvailableServerWhenDisabled() { when(jobNodeStorage.getJobNodeData("servers/127.0.0.1")).thenReturn(ServerStatus.DISABLED.name()); assertFalse(serverService.isAvailableServer("127.0.0.1")); } @Test - public void assertIsNotAvailableServerWithoutOnlineInstances() { + void assertIsNotAvailableServerWithoutOnlineInstances() { when(jobNodeStorage.getJobNodeChildrenKeys("instances")).thenReturn(Collections.singletonList("127.0.0.2@-@0")); when(jobNodeStorage.getJobNodeData("servers/127.0.0.1")).thenReturn(ServerStatus.ENABLED.name()); assertFalse(serverService.isAvailableServer("127.0.0.1")); } @Test - public void assertIsAvailableServer() { + void assertIsAvailableServer() { when(jobNodeStorage.getJobNodeChildrenKeys("instances")).thenReturn(Collections.singletonList("127.0.0.1@-@0")); when(jobNodeStorage.getJobNodeData("servers/127.0.0.1")).thenReturn(ServerStatus.ENABLED.name()); assertTrue(serverService.isAvailableServer("127.0.0.1")); } @Test - public void assertIsNotEnableServer() { + void assertIsNotEnableServer() { when(jobNodeStorage.getJobNodeData("servers/127.0.0.1")).thenReturn("", ServerStatus.DISABLED.name()); assertFalse(serverService.isEnableServer("127.0.0.1")); } @Test - public void assertIsEnableServer() { + void assertIsEnableServer() { when(jobNodeStorage.getJobNodeData("servers/127.0.0.1")).thenReturn("", ServerStatus.ENABLED.name()); assertTrue(serverService.isEnableServer("127.0.0.1")); } @Test - public void assertServerNodeAbsent() { + void assertServerNodeAbsent() { assertFalse(serverService.isEnableServer("127.0.0.1")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java index 55b9560a9e..856bbde327 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java @@ -26,10 +26,10 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class DefaultJobClassNameProviderTest { +class DefaultJobClassNameProviderTest { @Test - public void assertGetOrdinaryClassJobName() { + void assertGetOrdinaryClassJobName() { JobClassNameProvider jobClassNameProvider = new DefaultJobClassNameProvider(); String result = jobClassNameProvider.getJobClassName(new DetailedFooJob()); assertThat(result, is("org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob")); @@ -38,7 +38,7 @@ public void assertGetOrdinaryClassJobName() { // TODO OpenJDK 21 breaks this unit test. @Test @DisabledForJreRange(min = JRE.JAVA_21, max = JRE.OTHER) - public void assertGetLambdaJobName() { + void assertGetLambdaJobName() { JobClassNameProvider jobClassNameProvider = new DefaultJobClassNameProvider(); FooJob lambdaFooJob = shardingContext -> { }; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java index 34f52ae760..065fa6917d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java @@ -22,10 +22,10 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobClassNameProviderFactoryTest { +class JobClassNameProviderFactoryTest { @Test - public void assertGetDefaultStrategy() { + void assertGetDefaultStrategy() { assertThat(JobClassNameProviderFactory.getProvider(), instanceOf(DefaultJobClassNameProvider.class)); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java index 1243e3967d..4670b369e2 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java @@ -38,7 +38,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class SetUpFacadeTest { +class SetUpFacadeTest { @Mock private LeaderService leaderService; @@ -61,7 +61,7 @@ public final class SetUpFacadeTest { private SetUpFacade setUpFacade; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); setUpFacade = new SetUpFacade(regCenter, "test_job", Collections.emptyList()); ReflectionUtils.setFieldValue(setUpFacade, "leaderService", leaderService); @@ -72,7 +72,7 @@ public void setUp() { } @Test - public void assertRegisterStartUpInfo() { + void assertRegisterStartUpInfo() { setUpFacade.registerStartUpInfo(true); verify(listenerManager).startAllListeners(); verify(leaderService).electLeader(); @@ -80,7 +80,7 @@ public void assertRegisterStartUpInfo() { } @Test - public void assertTearDown() { + void assertTearDown() { when(reconcileService.isRunning()).thenReturn(true); setUpFacade.tearDown(); verify(reconcileService).stopAsync(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java index 637729706b..e01d8046b5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java @@ -42,7 +42,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ExecutionContextServiceTest { +class ExecutionContextServiceTest { @Mock private JobNodeStorage jobNodeStorage; @@ -53,14 +53,14 @@ public final class ExecutionContextServiceTest { private final ExecutionContextService executionContextService = new ExecutionContextService(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(executionContextService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(executionContextService, "configService", configService); JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); } @Test - public void assertGetShardingContextWhenNotAssignShardingItem() { + void assertGetShardingContextWhenNotAssignShardingItem() { when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?").setProperty("streaming.process", Boolean.TRUE.toString()).monitorExecution(false).build()); ShardingContexts shardingContexts = executionContextService.getJobShardingContext(Collections.emptyList()); @@ -69,7 +69,7 @@ public void assertGetShardingContextWhenNotAssignShardingItem() { } @Test - public void assertGetShardingContextWhenAssignShardingItems() { + void assertGetShardingContextWhenAssignShardingItems() { when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?").shardingItemParameters("0=A,1=B,2=C").setProperty("streaming.process", Boolean.TRUE.toString()).monitorExecution(false).build()); Map map = new HashMap<>(3); @@ -80,7 +80,7 @@ public void assertGetShardingContextWhenAssignShardingItems() { } @Test - public void assertGetShardingContextWhenHasRunningItems() { + void assertGetShardingContextWhenHasRunningItems() { when(configService.load(false)).thenReturn(JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?").shardingItemParameters("0=A,1=B,2=C").setProperty("streaming.process", Boolean.TRUE.toString()).monitorExecution(true).build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java index edde6c7f2e..20e42e249c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ExecutionServiceTest { +class ExecutionServiceTest { @Mock private JobNodeStorage jobNodeStorage; @@ -58,18 +58,18 @@ public final class ExecutionServiceTest { private final ExecutionService executionService = new ExecutionService(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(executionService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(executionService, "configService", configService); } @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown("test_job"); } @Test - public void assertRegisterJobBeginWithoutMonitorExecution() { + void assertRegisterJobBeginWithoutMonitorExecution() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(false).build()); executionService.registerJobBegin(getShardingContext()); verify(jobNodeStorage, times(0)).fillEphemeralJobNode(any(), any()); @@ -77,7 +77,7 @@ public void assertRegisterJobBeginWithoutMonitorExecution() { } @Test - public void assertRegisterJobBeginWithMonitorExecution() { + void assertRegisterJobBeginWithMonitorExecution() { String jobInstanceId = "127.0.0.1@-@1"; JobRegistry.getInstance().addJobInstance("test_job", new JobInstance(jobInstanceId)); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(true).build()); @@ -89,7 +89,7 @@ public void assertRegisterJobBeginWithMonitorExecution() { } @Test - public void assertRegisterJobBeginWithFailoverEnabled() { + void assertRegisterJobBeginWithFailoverEnabled() { String jobInstanceId = "127.0.0.1@-@1"; JobRegistry.getInstance().addJobInstance("test_job", new JobInstance(jobInstanceId)); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).build()); @@ -101,7 +101,7 @@ public void assertRegisterJobBeginWithFailoverEnabled() { } @Test - public void assertRegisterJobCompletedWithoutMonitorExecution() { + void assertRegisterJobCompletedWithoutMonitorExecution() { JobRegistry.getInstance().setJobRunning("test_job", true); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(false).build()); executionService.registerJobCompleted(new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap())); @@ -111,7 +111,7 @@ public void assertRegisterJobCompletedWithoutMonitorExecution() { } @Test - public void assertRegisterJobCompletedWithMonitorExecution() { + void assertRegisterJobCompletedWithMonitorExecution() { JobRegistry.getInstance().setJobRunning("test_job", true); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(true).build()); executionService.registerJobCompleted(getShardingContext()); @@ -122,7 +122,7 @@ public void assertRegisterJobCompletedWithMonitorExecution() { } @Test - public void assertClearAllRunningInfo() { + void assertClearAllRunningInfo() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(false).build()); executionService.clearAllRunningInfo(); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/0/running"); @@ -131,20 +131,20 @@ public void assertClearAllRunningInfo() { } @Test - public void assertClearRunningInfo() { + void assertClearRunningInfo() { executionService.clearRunningInfo(Arrays.asList(0, 1)); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/0/running"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/1/running"); } @Test - public void assertNotHaveRunningItemsWithoutMonitorExecution() { + void assertNotHaveRunningItemsWithoutMonitorExecution() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(false).build()); assertFalse(executionService.hasRunningItems(Arrays.asList(0, 1, 2))); } @Test - public void assertHasRunningItemsWithMonitorExecution() { + void assertHasRunningItemsWithMonitorExecution() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(true).build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(true); @@ -152,7 +152,7 @@ public void assertHasRunningItemsWithMonitorExecution() { } @Test - public void assertNotHaveRunningItems() { + void assertNotHaveRunningItems() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(true).build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(false); @@ -161,7 +161,7 @@ public void assertNotHaveRunningItems() { } @Test - public void assertHasRunningItemsForAll() { + void assertHasRunningItemsForAll() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(true); @@ -169,7 +169,7 @@ public void assertHasRunningItemsForAll() { } @Test - public void assertNotHaveRunningItemsForAll() { + void assertNotHaveRunningItemsForAll() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(false); @@ -178,7 +178,7 @@ public void assertNotHaveRunningItemsForAll() { } @Test - public void assertGetAllRunningItems() { + void assertGetAllRunningItems() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).build()); String jobInstanceId = "127.0.0.1@-@1"; when(jobNodeStorage.getJobNodeData("sharding/0/running")).thenReturn(jobInstanceId); @@ -190,7 +190,7 @@ public void assertGetAllRunningItems() { } @Test - public void assertMisfireIfNotRunning() { + void assertMisfireIfNotRunning() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(true).build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(false); @@ -199,7 +199,7 @@ public void assertMisfireIfNotRunning() { } @Test - public void assertMisfireIfRunning() { + void assertMisfireIfRunning() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").monitorExecution(true).build()); when(jobNodeStorage.isJobNodeExisted("sharding/0/running")).thenReturn(false); when(jobNodeStorage.isJobNodeExisted("sharding/1/running")).thenReturn(true); @@ -207,7 +207,7 @@ public void assertMisfireIfRunning() { } @Test - public void assertSetMisfire() { + void assertSetMisfire() { executionService.setMisfire(Arrays.asList(0, 1, 2)); verify(jobNodeStorage).createJobNodeIfNeeded("sharding/0/misfire"); verify(jobNodeStorage).createJobNodeIfNeeded("sharding/1/misfire"); @@ -215,7 +215,7 @@ public void assertSetMisfire() { } @Test - public void assertGetMisfiredJobItems() { + void assertGetMisfiredJobItems() { when(jobNodeStorage.isJobNodeExisted("sharding/0/misfire")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("sharding/1/misfire")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("sharding/2/misfire")).thenReturn(false); @@ -223,7 +223,7 @@ public void assertGetMisfiredJobItems() { } @Test - public void assertClearMisfire() { + void assertClearMisfire() { executionService.clearMisfire(Arrays.asList(0, 1, 2)); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/0/misfire"); verify(jobNodeStorage).removeJobNodeIfExisted("sharding/1/misfire"); @@ -231,7 +231,7 @@ public void assertClearMisfire() { } @Test - public void assertGetDisabledItems() { + void assertGetDisabledItems() { when(jobNodeStorage.isJobNodeExisted("sharding/0/disabled")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("sharding/1/disabled")).thenReturn(true); when(jobNodeStorage.isJobNodeExisted("sharding/2/disabled")).thenReturn(false); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java index 1b5b6388a6..6f5bf035b8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java @@ -32,7 +32,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class MonitorExecutionListenerManagerTest { +class MonitorExecutionListenerManagerTest { @Mock private JobNodeStorage jobNodeStorage; @@ -43,31 +43,31 @@ public final class MonitorExecutionListenerManagerTest { private final MonitorExecutionListenerManager monitorExecutionListenerManager = new MonitorExecutionListenerManager(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setSuperclassFieldValue(monitorExecutionListenerManager, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(monitorExecutionListenerManager, "executionService", executionService); } @Test - public void assertMonitorExecutionSettingsChangedJobListenerWhenIsNotFailoverPath() { + void assertMonitorExecutionSettingsChangedJobListenerWhenIsNotFailoverPath() { monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/other", LiteYamlConstants.getJobYaml())); verify(executionService, times(0)).clearAllRunningInfo(); } @Test - public void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathButNotUpdate() { + void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathButNotUpdate() { monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", "")); verify(executionService, times(0)).clearAllRunningInfo(); } @Test - public void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButEnableFailover() { + void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButEnableFailover() { monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); verify(executionService, times(0)).clearAllRunningInfo(); } @Test - public void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButDisableFailover() { + void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButDisableFailover() { DataChangedEvent event = new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYamlWithMonitorExecution(false)); monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(event); verify(executionService).clearAllRunningInfo(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java index 5ea835479f..6485aa912f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java @@ -42,7 +42,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ShardingListenerManagerTest { +class ShardingListenerManagerTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -62,7 +62,7 @@ public final class ShardingListenerManagerTest { private ShardingListenerManager shardingListenerManager; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); shardingListenerManager = new ShardingListenerManager(null, "test_job"); ReflectionUtils.setSuperclassFieldValue(shardingListenerManager, "jobNodeStorage", jobNodeStorage); @@ -71,25 +71,25 @@ public void setUp() { } @Test - public void assertStart() { + void assertStart() { shardingListenerManager.start(); verify(jobNodeStorage, times(2)).addDataListener(any(DataChangedEventListener.class)); } @Test - public void assertShardingTotalCountChangedJobListenerWhenIsNotConfigPath() { + void assertShardingTotalCountChangedJobListenerWhenIsNotConfigPath() { shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config/other", "")); verify(shardingService, times(0)).setReshardingFlag(); } @Test - public void assertShardingTotalCountChangedJobListenerWhenIsConfigPathButCurrentShardingTotalCountIsZero() { + void assertShardingTotalCountChangedJobListenerWhenIsConfigPathButCurrentShardingTotalCountIsZero() { shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", LiteYamlConstants.getJobYaml())); verify(shardingService, times(0)).setReshardingFlag(); } @Test - public void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsEqualToNewShardingTotalCount() { + void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsEqualToNewShardingTotalCount() { JobRegistry.getInstance().setCurrentShardingTotalCount("test_job", 3); shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", LiteYamlConstants.getJobYaml())); verify(shardingService, times(0)).setReshardingFlag(); @@ -97,7 +97,7 @@ public void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrent } @Test - public void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsNotEqualToNewShardingTotalCount() { + void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsNotEqualToNewShardingTotalCount() { JobRegistry.getInstance().setCurrentShardingTotalCount("test_job", 5); shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); verify(shardingService).setReshardingFlag(); @@ -105,25 +105,25 @@ public void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrent } @Test - public void assertListenServersChangedJobListenerWhenIsNotServerStatusPath() { + void assertListenServersChangedJobListenerWhenIsNotServerStatusPath() { shardingListenerManager.new ListenServersChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/servers/127.0.0.1/other", "")); verify(shardingService, times(0)).setReshardingFlag(); } @Test - public void assertListenServersChangedJobListenerWhenIsServerStatusPathButUpdate() { + void assertListenServersChangedJobListenerWhenIsServerStatusPathButUpdate() { shardingListenerManager.new ListenServersChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/servers/127.0.0.1/status", "")); verify(shardingService, times(0)).setReshardingFlag(); } @Test - public void assertListenServersChangedJobListenerWhenIsInstanceChangeButJobInstanceIsShutdown() { + void assertListenServersChangedJobListenerWhenIsInstanceChangeButJobInstanceIsShutdown() { shardingListenerManager.new ListenServersChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/instances/xxx", "")); verify(shardingService, times(0)).setReshardingFlag(); } @Test - public void assertListenServersChangedJobListenerWhenIsInstanceChange() { + void assertListenServersChangedJobListenerWhenIsInstanceChange() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 1).build()); @@ -133,7 +133,7 @@ public void assertListenServersChangedJobListenerWhenIsInstanceChange() { } @Test - public void assertListenServersChangedJobListenerWhenIsServerChange() { + void assertListenServersChangedJobListenerWhenIsServerChange() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 1).build()); @@ -143,7 +143,7 @@ public void assertListenServersChangedJobListenerWhenIsServerChange() { } @Test - public void assertListenServersChangedJobListenerWhenIsStaticSharding() { + void assertListenServersChangedJobListenerWhenIsStaticSharding() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 1).staticSharding(true).build()); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java index f8354560d9..eedd44ff3d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java @@ -23,27 +23,27 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; -public final class ShardingNodeTest { +class ShardingNodeTest { private final ShardingNode shardingNode = new ShardingNode("test_job"); @Test - public void assertGetRunningNode() { + void assertGetRunningNode() { assertThat(ShardingNode.getRunningNode(0), is("sharding/0/running")); } @Test - public void assertGetMisfireNode() { + void assertGetMisfireNode() { assertThat(ShardingNode.getMisfireNode(0), is("sharding/0/misfire")); } @Test - public void assertGetItemWhenNotRunningItemPath() { + void assertGetItemWhenNotRunningItemPath() { assertNull(shardingNode.getItemByRunningItemPath("/test_job/sharding/0/completed")); } @Test - public void assertGetItemByRunningItemPath() { + void assertGetItemByRunningItemPath() { assertThat(shardingNode.getItemByRunningItemPath("/test_job/sharding/0/running"), is(0)); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java index b3e12b3456..8128d82700 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java @@ -50,7 +50,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ShardingServiceTest { +class ShardingServiceTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -79,7 +79,7 @@ public final class ShardingServiceTest { private final ShardingService shardingService = new ShardingService(null, "test_job"); @BeforeEach - public void setUp() { + void setUp() { ReflectionUtils.setFieldValue(shardingService, "jobNodeStorage", jobNodeStorage); ReflectionUtils.setFieldValue(shardingService, "leaderService", leaderService); ReflectionUtils.setFieldValue(shardingService, "configService", configService); @@ -90,40 +90,40 @@ public void setUp() { } @Test - public void assertSetReshardingFlagOnLeader() { + void assertSetReshardingFlagOnLeader() { when(leaderService.isLeaderUntilBlock()).thenReturn(true); shardingService.setReshardingFlag(); verify(jobNodeStorage).createJobNodeIfNeeded("leader/sharding/necessary"); } @Test - public void assertSetReshardingFlagOnNonLeader() { + void assertSetReshardingFlagOnNonLeader() { when(leaderService.isLeaderUntilBlock()).thenReturn(false); shardingService.setReshardingFlag(); verify(jobNodeStorage, times(0)).createJobNodeIfNeeded("leader/sharding/necessary"); } @Test - public void assertIsNeedSharding() { + void assertIsNeedSharding() { when(jobNodeStorage.isJobNodeExisted("leader/sharding/necessary")).thenReturn(true); assertTrue(shardingService.isNeedSharding()); } @Test - public void assertShardingWhenUnnecessary() { + void assertShardingWhenUnnecessary() { shardingService.shardingIfNecessary(); verify(jobNodeStorage, times(0)).fillEphemeralJobNode(ShardingNode.PROCESSING, ""); } @Test - public void assertShardingWithoutAvailableJobInstances() { + void assertShardingWithoutAvailableJobInstances() { when(jobNodeStorage.isJobNodeExisted("leader/sharding/necessary")).thenReturn(true); shardingService.shardingIfNecessary(); verify(jobNodeStorage, times(0)).fillEphemeralJobNode(ShardingNode.PROCESSING, ""); } @Test - public void assertShardingWhenIsNotLeader() { + void assertShardingWhenIsNotLeader() { when(jobNodeStorage.isJobNodeExisted("leader/sharding/necessary")).thenReturn(true, false); when(instanceService.getAvailableJobInstances()).thenReturn(Collections.singletonList(new JobInstance("127.0.0.1@-@0"))); when(leaderService.isLeaderUntilBlock()).thenReturn(false); @@ -133,7 +133,7 @@ public void assertShardingWhenIsNotLeader() { } @Test - public void assertShardingNecessaryWhenMonitorExecutionEnabledAndIncreaseShardingTotalCount() { + void assertShardingNecessaryWhenMonitorExecutionEnabledAndIncreaseShardingTotalCount() { when(instanceService.getAvailableJobInstances()).thenReturn(Collections.singletonList(new JobInstance("127.0.0.1@-@0"))); when(jobNodeStorage.isJobNodeExisted("leader/sharding/necessary")).thenReturn(true); when(leaderService.isLeaderUntilBlock()).thenReturn(true); @@ -153,7 +153,7 @@ public void assertShardingNecessaryWhenMonitorExecutionEnabledAndIncreaseShardin } @Test - public void assertShardingNecessaryWhenMonitorExecutionDisabledAndDecreaseShardingTotalCount() { + void assertShardingNecessaryWhenMonitorExecutionDisabledAndDecreaseShardingTotalCount() { when(instanceService.getAvailableJobInstances()).thenReturn(Collections.singletonList(new JobInstance("127.0.0.1@-@0"))); when(jobNodeStorage.isJobNodeExisted("leader/sharding/necessary")).thenReturn(true); when(leaderService.isLeaderUntilBlock()).thenReturn(true); @@ -173,13 +173,13 @@ public void assertShardingNecessaryWhenMonitorExecutionDisabledAndDecreaseShardi } @Test - public void assertGetShardingItemsWithNotAvailableServer() { + void assertGetShardingItemsWithNotAvailableServer() { when(jobNodeStorage.getJobNodeData("instances/127.0.0.1@-@0")).thenReturn("jobInstanceId: 127.0.0.1@-@0\nserverIp: 127.0.0.1\n"); assertThat(shardingService.getShardingItems("127.0.0.1@-@0"), is(Collections.emptyList())); } @Test - public void assertGetShardingItemsWithAvailableServer() { + void assertGetShardingItemsWithAvailableServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(serverService.isAvailableServer("127.0.0.1")).thenReturn(true); @@ -193,12 +193,12 @@ public void assertGetShardingItemsWithAvailableServer() { } @Test - public void assertGetLocalShardingItemsWithInstanceShutdown() { + void assertGetLocalShardingItemsWithInstanceShutdown() { assertThat(shardingService.getLocalShardingItems(), is(Collections.emptyList())); } @Test - public void assertGetLocalShardingItemsWithDisabledServer() { + void assertGetLocalShardingItemsWithDisabledServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); assertThat(shardingService.getLocalShardingItems(), is(Collections.emptyList())); @@ -206,7 +206,7 @@ public void assertGetLocalShardingItemsWithDisabledServer() { } @Test - public void assertGetLocalShardingItemsWithEnabledServer() { + void assertGetLocalShardingItemsWithEnabledServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(serverService.isAvailableServer("127.0.0.1")).thenReturn(true); @@ -220,7 +220,7 @@ public void assertGetLocalShardingItemsWithEnabledServer() { } @Test - public void assertHasShardingInfoInOfflineServers() { + void assertHasShardingInfoInOfflineServers() { when(jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)).thenReturn(Arrays.asList("host0@-@0", "host0@-@1")); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.getJobNodeData(ShardingNode.getInstanceNode(0))).thenReturn("host0@-@0"); @@ -230,7 +230,7 @@ public void assertHasShardingInfoInOfflineServers() { } @Test - public void assertHasNotShardingInfoInOfflineServers() { + void assertHasNotShardingInfoInOfflineServers() { when(jobNodeStorage.getJobNodeChildrenKeys(InstanceNode.ROOT)).thenReturn(Arrays.asList("host0@-@0", "host0@-@1")); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); when(jobNodeStorage.getJobNodeData(ShardingNode.getInstanceNode(0))).thenReturn("host0@-@0"); @@ -240,12 +240,12 @@ public void assertHasNotShardingInfoInOfflineServers() { } @Test - public void assertGetCrashedShardingItemsWithNotEnableServer() { + void assertGetCrashedShardingItemsWithNotEnableServer() { assertThat(shardingService.getCrashedShardingItems("127.0.0.1@-@0"), is(Collections.emptyList())); } @Test - public void assertGetCrashedShardingItemsWithEnabledServer() { + void assertGetCrashedShardingItemsWithEnabledServer() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); when(serverService.isEnableServer("127.0.0.1")).thenReturn(true); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java index 874ef80dd0..a0dda8cf0c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java @@ -54,20 +54,20 @@ public BaseSnapshotServiceTest(final ElasticJob elasticJob) { } @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REG_CENTER.init(); } @BeforeEach - public final void setUp() { + void setUp() { REG_CENTER.init(); bootstrap.schedule(); } @AfterEach - public final void tearDown() { + void tearDown() { bootstrap.shutdown(); ReflectionUtils.setFieldValue(JobRegistry.getInstance(), "instance", null); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java index 551988fc36..6f3ea3b677 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java @@ -28,19 +28,19 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -public final class SnapshotServiceDisableTest extends BaseSnapshotServiceTest { +class SnapshotServiceDisableTest extends BaseSnapshotServiceTest { - public SnapshotServiceDisableTest() { + SnapshotServiceDisableTest() { super(new DetailedFooJob()); } @Test - public void assertMonitorWithDumpCommand() { + void assertMonitorWithDumpCommand() { assertThrows(IOException.class, () -> SocketUtils.sendCommand(SnapshotService.DUMP_COMMAND, DUMP_PORT - 1)); } @Test - public void assertPortInvalid() { + void assertPortInvalid() { assertThrows(IllegalArgumentException.class, () -> { SnapshotService snapshotService = new SnapshotService(getREG_CENTER(), -1); snapshotService.listen(); @@ -49,7 +49,7 @@ public void assertPortInvalid() { @Test @SneakyThrows - public void assertListenException() { + void assertListenException() { ServerSocket serverSocket = new ServerSocket(9898); SnapshotService snapshotService = new SnapshotService(getREG_CENTER(), 9898); snapshotService.listen(); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java index fc0035d788..33fdbf4a00 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java @@ -27,35 +27,35 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -public final class SnapshotServiceEnableTest extends BaseSnapshotServiceTest { +class SnapshotServiceEnableTest extends BaseSnapshotServiceTest { - public SnapshotServiceEnableTest() { + SnapshotServiceEnableTest() { super(new DetailedFooJob()); } @BeforeEach - public void listenMonitor() { + void listenMonitor() { getSnapshotService().listen(); } @AfterEach - public void closeMonitor() { + void closeMonitor() { getSnapshotService().close(); } @Test - public void assertMonitorWithCommand() throws IOException { + void assertMonitorWithCommand() throws IOException { assertNotNull(SocketUtils.sendCommand(SnapshotService.DUMP_COMMAND + getJobName(), DUMP_PORT)); assertEquals(SocketUtils.sendCommand("unknown_command", DUMP_PORT), ""); } @Test - public void assertDumpJobDirectly() { + void assertDumpJobDirectly() { assertNotNull(getSnapshotService().dumpJobDirectly(getJobName())); } @Test - public void assertDumpJob() throws IOException { + void assertDumpJob() throws IOException { assertNotNull(SnapshotService.dumpJob("127.0.0.1", DUMP_PORT, getJobName())); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java index fa2c17073b..07f7535cd5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java @@ -22,37 +22,37 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobNodePathTest { +class JobNodePathTest { private final JobNodePath jobNodePath = new JobNodePath("test_job"); @Test - public void assertGetFullPath() { + void assertGetFullPath() { assertThat(jobNodePath.getFullPath("node"), is("/test_job/node")); } @Test - public void assertGetServerNodePath() { + void assertGetServerNodePath() { assertThat(jobNodePath.getServerNodePath(), is("/test_job/servers")); } @Test - public void assertGetServerNodePathForServerIp() { + void assertGetServerNodePathForServerIp() { assertThat(jobNodePath.getServerNodePath("ip0"), is("/test_job/servers/ip0")); } @Test - public void assertGetShardingNodePath() { + void assertGetShardingNodePath() { assertThat(jobNodePath.getShardingNodePath(), is("/test_job/sharding")); } @Test - public void assertGetShardingNodePathWihItemAndNode() { + void assertGetShardingNodePathWihItemAndNode() { assertThat(jobNodePath.getShardingNodePath("0", "running"), is("/test_job/sharding/0/running")); } @Test - public void assertGetLeaderIpNodePath() { + void assertGetLeaderIpNodePath() { assertThat(jobNodePath.getLeaderHostNodePath(), is("/test_job/leader/election/instance")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java index 839a120f13..8383bc3af6 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class JobNodeStorageTest { +class JobNodeStorageTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -55,41 +55,41 @@ public final class JobNodeStorageTest { private JobNodeStorage jobNodeStorage; @BeforeEach - public void setUp() { + void setUp() { jobNodeStorage = new JobNodeStorage(regCenter, "test_job"); ReflectionUtils.setFieldValue(jobNodeStorage, "regCenter", regCenter); } @Test - public void assertIsJobNodeExisted() { + void assertIsJobNodeExisted() { when(regCenter.isExisted("/test_job/config")).thenReturn(true); assertTrue(jobNodeStorage.isJobNodeExisted("config")); verify(regCenter).isExisted("/test_job/config"); } @Test - public void assertGetJobNodeData() { + void assertGetJobNodeData() { when(regCenter.get("/test_job/config/cron")).thenReturn("0/1 * * * * ?"); assertThat(jobNodeStorage.getJobNodeData("config/cron"), is("0/1 * * * * ?")); verify(regCenter).get("/test_job/config/cron"); } @Test - public void assertGetJobNodeDataDirectly() { + void assertGetJobNodeDataDirectly() { when(regCenter.getDirectly("/test_job/config/cron")).thenReturn("0/1 * * * * ?"); assertThat(jobNodeStorage.getJobNodeDataDirectly("config/cron"), is("0/1 * * * * ?")); verify(regCenter).getDirectly("/test_job/config/cron"); } @Test - public void assertGetJobNodeChildrenKeys() { + void assertGetJobNodeChildrenKeys() { when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("host0", "host1")); assertThat(jobNodeStorage.getJobNodeChildrenKeys("servers"), is(Arrays.asList("host0", "host1"))); verify(regCenter).getChildrenKeys("/test_job/servers"); } @Test - public void assertCreateJobNodeIfNeeded() { + void assertCreateJobNodeIfNeeded() { when(regCenter.isExisted("/test_job")).thenReturn(true); when(regCenter.isExisted("/test_job/config")).thenReturn(false); jobNodeStorage.createJobNodeIfNeeded("config"); @@ -99,7 +99,7 @@ public void assertCreateJobNodeIfNeeded() { } @Test - public void assertCreateJobNodeIfRootJobNodeIsNotExist() { + void assertCreateJobNodeIfRootJobNodeIsNotExist() { when(regCenter.isExisted("/test_job")).thenReturn(false); jobNodeStorage.createJobNodeIfNeeded("config"); verify(regCenter).isExisted("/test_job"); @@ -108,7 +108,7 @@ public void assertCreateJobNodeIfRootJobNodeIsNotExist() { } @Test - public void assertCreateJobNodeIfNotNeeded() { + void assertCreateJobNodeIfNotNeeded() { when(regCenter.isExisted("/test_job")).thenReturn(true); when(regCenter.isExisted("/test_job/config")).thenReturn(true); jobNodeStorage.createJobNodeIfNeeded("config"); @@ -118,7 +118,7 @@ public void assertCreateJobNodeIfNotNeeded() { } @Test - public void assertRemoveJobNodeIfNeeded() { + void assertRemoveJobNodeIfNeeded() { when(regCenter.isExisted("/test_job/config")).thenReturn(true); jobNodeStorage.removeJobNodeIfExisted("config"); verify(regCenter).isExisted("/test_job/config"); @@ -126,7 +126,7 @@ public void assertRemoveJobNodeIfNeeded() { } @Test - public void assertRemoveJobNodeIfNotNeeded() { + void assertRemoveJobNodeIfNotNeeded() { when(regCenter.isExisted("/test_job/config")).thenReturn(false); jobNodeStorage.removeJobNodeIfExisted("config"); verify(regCenter).isExisted("/test_job/config"); @@ -134,37 +134,37 @@ public void assertRemoveJobNodeIfNotNeeded() { } @Test - public void assertFillJobNode() { + void assertFillJobNode() { jobNodeStorage.fillJobNode("config/cron", "0/1 * * * * ?"); verify(regCenter).persist("/test_job/config/cron", "0/1 * * * * ?"); } @Test - public void assertFillEphemeralJobNode() { + void assertFillEphemeralJobNode() { jobNodeStorage.fillEphemeralJobNode("config/cron", "0/1 * * * * ?"); verify(regCenter).persistEphemeral("/test_job/config/cron", "0/1 * * * * ?"); } @Test - public void assertUpdateJobNode() { + void assertUpdateJobNode() { jobNodeStorage.updateJobNode("config/cron", "0/1 * * * * ?"); verify(regCenter).update("/test_job/config/cron", "0/1 * * * * ?"); } @Test - public void assertReplaceJobNode() { + void assertReplaceJobNode() { jobNodeStorage.replaceJobNode("config/cron", "0/1 * * * * ?"); verify(regCenter).persist("/test_job/config/cron", "0/1 * * * * ?"); } @Test - public void assertExecuteInTransactionSuccess() throws Exception { + void assertExecuteInTransactionSuccess() throws Exception { jobNodeStorage.executeInTransaction(Collections.singletonList(TransactionOperation.opAdd("/test_transaction", ""))); verify(regCenter).executeInTransaction(any(List.class)); } @Test - public void assertExecuteInTransactionFailure() { + void assertExecuteInTransactionFailure() { assertThrows(RegException.class, () -> { doThrow(RuntimeException.class).when(regCenter).executeInTransaction(any(List.class)); jobNodeStorage.executeInTransaction(Collections.singletonList(TransactionOperation.opAdd("/test_transaction", ""))); @@ -172,14 +172,14 @@ public void assertExecuteInTransactionFailure() { } @Test - public void assertAddConnectionStateListener() { + void assertAddConnectionStateListener() { ConnectionStateChangedEventListener listener = mock(ConnectionStateChangedEventListener.class); jobNodeStorage.addConnectionStateListener(listener); verify(regCenter).addConnectionStateChangedEventListener("/test_job", listener); } @Test - public void assertAddDataListener() { + void assertAddDataListener() { DataChangedEventListener listener = mock(DataChangedEventListener.class); String jobName = "test_job"; ListenerNotifierManager.getInstance().registerJobNotifyExecutor(jobName); @@ -189,7 +189,7 @@ public void assertAddDataListener() { } @Test - public void assertGetRegistryCenterTime() { + void assertGetRegistryCenterTime() { when(regCenter.getRegistryCenterTime("/test_job/systemTime/current")).thenReturn(0L); assertThat(jobNodeStorage.getRegistryCenterTime(), is(0L)); verify(regCenter).getRegistryCenterTime("/test_job/systemTime/current"); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java index ec3bf90130..fc2769f53b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java @@ -35,7 +35,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class TriggerListenerManagerTest { +class TriggerListenerManagerTest { @Mock private CoordinatorRegistryCenter regCenter; @@ -52,7 +52,7 @@ public final class TriggerListenerManagerTest { private TriggerListenerManager triggerListenerManager; @BeforeEach - public void setUp() { + void setUp() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); triggerListenerManager = new TriggerListenerManager(null, "test_job"); ReflectionUtils.setFieldValue(triggerListenerManager, "triggerService", triggerService); @@ -60,32 +60,32 @@ public void setUp() { } @Test - public void assertStart() { + void assertStart() { triggerListenerManager.start(); verify(jobNodeStorage).addDataListener(ArgumentMatchers.any()); } @Test - public void assertNotTriggerWhenIsNotLocalInstancePath() { + void assertNotTriggerWhenIsNotLocalInstancePath() { triggerListenerManager.new JobTriggerStatusJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/trigger/127.0.0.2@-@0", "")); verify(triggerService, times(0)).removeTriggerFlag(); } @Test - public void assertNotTriggerWhenIsNotCreate() { + void assertNotTriggerWhenIsNotCreate() { triggerListenerManager.new JobTriggerStatusJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.UPDATED, "/test_job/trigger/127.0.0.1@-@0", "")); verify(triggerService, times(0)).removeTriggerFlag(); } @Test - public void assertTriggerWhenJobScheduleControllerIsNull() { + void assertTriggerWhenJobScheduleControllerIsNull() { triggerListenerManager.new JobTriggerStatusJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/trigger/127.0.0.1@-@0", "")); verify(triggerService).removeTriggerFlag(); verify(jobScheduleController, times(0)).triggerJob(); } @Test - public void assertTriggerWhenJobIsRunning() { + void assertTriggerWhenJobIsRunning() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); JobRegistry.getInstance().setJobRunning("test_job", true); @@ -97,7 +97,7 @@ public void assertTriggerWhenJobIsRunning() { } @Test - public void assertTriggerWhenJobIsNotRunning() { + void assertTriggerWhenJobIsNotRunning() { JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); triggerListenerManager.new JobTriggerStatusJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/trigger/127.0.0.1@-@0", "")); diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java index 42b494bc11..cc20f40761 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java +++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java @@ -25,16 +25,16 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class SensitiveInfoUtilsTest { +class SensitiveInfoUtilsTest { @Test - public void assertFilterContentWithoutIp() { + void assertFilterContentWithoutIp() { List actual = Arrays.asList("/simpleElasticDemoJob/servers", "/simpleElasticDemoJob/leader"); assertThat(SensitiveInfoUtils.filterSensitiveIps(actual), is(actual)); } @Test - public void assertFilterContentWithSensitiveIp() { + void assertFilterContentWithSensitiveIp() { List actual = Arrays.asList("/simpleElasticDemoJob/servers/127.0.0.1", "/simpleElasticDemoJob/servers/192.168.0.1/hostName | 192.168.0.1", "/simpleElasticDemoJob/servers/192.168.0.11", "/simpleElasticDemoJob/servers/192.168.0.111"); List expected = Arrays.asList("/simpleElasticDemoJob/servers/ip1", "/simpleElasticDemoJob/servers/ip2/hostName | ip2", diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java index 9a587e5449..500a5112f8 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java @@ -40,7 +40,7 @@ public abstract class AbstractEmbedZookeeperBaseTest { private static final Object INIT_LOCK = new Object(); @BeforeAll - public static void setUp() { + static void setUp() { startEmbedTestingServer(); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java index f80089be91..8b45d0d486 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java @@ -23,35 +23,35 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; -public final class JobAPIFactoryTest extends AbstractEmbedZookeeperBaseTest { +class JobAPIFactoryTest extends AbstractEmbedZookeeperBaseTest { @Test - public void assertCreateJobConfigAPI() { + void assertCreateJobConfigAPI() { assertThat(JobAPIFactory.createJobConfigurationAPI(getConnectionString(), "namespace", null), instanceOf(JobConfigurationAPI.class)); } @Test - public void assertCreateJobOperateAPI() { + void assertCreateJobOperateAPI() { assertThat(JobAPIFactory.createJobOperateAPI(getConnectionString(), "namespace", null), instanceOf(JobOperateAPI.class)); } @Test - public void assertCreateServerOperateAPI() { + void assertCreateServerOperateAPI() { assertThat(JobAPIFactory.createShardingOperateAPI(getConnectionString(), "namespace", null), instanceOf(ShardingOperateAPI.class)); } @Test - public void assertCreateJobStatisticsAPI() { + void assertCreateJobStatisticsAPI() { assertThat(JobAPIFactory.createJobStatisticsAPI(getConnectionString(), "namespace", null), instanceOf(JobStatisticsAPI.class)); } @Test - public void assertCreateServerStatisticsAPI() { + void assertCreateServerStatisticsAPI() { assertThat(JobAPIFactory.createServerStatisticsAPI(getConnectionString(), "namespace", null), instanceOf(ServerStatisticsAPI.class)); } @Test - public void assertCreateShardingStatisticsAPI() { + void assertCreateShardingStatisticsAPI() { assertThat(JobAPIFactory.createShardingStatisticsAPI(getConnectionString(), "namespace", null), instanceOf(ShardingStatisticsAPI.class)); } } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java index 3defc997b4..99dd3e909f 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java @@ -22,25 +22,25 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -public final class ShardingStatusTest { +class ShardingStatusTest { @Test - public void assertGetShardingStatusWhenIsDisabled() { + void assertGetShardingStatusWhenIsDisabled() { assertThat(ShardingInfo.ShardingStatus.getShardingStatus(true, false, true), is(ShardingInfo.ShardingStatus.DISABLED)); } @Test - public void assertGetShardingStatusWhenIsRunning() { + void assertGetShardingStatusWhenIsRunning() { assertThat(ShardingInfo.ShardingStatus.getShardingStatus(false, true, false), is(ShardingInfo.ShardingStatus.RUNNING)); } @Test - public void assertGetShardingStatusWhenIsPending() { + void assertGetShardingStatusWhenIsPending() { assertThat(ShardingInfo.ShardingStatus.getShardingStatus(false, false, false), is(ShardingInfo.ShardingStatus.PENDING)); } @Test - public void assertGetShardingStatusWhenIsShardingError() { + void assertGetShardingStatusWhenIsShardingError() { assertThat(ShardingInfo.ShardingStatus.getShardingStatus(false, false, true), is(ShardingInfo.ShardingStatus.SHARDING_FLAG)); } } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java index bbe1733957..379173e34d 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java @@ -34,7 +34,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class JobOperateAPIImplTest { +class JobOperateAPIImplTest { static final int DUMP_PORT = 9000; @@ -45,12 +45,12 @@ public final class JobOperateAPIImplTest { private CoordinatorRegistryCenter regCenter; @BeforeEach - public void setUp() { + void setUp() { jobOperateAPI = new JobOperateAPIImpl(regCenter); } @Test - public void assertTriggerWithJobName() { + void assertTriggerWithJobName() { when(regCenter.isExisted("/test_job")).thenReturn(true); when(regCenter.isExisted("/test_job/trigger/ip1@-@defaultInstance")).thenReturn(false); when(regCenter.isExisted("/test_job/trigger/ip2@-@defaultInstance")).thenReturn(false); @@ -62,13 +62,13 @@ public void assertTriggerWithJobName() { } @Test - public void assertDisableWithJobNameAndServerIp() { + void assertDisableWithJobNameAndServerIp() { jobOperateAPI.disable("test_job", "localhost"); verify(regCenter).persist("/test_job/servers/localhost", "DISABLED"); } @Test - public void assertDisableWithJobName() { + void assertDisableWithJobName() { when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("ip1", "ip2")); jobOperateAPI.disable("test_job", null); verify(regCenter).getChildrenKeys("/test_job/servers"); @@ -77,7 +77,7 @@ public void assertDisableWithJobName() { } @Test - public void assertDisableWithServerIp() { + void assertDisableWithServerIp() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job1", "test_job2")); when(regCenter.isExisted("/test_job1/servers/localhost")).thenReturn(true); when(regCenter.isExisted("/test_job2/servers/localhost")).thenReturn(true); @@ -88,13 +88,13 @@ public void assertDisableWithServerIp() { } @Test - public void assertEnableWithJobNameAndServerIp() { + void assertEnableWithJobNameAndServerIp() { jobOperateAPI.enable("test_job", "localhost"); verify(regCenter).persist("/test_job/servers/localhost", "ENABLED"); } @Test - public void assertEnableWithJobName() { + void assertEnableWithJobName() { when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("ip1", "ip2")); jobOperateAPI.enable("test_job", null); verify(regCenter).getChildrenKeys("/test_job/servers"); @@ -103,7 +103,7 @@ public void assertEnableWithJobName() { } @Test - public void assertEnableWithServerIp() { + void assertEnableWithServerIp() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job1", "test_job2")); when(regCenter.isExisted("/test_job1/servers/localhost")).thenReturn(true); when(regCenter.isExisted("/test_job2/servers/localhost")).thenReturn(true); @@ -114,7 +114,7 @@ public void assertEnableWithServerIp() { } @Test - public void assertShutdownWithJobNameAndServerIp() { + void assertShutdownWithJobNameAndServerIp() { when(regCenter.getChildrenKeys("/test_job/instances")).thenReturn(Collections.singletonList("localhost@-@defaultInstance")); when(regCenter.get("/test_job/instances/localhost@-@defaultInstance")).thenReturn("jobInstanceId: localhost@-@defaultInstance\nserverIp: localhost\n"); jobOperateAPI.shutdown("test_job", "localhost"); @@ -122,7 +122,7 @@ public void assertShutdownWithJobNameAndServerIp() { } @Test - public void assertShutdownWithJobName() { + void assertShutdownWithJobName() { when(regCenter.getChildrenKeys("/test_job/instances")).thenReturn(Arrays.asList("ip1@-@defaultInstance", "ip2@-@defaultInstance")); jobOperateAPI.shutdown("test_job", null); verify(regCenter).getChildrenKeys("/test_job/instances"); @@ -130,7 +130,7 @@ public void assertShutdownWithJobName() { } @Test - public void assertShutdownWithServerIp() { + void assertShutdownWithServerIp() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job1", "test_job2")); when(regCenter.getChildrenKeys("/test_job1/instances")).thenReturn(Collections.singletonList("localhost@-@defaultInstance")); when(regCenter.getChildrenKeys("/test_job2/instances")).thenReturn(Collections.singletonList("localhost@-@defaultInstance")); @@ -143,14 +143,14 @@ public void assertShutdownWithServerIp() { } @Test - public void assertRemoveWithJobNameAndServerIp() { + void assertRemoveWithJobNameAndServerIp() { jobOperateAPI.remove("test_job", "ip1"); verify(regCenter).remove("/test_job/servers/ip1"); assertFalse(regCenter.isExisted("/test_job/servers/ip1")); } @Test - public void assertRemoveWithJobName() { + void assertRemoveWithJobName() { when(regCenter.isExisted("/test_job")).thenReturn(true); when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("ip1", "ip2")); jobOperateAPI.remove("test_job", null); @@ -163,7 +163,7 @@ public void assertRemoveWithJobName() { } @Test - public void assertRemoveWithServerIp() { + void assertRemoveWithServerIp() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job1", "test_job2")); jobOperateAPI.remove(null, "ip1"); assertFalse(regCenter.isExisted("/test_job1/servers/ip1")); diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java index 53ef7d293f..a516b9fcac 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java @@ -28,7 +28,7 @@ import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -public final class ShardingOperateAPIImplTest { +class ShardingOperateAPIImplTest { private ShardingOperateAPI shardingOperateAPI; @@ -36,18 +36,18 @@ public final class ShardingOperateAPIImplTest { private CoordinatorRegistryCenter regCenter; @BeforeEach - public void setUp() { + void setUp() { shardingOperateAPI = new ShardingOperateAPIImpl(regCenter); } @Test - public void assertDisableSharding() { + void assertDisableSharding() { shardingOperateAPI.disable("test_job", "0"); verify(regCenter).persist("/test_job/sharding/0/disabled", ""); } @Test - public void assertEnableSharding() { + void assertEnableSharding() { shardingOperateAPI.enable("test_job", "0"); verify(regCenter).remove("/test_job/sharding/0/disabled"); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java index c4a4b10536..223a7cba7e 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java @@ -29,24 +29,24 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; -public final class RegistryCenterFactoryTest extends AbstractEmbedZookeeperBaseTest { +class RegistryCenterFactoryTest extends AbstractEmbedZookeeperBaseTest { @Test - public void assertCreateCoordinatorRegistryCenterWithoutDigest() throws ReflectiveOperationException { + void assertCreateCoordinatorRegistryCenterWithoutDigest() throws ReflectiveOperationException { ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "namespace", null)); assertThat(zkConfig.getNamespace(), is("namespace")); assertNull(zkConfig.getDigest()); } @Test - public void assertCreateCoordinatorRegistryCenterWithDigest() throws ReflectiveOperationException { + void assertCreateCoordinatorRegistryCenterWithDigest() throws ReflectiveOperationException { ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "namespace", "digest")); assertThat(zkConfig.getNamespace(), is("namespace")); assertThat(zkConfig.getDigest(), is("digest")); } @Test - public void assertCreateCoordinatorRegistryCenterFromCache() throws ReflectiveOperationException { + void assertCreateCoordinatorRegistryCenterFromCache() throws ReflectiveOperationException { RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "otherNamespace", null); ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "otherNamespace", null)); assertThat(zkConfig.getNamespace(), is("otherNamespace")); diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java index 704d490a09..65367010a8 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class JobConfigurationAPIImplTest { +class JobConfigurationAPIImplTest { private JobConfigurationAPI jobConfigAPI; @@ -47,12 +47,12 @@ public final class JobConfigurationAPIImplTest { private CoordinatorRegistryCenter regCenter; @BeforeEach - public void setUp() { + void setUp() { jobConfigAPI = new JobConfigurationAPIImpl(regCenter); } @Test - public void assertGetJobConfigNull() { + void assertGetJobConfigNull() { when(regCenter.get("/test_job/config")).thenReturn(null); JobConfigurationPOJO actual = jobConfigAPI.getJobConfiguration("test_job"); assertNull(actual); @@ -60,7 +60,7 @@ public void assertGetJobConfigNull() { } @Test - public void assertGetDataflowJobConfig() { + void assertGetDataflowJobConfig() { when(regCenter.get("/test_job/config")).thenReturn(LifecycleYamlConstants.getDataflowJobYaml()); JobConfigurationPOJO actual = jobConfigAPI.getJobConfiguration("test_job"); assertJobConfig(actual); @@ -69,7 +69,7 @@ public void assertGetDataflowJobConfig() { } @Test - public void assertGetScriptJobConfig() { + void assertGetScriptJobConfig() { when(regCenter.get("/test_job/config")).thenReturn(LifecycleYamlConstants.getScriptJobYaml()); JobConfigurationPOJO actual = jobConfigAPI.getJobConfiguration("test_job"); assertJobConfig(actual); @@ -93,7 +93,7 @@ private void assertJobConfig(final JobConfigurationPOJO pojo) { } @Test - public void assertUpdateJobConfig() { + void assertUpdateJobConfig() { JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); jobConfiguration.setJobName("test_job"); jobConfiguration.setCron("0/1 * * * * ?"); @@ -111,7 +111,7 @@ public void assertUpdateJobConfig() { } @Test - public void assertUpdateJobConfigIfJobNameIsEmpty() { + void assertUpdateJobConfigIfJobNameIsEmpty() { assertThrows(IllegalArgumentException.class, () -> { JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); jobConfiguration.setJobName(""); @@ -120,7 +120,7 @@ public void assertUpdateJobConfigIfJobNameIsEmpty() { } @Test - public void assertUpdateJobConfigIfCronIsEmpty() { + void assertUpdateJobConfigIfCronIsEmpty() { assertThrows(IllegalArgumentException.class, () -> { JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); jobConfiguration.setJobName("test_job"); @@ -130,7 +130,7 @@ public void assertUpdateJobConfigIfCronIsEmpty() { } @Test - public void assertUpdateJobConfigIfShardingTotalCountLessThanOne() { + void assertUpdateJobConfigIfShardingTotalCountLessThanOne() { assertThrows(IllegalArgumentException.class, () -> { JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); jobConfiguration.setJobName("test_job"); @@ -141,7 +141,7 @@ public void assertUpdateJobConfigIfShardingTotalCountLessThanOne() { } @Test - public void assertRemoveJobConfiguration() { + void assertRemoveJobConfiguration() { jobConfigAPI.removeJobConfiguration("test_job"); verify(regCenter).remove("/test_job"); } diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java index c5814ba569..f2aa7cb123 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java @@ -35,7 +35,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class JobStatisticsAPIImplTest { +class JobStatisticsAPIImplTest { private JobStatisticsAPI jobStatisticsAPI; @@ -44,18 +44,18 @@ public final class JobStatisticsAPIImplTest { private CoordinatorRegistryCenter regCenter; @BeforeEach - public void setUp() { + void setUp() { jobStatisticsAPI = new JobStatisticsAPIImpl(regCenter); } @Test - public void assertGetJobsTotalCount() { + void assertGetJobsTotalCount() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job_1", "test_job_2")); assertThat(jobStatisticsAPI.getJobsTotalCount(), is(2)); } @Test - public void assertGetOKJobBriefInfo() { + void assertGetOKJobBriefInfo() { when(regCenter.get("/test_job/config")).thenReturn(LifecycleYamlConstants.getSimpleJobYaml("test_job", "desc")); when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("ip1", "ip2")); when(regCenter.getChildrenKeys("/test_job/instances")).thenReturn(Arrays.asList("ip1@-@defaultInstance", "ip2@-@defaultInstance")); @@ -74,7 +74,7 @@ public void assertGetOKJobBriefInfo() { } @Test - public void assertGetOKJobBriefInfoWithPartialDisabledServer() { + void assertGetOKJobBriefInfoWithPartialDisabledServer() { when(regCenter.get("/test_job/config")).thenReturn(LifecycleYamlConstants.getSimpleJobYaml("test_job", "desc")); when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("ip1", "ip2")); when(regCenter.get("/test_job/servers/ip1")).thenReturn("DISABLED"); @@ -87,7 +87,7 @@ public void assertGetOKJobBriefInfoWithPartialDisabledServer() { } @Test - public void assertGetDisabledJobBriefInfo() { + void assertGetDisabledJobBriefInfo() { when(regCenter.get("/test_job/config")).thenReturn(LifecycleYamlConstants.getSimpleJobYaml("test_job", "desc")); when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("ip1", "ip2")); when(regCenter.get("/test_job/servers/ip1")).thenReturn("DISABLED"); @@ -98,7 +98,7 @@ public void assertGetDisabledJobBriefInfo() { } @Test - public void assertGetShardingErrorJobBriefInfo() { + void assertGetShardingErrorJobBriefInfo() { when(regCenter.get("/test_job/config")).thenReturn(LifecycleYamlConstants.getSimpleJobYaml("test_job", "desc")); when(regCenter.getChildrenKeys("/test_job/servers")).thenReturn(Arrays.asList("ip1", "ip2")); when(regCenter.getChildrenKeys("/test_job/instances")).thenReturn(Arrays.asList("ip1@-@defaultInstance", "ip2@-@defaultInstance")); @@ -111,20 +111,20 @@ public void assertGetShardingErrorJobBriefInfo() { } @Test - public void assertGetCrashedJobBriefInfo() { + void assertGetCrashedJobBriefInfo() { when(regCenter.get("/test_job/config")).thenReturn(LifecycleYamlConstants.getSimpleJobYaml("test_job", "desc")); JobBriefInfo jobBrief = jobStatisticsAPI.getJobBriefInfo("test_job"); assertThat(jobBrief.getStatus(), is(JobBriefInfo.JobStatus.CRASHED)); } @Test - public void assertGetAllJobsBriefInfoWithoutNamespace() { + void assertGetAllJobsBriefInfoWithoutNamespace() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job_1", "test_job_2")); assertThat(jobStatisticsAPI.getAllJobsBriefInfo().size(), is(0)); } @Test - public void assertGetAllJobsBriefInfo() { + void assertGetAllJobsBriefInfo() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job_1", "test_job_2")); when(regCenter.get("/test_job_1/config")).thenReturn(LifecycleYamlConstants.getSimpleJobYaml("test_job_1", "desc1")); when(regCenter.get("/test_job_2/config")).thenReturn(LifecycleYamlConstants.getSimpleJobYaml("test_job_2", "desc2")); @@ -151,7 +151,7 @@ public void assertGetAllJobsBriefInfo() { } @Test - public void assertGetJobsBriefInfoByIp() { + void assertGetJobsBriefInfoByIp() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job_1", "test_job_2", "test_job_3")); when(regCenter.isExisted("/test_job_1/servers/ip1")).thenReturn(true); when(regCenter.isExisted("/test_job_2/servers/ip1")).thenReturn(true); diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java index f56c2b6226..fdbddc3e5f 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java @@ -35,7 +35,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ServerStatisticsAPIImplTest { +class ServerStatisticsAPIImplTest { private ServerStatisticsAPI serverStatisticsAPI; @@ -43,12 +43,12 @@ public final class ServerStatisticsAPIImplTest { private CoordinatorRegistryCenter regCenter; @BeforeEach - public void setUp() { + void setUp() { serverStatisticsAPI = new ServerStatisticsAPIImpl(regCenter); } @Test - public void assertGetJobsTotalCount() { + void assertGetJobsTotalCount() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job_1", "test_job_2")); when(regCenter.getChildrenKeys("/test_job_1/servers")).thenReturn(Arrays.asList("ip1", "ip2")); when(regCenter.getChildrenKeys("/test_job_2/servers")).thenReturn(Arrays.asList("ip2", "ip3")); @@ -56,7 +56,7 @@ public void assertGetJobsTotalCount() { } @Test - public void assertGetAllServersBriefInfo() { + void assertGetAllServersBriefInfo() { when(regCenter.getChildrenKeys("/")).thenReturn(Arrays.asList("test_job1", "test_job2")); when(regCenter.getChildrenKeys("/test_job1/servers")).thenReturn(Arrays.asList("ip1", "ip2")); when(regCenter.getChildrenKeys("/test_job2/servers")).thenReturn(Arrays.asList("ip1", "ip2")); diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java index 7577e4d432..7388011c50 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java +++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java @@ -34,7 +34,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -public final class ShardingStatisticsAPIImplTest { +class ShardingStatisticsAPIImplTest { private ShardingStatisticsAPI shardingStatisticsAPI; @@ -43,12 +43,12 @@ public final class ShardingStatisticsAPIImplTest { private CoordinatorRegistryCenter regCenter; @BeforeEach - public void setUp() { + void setUp() { shardingStatisticsAPI = new ShardingStatisticsAPIImpl(regCenter); } @Test - public void assertGetShardingInfo() { + void assertGetShardingInfo() { when(regCenter.getChildrenKeys("/test_job/sharding")).thenReturn(Arrays.asList("0", "1", "2", "3")); when(regCenter.get("/test_job/sharding/0/instance")).thenReturn("ip1@-@1234"); when(regCenter.get("/test_job/sharding/1/instance")).thenReturn("ip2@-@2341"); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java index 0d037cdaf9..a886f0ea2e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java @@ -17,18 +17,19 @@ package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -import java.util.Collections; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.junit.jupiter.api.Test; -public final class ElasticJobConfigurationPropertiesTest { +import java.util.Collections; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class ElasticJobConfigurationPropertiesTest { @Test - public void assertToJobConfiguration() { + void assertToJobConfiguration() { ElasticJobConfigurationProperties properties = new ElasticJobConfigurationProperties(); properties.setElasticJobClass(ElasticJob.class); properties.setElasticJobType("jobType"); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java index 50b62e8d90..6eceee06dd 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -39,19 +39,19 @@ @SpringBootTest @ActiveProfiles("elasticjob") @ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl") -public class ElasticJobSpringBootScannerTest { +class ElasticJobSpringBootScannerTest { @Autowired private ApplicationContext applicationContext; @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); AnnotationCustomJob.reset(); } @Test - public void assertDefaultBeanNameWithTypeJob() { + void assertDefaultBeanNameWithTypeJob() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(AnnotationCustomJob.isCompleted(), is(true))); assertTrue(AnnotationCustomJob.isCompleted()); assertNotNull(applicationContext); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java index 27f78cb91c..1c6a51f731 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java @@ -59,18 +59,18 @@ @SpringBootTest @SpringBootApplication @ActiveProfiles("elasticjob") -public class ElasticJobSpringBootTest { +class ElasticJobSpringBootTest { @Autowired private ApplicationContext applicationContext; @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); } @Test - public void assertZookeeperProperties() { + void assertZookeeperProperties() { assertNotNull(applicationContext); ZookeeperProperties actual = applicationContext.getBean(ZookeeperProperties.class); assertThat(actual.getServerLists(), is(EmbedTestingServer.getConnectionString())); @@ -78,7 +78,7 @@ public void assertZookeeperProperties() { } @Test - public void assertRegistryCenterCreation() { + void assertRegistryCenterCreation() { assertNotNull(applicationContext); ZookeeperRegistryCenter zookeeperRegistryCenter = applicationContext.getBean(ZookeeperRegistryCenter.class); assertNotNull(zookeeperRegistryCenter); @@ -87,7 +87,7 @@ public void assertRegistryCenterCreation() { } @Test - public void assertTracingConfigurationCreation() throws SQLException { + void assertTracingConfigurationCreation() throws SQLException { assertNotNull(applicationContext); TracingConfiguration tracingConfig = applicationContext.getBean(TracingConfiguration.class); assertNotNull(tracingConfig); @@ -98,7 +98,7 @@ public void assertTracingConfigurationCreation() throws SQLException { } @Test - public void assertTracingProperties() { + void assertTracingProperties() { assertNotNull(applicationContext); TracingProperties tracingProperties = applicationContext.getBean(TracingProperties.class); assertNotNull(tracingProperties); @@ -109,7 +109,7 @@ public void assertTracingProperties() { } @Test - public void assertElasticJobProperties() { + void assertElasticJobProperties() { assertNotNull(applicationContext); ElasticJobProperties elasticJobProperties = applicationContext.getBean(ElasticJobProperties.class); assertNotNull(elasticJobProperties); @@ -135,7 +135,7 @@ public void assertElasticJobProperties() { } @Test - public void assertJobScheduleCreation() { + void assertJobScheduleCreation() { Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> { assertNotNull(applicationContext); Map elasticJobBeans = applicationContext.getBeansOfType(ElasticJob.class); @@ -146,7 +146,7 @@ public void assertJobScheduleCreation() { } @Test - public void assertOneOffJobBootstrapBeanName() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + void assertOneOffJobBootstrapBeanName() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { assertNotNull(applicationContext); OneOffJobBootstrap customTestJobBootstrap = applicationContext.getBean("customTestJobBean", OneOffJobBootstrap.class); @@ -166,14 +166,14 @@ public void assertOneOffJobBootstrapBeanName() throws NoSuchFieldException, Secu } @Test - public void assertDefaultBeanNameWithClassJob() { + void assertDefaultBeanNameWithClassJob() { assertNotNull(applicationContext); assertNotNull(applicationContext.getBean("defaultBeanNameClassJobScheduleJobBootstrap", ScheduleJobBootstrap.class)); } @Test - public void assertDefaultBeanNameWithTypeJob() { + void assertDefaultBeanNameWithTypeJob() { assertNotNull(applicationContext); assertNotNull(applicationContext.getBean("defaultBeanNameTypeJobScheduleJobBootstrap", ScheduleJobBootstrap.class)); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java index 05d1f22324..08740cd844 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java @@ -17,16 +17,16 @@ package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.junit.jupiter.api.Test; -public final class ZookeeperPropertiesTest { +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +class ZookeeperPropertiesTest { @Test - public void assertToZookeeperConfiguration() { + void assertToZookeeperConfiguration() { ZookeeperProperties properties = new ZookeeperProperties(); properties.setServerLists("localhost:18181"); properties.setNamespace("test"); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java index 4220468167..1d267b5c19 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java @@ -32,18 +32,18 @@ @SpringBootTest @SpringBootApplication @ActiveProfiles("snapshot") -public class ElasticJobSnapshotServiceConfigurationTest { +class ElasticJobSnapshotServiceConfigurationTest { @Autowired private ApplicationContext applicationContext; @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); } @Test - public void assertSnapshotServiceConfiguration() { + void assertSnapshotServiceConfiguration() { assertNotNull(applicationContext); assertNotNull(applicationContext.getBean(SnapshotService.class)); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java index 489eb368d8..98c32dd087 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java @@ -38,18 +38,18 @@ @SpringBootTest @SpringBootApplication @ActiveProfiles("tracing") -public class TracingConfigurationTest { +class TracingConfigurationTest { @Autowired private ApplicationContext applicationContext; @BeforeAll - public static void init() { + static void init() { EmbedTestingServer.start(); } @Test - public void assertNotRDBConfiguration() { + void assertNotRDBConfiguration() { assertNotNull(applicationContext); assertFalse(applicationContext.containsBean("tracingDataSource")); ObjectProvider provider = applicationContext.getBeanProvider(ResolvableType.forClassWithGenerics(TracingConfiguration.class, DataSource.class)); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java index 315be983cc..4ba75a964d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java @@ -17,16 +17,16 @@ package org.apache.shardingsphere.elasticjob.lite.spring.core.setup; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; - import org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProviderFactory; import org.junit.jupiter.api.Test; -public final class JobClassNameProviderFactoryTest { +import static org.hamcrest.CoreMatchers.instanceOf; +import static org.hamcrest.MatcherAssert.assertThat; + +class JobClassNameProviderFactoryTest { @Test - public void assertGetStrategy() { + void assertGetStrategy() { assertThat(JobClassNameProviderFactory.getProvider(), instanceOf(SpringProxyJobClassNameProvider.class)); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java index 8477180208..68b411779a 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java @@ -27,10 +27,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -public final class AopTargetUtilsTest { +class AopTargetUtilsTest { @Test - public void assertJdkDynamicProxyForGetTarget() { + void assertJdkDynamicProxyForGetTarget() { ElasticJob target = new TargetJob(); ProxyFactory pf = new ProxyFactory(target); pf.addInterface(ElasticJob.class); @@ -40,7 +40,7 @@ public void assertJdkDynamicProxyForGetTarget() { } @Test - public void assertCglibProxyForGetTarget() { + void assertCglibProxyForGetTarget() { ElasticJob target = new TargetJob(); ProxyFactory pf = new ProxyFactory(target); pf.setProxyTargetClass(true); @@ -50,7 +50,7 @@ public void assertCglibProxyForGetTarget() { } @Test - public void assertNoneProxyForGetTarget() { + void assertNoneProxyForGetTarget() { ElasticJob proxy = new TargetJob(); assertFalse(AopUtils.isAopProxy(proxy)); assertThat(AopTargetUtils.getTarget(proxy), is(proxy)); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/TargetJob.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/TargetJob.java index 9db5749936..d563b10463 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/TargetJob.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/TargetJob.java @@ -28,6 +28,5 @@ public class TargetJob implements ElasticJob { * @param shardingContext shardingContext */ public void execute(final ShardingContext shardingContext) { - } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java index c463002d6c..a4d4cc0e59 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -47,19 +47,19 @@ public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJU @BeforeEach @AfterEach - public void reset() { + void reset() { FooSimpleElasticJob.reset(); DataflowElasticJob.reset(); } @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); JobRegistry.getInstance().shutdown(throughputDataflowJobName); } @Test - public void assertSpringJobBean() { + void assertSpringJobBean() { assertSimpleElasticJobBean(); assertThroughputDataflowElasticJobBean(); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index d56c06c1ed..048a6d0399 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -52,19 +52,19 @@ public abstract class AbstractOneOffJobSpringIntegrateTest extends AbstractZooke @BeforeEach @AfterEach - public void reset() { + void reset() { FooSimpleElasticJob.reset(); DataflowElasticJob.reset(); } @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); JobRegistry.getInstance().shutdown(throughputDataflowJobName); } @Test - public void assertSpringJobBean() { + void assertSpringJobBean() { assertSimpleElasticJobBean(); assertThroughputDataflowElasticJobBean(); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java index eb8e67c505..5736f9bd05 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/withEventTraceRdb.xml") -public final class JobSpringNamespaceWithEventTraceRdbTest extends AbstractJobSpringIntegrateTest { +class JobSpringNamespaceWithEventTraceRdbTest extends AbstractJobSpringIntegrateTest { - public JobSpringNamespaceWithEventTraceRdbTest() { + JobSpringNamespaceWithEventTraceRdbTest() { super("simpleElasticJob_namespace_event_trace_rdb", "dataflowElasticJob_namespace_event_trace_rdb"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java index 27a405ab0c..a6337d6684 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/withJobHandler.xml") -public final class JobSpringNamespaceWithJobHandlerTest extends AbstractJobSpringIntegrateTest { +class JobSpringNamespaceWithJobHandlerTest extends AbstractJobSpringIntegrateTest { - public JobSpringNamespaceWithJobHandlerTest() { + JobSpringNamespaceWithJobHandlerTest() { super("simpleElasticJob_namespace_job_handler", "dataflowElasticJob_namespace_job_handler"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java index a0069afaf1..79268621b3 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/withListenerAndCglib.xml") -public final class JobSpringNamespaceWithListenerAndCglibTest extends AbstractJobSpringIntegrateTest { +class JobSpringNamespaceWithListenerAndCglibTest extends AbstractJobSpringIntegrateTest { - public JobSpringNamespaceWithListenerAndCglibTest() { + JobSpringNamespaceWithListenerAndCglibTest() { super("simpleElasticJob_namespace_listener_cglib", "dataflowElasticJob_namespace_listener_cglib"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java index 37dc9440b2..6d56e8c7d1 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/withListenerAndJdkDynamicProxy.xml") -public final class JobSpringNamespaceWithListenerAndJdkDynamicProxyTest extends AbstractJobSpringIntegrateTest { +class JobSpringNamespaceWithListenerAndJdkDynamicProxyTest extends AbstractJobSpringIntegrateTest { - public JobSpringNamespaceWithListenerAndJdkDynamicProxyTest() { + JobSpringNamespaceWithListenerAndJdkDynamicProxyTest() { super("simpleElasticJob_namespace_listener_jdk_proxy", "dataflowElasticJob_namespace_listener_jdk_proxy"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerTest.java index 304b8c6902..d1cf6cb007 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/withListener.xml") -public final class JobSpringNamespaceWithListenerTest extends AbstractJobSpringIntegrateTest { +class JobSpringNamespaceWithListenerTest extends AbstractJobSpringIntegrateTest { - public JobSpringNamespaceWithListenerTest() { + JobSpringNamespaceWithListenerTest() { super("simpleElasticJob_namespace_listener", "dataflowElasticJob_namespace_listener"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 3966032ed5..60f42adce4 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/withJobRef.xml") -public final class JobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class JobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String simpleJobName = "simpleElasticJob_job_ref"; @@ -44,17 +44,17 @@ public final class JobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJ @BeforeEach @AfterEach - public void reset() { + void reset() { RefFooSimpleElasticJob.reset(); } @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); } @Test - public void assertSpringJobBean() { + void assertSpringJobBean() { assertSimpleElasticJobBean(); } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index a868c3c329..6e6a9bfcd2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/withJobType.xml") -public final class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String scriptJobName = "scriptElasticJob_job_type"; @@ -46,13 +46,13 @@ public final class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnit private Scheduler scheduler; @AfterEach - public void tearDown() { + void tearDown() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(scheduler.getCurrentlyExecutingJobs().isEmpty(), is(true))); JobRegistry.getInstance().getJobScheduleController(scriptJobName).shutdown(); } @Test - public void jobScriptWithJobTypeTest() throws SchedulerException { + void jobScriptWithJobTypeTest() throws SchedulerException { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(regCenter.isExisted("/" + scriptJobName + "/sharding"), is(true))); scheduler = (Scheduler) ReflectionTestUtils.getField(JobRegistry.getInstance().getJobScheduleController(scriptJobName), "scheduler"); assertTrue(scheduler.isStarted()); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java index 5a61986242..7bea1a7f1a 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/withoutListener.xml") -public final class JobSpringNamespaceWithoutListenerTest extends AbstractJobSpringIntegrateTest { +class JobSpringNamespaceWithoutListenerTest extends AbstractJobSpringIntegrateTest { - public JobSpringNamespaceWithoutListenerTest() { + JobSpringNamespaceWithoutListenerTest() { super("simpleElasticJob_namespace", "dataflowElasticJob_namespace"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java index d562f9fdcd..8ca6c8bc24 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithEventTraceRdb.xml") -public final class OneOffJobSpringNamespaceWithEventTraceRdbTest extends AbstractOneOffJobSpringIntegrateTest { +class OneOffJobSpringNamespaceWithEventTraceRdbTest extends AbstractOneOffJobSpringIntegrateTest { - public OneOffJobSpringNamespaceWithEventTraceRdbTest() { + OneOffJobSpringNamespaceWithEventTraceRdbTest() { super("oneOffSimpleElasticJob_namespace_event_trace_rdb", "oneOffDataflowElasticJob_namespace_event_trace_rdb"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java index d8b64defa7..6bc59585b5 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobHandler.xml") -public final class OneOffJobSpringNamespaceWithJobHandlerTest extends AbstractOneOffJobSpringIntegrateTest { +class OneOffJobSpringNamespaceWithJobHandlerTest extends AbstractOneOffJobSpringIntegrateTest { - public OneOffJobSpringNamespaceWithJobHandlerTest() { + OneOffJobSpringNamespaceWithJobHandlerTest() { super("oneOffSimpleElasticJob_namespace_job_handler", "oneOffDataflowElasticJob_namespace_job_handler"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java index f876c452c7..d2cdbb655d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithListenerAndCglib.xml") -public final class OneOffJobSpringNamespaceWithListenerAndCglibTest extends AbstractOneOffJobSpringIntegrateTest { +class OneOffJobSpringNamespaceWithListenerAndCglibTest extends AbstractOneOffJobSpringIntegrateTest { - public OneOffJobSpringNamespaceWithListenerAndCglibTest() { + OneOffJobSpringNamespaceWithListenerAndCglibTest() { super("simpleElasticJob_namespace_listener_cglib", "dataflowElasticJob_namespace_listener_cglib"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java index fb83aa8bf4..783e0d3769 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml") -public final class OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest extends AbstractOneOffJobSpringIntegrateTest { +class OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest extends AbstractOneOffJobSpringIntegrateTest { - public OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest() { + OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest() { super("simpleElasticJob_namespace_listener_jdk_proxy", "dataflowElasticJob_namespace_listener_jdk_proxy"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java index 43ba1dfe83..d5c792dc7a 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithListener.xml") -public final class OneOffJobSpringNamespaceWithListenerTest extends AbstractOneOffJobSpringIntegrateTest { +class OneOffJobSpringNamespaceWithListenerTest extends AbstractOneOffJobSpringIntegrateTest { - public OneOffJobSpringNamespaceWithListenerTest() { + OneOffJobSpringNamespaceWithListenerTest() { super("simpleElasticJob_namespace_listener", "dataflowElasticJob_namespace_listener"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index 5c9119b085..c678eb7173 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -37,7 +37,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobRef.xml") -public final class OneOffJobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class OneOffJobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String oneOffSimpleJobName = "oneOffSimpleElasticJobRef"; @@ -49,17 +49,17 @@ public final class OneOffJobSpringNamespaceWithRefTest extends AbstractZookeeper @BeforeEach @AfterEach - public void reset() { + void reset() { RefFooSimpleElasticJob.reset(); } @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown(oneOffSimpleJobName); } @Test - public void assertSpringJobBean() { + void assertSpringJobBean() { OneOffJobBootstrap bootstrap = applicationContext.getBean(oneOffSimpleJobName, OneOffJobBootstrap.class); bootstrap.execute(); assertOneOffSimpleElasticJobBean(); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index 80b4dfca89..4078ae4e5f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobType.xml") -public final class OneOffJobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class OneOffJobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { private final String scriptJobName = "oneOffScriptElasticJob_job_type"; @@ -44,12 +44,12 @@ public final class OneOffJobSpringNamespaceWithTypeTest extends AbstractZookeepe private CoordinatorRegistryCenter regCenter; @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown(scriptJobName); } @Test - public void jobScriptWithJobTypeTest() { + void jobScriptWithJobTypeTest() { OneOffJobBootstrap bootstrap = applicationContext.getBean(scriptJobName, OneOffJobBootstrap.class); bootstrap.execute(); Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertTrue(regCenter.isExisted("/" + scriptJobName + "/sharding"))); diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java index 22fc966687..63a5063daa 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java @@ -20,9 +20,9 @@ import org.springframework.test.context.ContextConfiguration; @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithoutListener.xml") -public final class OneOffJobSpringNamespaceWithoutListenerTest extends AbstractOneOffJobSpringIntegrateTest { +class OneOffJobSpringNamespaceWithoutListenerTest extends AbstractOneOffJobSpringIntegrateTest { - public OneOffJobSpringNamespaceWithoutListenerTest() { + OneOffJobSpringNamespaceWithoutListenerTest() { super("oneOffSimpleElasticJob", "oneOffDataflowElasticJob"); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index cb430c0097..a25ed76a3f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -44,17 +44,17 @@ public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJU @BeforeEach @AfterEach - public void reset() { + void reset() { AnnotationSimpleJob.reset(); } @AfterEach - public void tearDown() { + void tearDown() { JobRegistry.getInstance().shutdown(simpleJobName); } @Test - public void assertSpringJobBean() { + void assertSpringJobBean() { assertSimpleElasticJobBean(); } @@ -63,5 +63,4 @@ private void assertSimpleElasticJobBean() { assertTrue(AnnotationSimpleJob.isCompleted()); assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding")); } - } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java index 3f8943f1ec..e8cac52388 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java @@ -27,10 +27,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; @ContextConfiguration(locations = "classpath:META-INF/snapshot/snapshotDisabled.xml") -public final class SnapshotSpringNamespaceDisableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class SnapshotSpringNamespaceDisableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { @Test - public void assertSnapshotDisable() { + void assertSnapshotDisable() { assertThrows(IOException.class, () -> SocketUtils.sendCommand(SnapshotService.DUMP_COMMAND, 9998)); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java index a1c94756ed..4c1bd1e954 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java @@ -26,10 +26,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; @ContextConfiguration(locations = "classpath:META-INF/snapshot/snapshotEnabled.xml") -public final class SnapshotSpringNamespaceEnableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class SnapshotSpringNamespaceEnableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { @Test - public void assertSnapshotEnable() throws IOException { + void assertSnapshotEnable() throws IOException { assertNull(SocketUtils.sendCommand("unknown_command", 9988)); } } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java index 108415a2ae..d78924878d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java @@ -28,8 +28,6 @@ * @see org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests */ @ExtendWith(SpringExtension.class) -@TestExecutionListeners(listeners = {EmbedZookeeperTestExecutionListener.class}, - inheritListeners = false, - mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS) +@TestExecutionListeners(listeners = EmbedZookeeperTestExecutionListener.class, inheritListeners = false, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS) public abstract class AbstractZookeeperJUnitJupiterSpringContextTests { } diff --git a/pom.xml b/pom.xml index ddaa658283..ac37770234 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ 0.15 2.22.1 - 3.1.0 + 3.2.1 3.0.2 3.20.0 4.3.0 @@ -624,7 +624,7 @@ maven-checkstyle-plugin ${maven-checkstyle-plugin.version} - src/resources/checkstyle_ci.xml + src/resources/checkstyle.xml true diff --git a/src/resources/checkstyle.xml b/src/resources/checkstyle.xml index 00242136f7..7ee07e534f 100644 --- a/src/resources/checkstyle.xml +++ b/src/resources/checkstyle.xml @@ -17,244 +17,297 @@ --> - - - - + + + + + + - + - + + + + + + - - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + - - - - + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/checkstyle_ci.xml b/src/resources/checkstyle_ci.xml deleted file mode 100644 index 326987419b..0000000000 --- a/src/resources/checkstyle_ci.xml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 384ae0ca381264e53e2f49bedfc301c22e435aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 09:48:34 +0800 Subject: [PATCH 040/178] Refactor : refactor the example version to 3.0.4 --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index da24a0c1d5..f9dc6511a2 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -38,7 +38,7 @@ - 3.0.3 + 3.0.4 1.8 5.1.0 4.3.4.RELEASE From 12ea2276d9e649aa93231182f8a8ab5f2b29e886 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 14 Oct 2023 16:03:19 +0800 Subject: [PATCH 041/178] Fix javadoc (#2281) --- .../annotation/ElasticJobConfiguration.java | 58 +++++++++++++------ .../elasticjob/annotation/ElasticJobProp.java | 2 + .../api/JobExtraConfigurationFactory.java | 5 +- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java index 8e4115a8d7..7526c8c38a 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java @@ -17,12 +17,13 @@ package org.apache.shardingsphere.elasticjob.annotation; +import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; + import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; /** * The annotation that specify a job of elastic. @@ -34,126 +35,147 @@ /** * Job name. - * @return jobName + * + * @return job name */ String jobName(); /** * CRON expression, control the job trigger time. + * * @return cron */ String cron() default ""; /** * Time zone of CRON. - * @return timeZone + * + * @return time zone */ String timeZone() default ""; /** - * registry center name. - * @return registryCenter + * Registry center name. + * + * @return registry center */ String registryCenter() default ""; /** * Sharding total count. - * @return shardingTotalCount + * + * @return sharding total count */ int shardingTotalCount(); /** * Sharding item parameters. - * @return shardingItemParameters + * + * @return sharding item parameters */ String shardingItemParameters() default ""; /** * Job parameter. - * @return jobParameter + * + * @return job parameter */ String jobParameter() default ""; /** * Monitor job execution status. - * @return monitorExecution + * + * @return monitor execution */ boolean monitorExecution() default true; /** * Enable or disable job failover. + * * @return failover */ boolean failover() default false; /** * Enable or disable the missed task to re-execute. + * * @return misfire */ boolean misfire() default true; /** * The maximum value for time difference between server and registry center in seconds. - * @return maxTimeDiffSeconds + * + * @return max time diff seconds */ int maxTimeDiffSeconds() default -1; /** * Service scheduling interval in minutes for repairing job server inconsistent state. - * @return reconcileIntervalMinutes + * + * @return reconcile interval minutes */ int reconcileIntervalMinutes() default 10; /** * Job sharding strategy type. - * @return jobShardingStrategyType + * + * @return job sharding strategy type */ String jobShardingStrategyType() default ""; /** * Job thread pool handler type. - * @return jobExecutorServiceHandlerType + * + * @return job executor service handler type */ String jobExecutorServiceHandlerType() default ""; /** * Job thread pool handler type. - * @return jobErrorHandlerType + * + * @return job error handler type */ String jobErrorHandlerType() default ""; /** * Job listener types. - * @return jobListenerTypes + * + * @return job listener types */ String[] jobListenerTypes() default {}; /** - * extra configurations. - * @return extraConfigurations + * Extra configurations. + * + * @return extra configurations */ Class[] extraConfigurations() default {}; /** * Job description. + * * @return description */ String description() default ""; /** * Job properties. - * @return props + * + * @return properties */ ElasticJobProp[] props() default {}; /** * Enable or disable start the job. + * * @return disabled */ boolean disabled() default false; /** * Enable or disable local configuration override registry center configuration. + * * @return overwrite */ boolean overwrite() default false; diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java index aa0d7904e4..099154415b 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java @@ -30,12 +30,14 @@ /** * Prop key. + * * @return key */ String key(); /** * Prop value. + * * @return value */ String value() default ""; diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java index b6cbfa15f7..fa595f863d 100644 --- a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java +++ b/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java @@ -25,8 +25,9 @@ public interface JobExtraConfigurationFactory { /** - * Get JobExtraConfiguration. - * @return JobExtraConfiguration + * Get job extra configuration. + * + * @return job extra configuration */ Optional getJobExtraConfiguration(); } From 680533dfac742b8aa619a8c5c664eb20d41d1d7b Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 14 Oct 2023 16:06:14 +0800 Subject: [PATCH 042/178] Update gitignore (#2282) --- .gitignore | 26 +++++++++++++++++++++++++- docs/.hugo_build.lock | 0 2 files changed, 25 insertions(+), 1 deletion(-) delete mode 100644 docs/.hugo_build.lock diff --git a/.gitignore b/.gitignore index 9b1aadace7..2e467661c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,40 @@ # maven ignore target/ +*.class *.jar *.war *.zip *.tar +*.tar.gz +dependency-reduced-pom.xml .flattened-pom.xml +pom.xml.versionsBackup + +# maven plugin ignore +release.properties +*.gpg # eclipse ignore .settings/ .project .classpath +.factorypath # idea ignore .idea/ +!/.idea/icon.png *.ipr *.iml *.iws +# vscode ignore +.vscode/ + # temp ignore logs/ -*.doc *.log +*.tlog +*.doc *.cache *.diff *.patch @@ -30,4 +44,14 @@ logs/ .DS_Store Thumbs.db +# antlr ignore +gen/ +*.tokens + +# profiler ignore +.profiler/ + +# hugo ignore public/ +.hugo_build.lock +*.html-e diff --git a/docs/.hugo_build.lock b/docs/.hugo_build.lock deleted file mode 100644 index e69de29bb2..0000000000 From 977e1ecc821bde3c9b8d770c9dd89e20d78878b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 17:15:59 +0800 Subject: [PATCH 043/178] Add : add check profile (#2283) * Add : add check profile * Add : add check profile * Add : add back the removed plugins * Add : add back the removed plugins --- pom.xml | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/pom.xml b/pom.xml index ac37770234..526b51de2d 100644 --- a/pom.xml +++ b/pom.xml @@ -874,6 +874,138 @@ + + check + + + + org.apache.rat + apache-rat-plugin + ${apache-rat-plugin.version} + + + **/target/** + **/logs/** + **/*.log + + **/*.iml + **/.idea/** + **/*.classpath + **/.project + **/.settings/** + **/dependency-reduced-pom.xml + + **/.gitignore + **/.gitmodules + **/.git/** + + **/.travis.yml + **/.mvn/jvm.config + **/.mvn/wrapper/maven-wrapper.properties + + **/.github/** + + **/*.md + **/*.MD + **/*.txt + **/docs/** + + **/.babelrc + **/.editorconfig + **/.eslintignore + **/package.json + **/assets/** + **/dist/** + **/etc/** + **/node/** + **/node_modules/** + **/test/coverage/** + **/package-lock.json + + /examples/** + + **/AdminLTE/** + **/bootstrap/** + **/bootstrap-table/** + **/daterangepicker/** + **/font-awesome-4.5.0/** + **/input-mask/** + **/finput-mask/** + **/jquery/** + **/jQuery/** + **/highcharts/** + + + + + + check + + verify + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven-checkstyle-plugin.version} + + src/resources/checkstyle.xml + true + + + + validate + + check + + validate + + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless-maven-plugin.version} + + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/java.xml + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/copyright.txt + + + + + UTF-8 + 4 + true + true + false + true + false + false + custom_1 + false + false + + + Leading blank line + --> + <project + --> + + <project + + + + + + + From 1b253356b5131a37d0afc46f269e4e7265da2756 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 14 Oct 2023 17:26:59 +0800 Subject: [PATCH 044/178] Refactor pom for dependency (#2284) --- elasticjob-api/pom.xml | 12 ------------ elasticjob-cloud/elasticjob-cloud-common/pom.xml | 9 --------- elasticjob-cloud/elasticjob-cloud-executor/pom.xml | 4 ---- elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml | 8 -------- .../elasticjob-cloud-scheduler-distribution/pom.xml | 4 ---- .../elasticjob-error-handler-dingtalk/pom.xml | 4 ---- .../elasticjob-error-handler-email/pom.xml | 4 ---- .../elasticjob-error-handler-general/pom.xml | 5 ----- .../elasticjob-error-handler-wechat/pom.xml | 4 ---- .../elasticjob-executor-kernel/pom.xml | 5 ----- .../elasticjob-http-executor/pom.xml | 6 ------ .../elasticjob-executor-type/pom.xml | 7 ------- .../elasticjob-tracing-api/pom.xml | 9 --------- .../elasticjob-tracing-rdb/pom.xml | 5 ----- elasticjob-infra/elasticjob-infra-common/pom.xml | 9 --------- .../elasticjob-registry-center-api/pom.xml | 5 +---- .../pom.xml | 6 ------ elasticjob-infra/elasticjob-registry-center/pom.xml | 1 - elasticjob-infra/elasticjob-restful/pom.xml | 8 ++------ elasticjob-lite/elasticjob-lite-core/pom.xml | 5 ----- elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 4 ---- .../elasticjob-lite-spring-boot-starter/pom.xml | 6 ------ .../elasticjob-lite-spring-core/pom.xml | 4 ---- .../elasticjob-lite-spring-namespace/pom.xml | 4 ---- pom.xml | 10 ++++++++++ 25 files changed, 13 insertions(+), 135 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index d9b5a29c63..e36f819104 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -25,16 +25,4 @@ elasticjob-api ${project.artifactId} - - - - com.google.guava - guava - - - - org.projectlombok - lombok - - diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index 2b5eb46e0f..37c515c1ca 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -68,10 +68,6 @@ ${project.parent.version} - - com.google.guava - guava - com.google.code.gson gson @@ -93,11 +89,6 @@ slf4j-api - - org.projectlombok - lombok - - org.apache.curator curator-test diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index f1d8ccb39e..7111432cd7 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -46,10 +46,6 @@ commons-dbcp2 - - org.projectlombok - lombok - com.h2database h2 diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index 0ca4665684..7dc994fc36 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -58,10 +58,6 @@ commons-codec commons-codec - - com.google.guava - guava - org.apache.mesos mesos @@ -90,10 +86,6 @@ ch.qos.logback logback-classic - - org.projectlombok - lombok - org.apache.curator curator-test diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index 978cb225ce..c0eb161d3f 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -80,10 +80,6 @@ commons-codec commons-codec - - com.google.guava - guava - org.apache.mesos mesos diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index bcb712c4b9..f925e4664a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -43,10 +43,6 @@ test - - org.projectlombok - lombok - org.slf4j slf4j-api diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index 7da18a0949..22f36be9f1 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -36,10 +36,6 @@ elasticjob-error-handler-general ${project.parent.version} - - org.projectlombok - lombok - org.slf4j slf4j-api diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 1f823ad4e9..f3cf22792d 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -42,11 +42,6 @@ slf4j-api - - org.projectlombok - lombok - - ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index 5ee5fdd34e..46a8696620 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -43,10 +43,6 @@ test - - org.projectlombok - lombok - org.slf4j slf4j-api diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index 4e75e64214..07c9570179 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -48,11 +48,6 @@ ${project.parent.version} - - org.projectlombok - lombok - - ch.qos.logback logback-classic diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index 43dd477f17..ceba1b6ca5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -40,12 +40,6 @@ test - - org.projectlombok - lombok - provided - - org.slf4j slf4j-jdk14 diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index bf34d52d97..7ba4b49302 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -33,11 +33,4 @@ elasticjob-script-executor elasticjob-http-executor - - - - org.projectlombok - lombok - - diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index f1745faebe..287846d289 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -42,21 +42,12 @@ org.apache.commons commons-lang3 - - com.google.guava - guava - org.slf4j slf4j-api ${slf4j.version} - - org.projectlombok - lombok - - org.slf4j jcl-over-slf4j diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index c9ff6ba2dd..dd4d492c7f 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -33,11 +33,6 @@ ${project.parent.version} - - org.projectlombok - lombok - - org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 4314358467..518a2556bf 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -33,10 +33,6 @@ ${project.parent.version} - - com.google.guava - guava - org.apache.commons commons-lang3 @@ -55,11 +51,6 @@ ${slf4j.version} - - org.projectlombok - lombok - - org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index e89073a229..e92a2ce428 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -31,10 +31,7 @@ org.slf4j slf4j-api - - org.projectlombok - lombok - + org.slf4j jcl-over-slf4j diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index 8685723b4a..e0176829a1 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -46,11 +46,6 @@ curator-recipes - - org.projectlombok - lombok - - org.apache.curator curator-test @@ -71,5 +66,4 @@ test - diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index 953f4f0c7b..a5b3b513d5 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -31,5 +31,4 @@ elasticjob-registry-center-api elasticjob-regitry-center-provider - diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index d1a49c7101..3a15d0ddc3 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -23,7 +23,6 @@ elasticjob-infra 3.1.0-SNAPSHOT - elasticjob-restful ${project.artifactId} @@ -33,15 +32,11 @@ elasticjob-infra-common ${project.parent.version} + io.netty netty-codec-http - - org.projectlombok - lombok - provided - org.slf4j slf4j-jdk14 @@ -60,6 +55,7 @@ netty-transport + diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index dc30809ede..63085747c5 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -90,11 +90,6 @@ quartz - - org.projectlombok - lombok - - org.apache.curator curator-test diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index 4ed6e1c08d..851d254315 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -39,10 +39,6 @@ provided - - org.projectlombok - lombok - commons-codec commons-codec diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index c38fc92841..0a953fbd01 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -47,12 +47,6 @@ true - - org.projectlombok - lombok - true - - org.springframework.boot spring-boot-starter-test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index ecc22a6fcd..e26680449f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -52,10 +52,6 @@ - - org.projectlombok - lombok - org.springframework spring-test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index be017f866c..3ccecc9151 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -67,10 +67,6 @@ provided - - org.projectlombok - lombok - org.apache.curator curator-test diff --git a/pom.xml b/pom.xml index 526b51de2d..58732876f3 100644 --- a/pom.xml +++ b/pom.xml @@ -362,6 +362,16 @@ + + com.google.guava + guava + + + + org.projectlombok + lombok + + org.junit.jupiter junit-jupiter From 310a783769912e7cbcfc506f0bb502d5a78d272c Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 14 Oct 2023 18:09:37 +0800 Subject: [PATCH 045/178] Refactor pom for dependency (#2285) --- pom.xml | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index 58732876f3..ceed3d98da 100644 --- a/pom.xml +++ b/pom.xml @@ -83,9 +83,9 @@ 5.10.0 2.2 - 1.14.8 4.11.0 4.2.0 + 1.14.8 3.2.1 @@ -152,6 +152,11 @@ + + org.apache.zookeeper + zookeeper + ${zookeeper.version} + org.apache.curator curator-framework @@ -305,12 +310,6 @@ ${aspectj.version} test - - org.awaitility - awaitility - ${awaitility.version} - test - org.junit junit-bom @@ -319,15 +318,9 @@ import - net.bytebuddy - byte-buddy - ${bytebuddy.version} - test - - - net.bytebuddy - byte-buddy-agent - ${bytebuddy.version} + org.awaitility + awaitility + ${awaitility.version} test @@ -348,15 +341,16 @@ - org.mockito - mockito-inline - ${mockito.version} + net.bytebuddy + byte-buddy + ${bytebuddy.version} test - org.apache.zookeeper - zookeeper - ${zookeeper.version} + net.bytebuddy + byte-buddy-agent + ${bytebuddy.version} + test From 045858a39df2abcc241c421704d1f7fb1de2e1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 18:33:43 +0800 Subject: [PATCH 046/178] Refactor check profile (#2286) * Fix : fix the spotless format * Refactor : seperate the plugins and plugs management --- pom.xml | 358 ++++++++++++++++++++------------------------------------ 1 file changed, 129 insertions(+), 229 deletions(-) diff --git a/pom.xml b/pom.xml index ceed3d98da..8c6b9c4e1f 100644 --- a/pom.xml +++ b/pom.xml @@ -360,7 +360,7 @@ com.google.guava guava - + org.projectlombok lombok @@ -583,64 +583,6 @@ - - com.diffplug.spotless - spotless-maven-plugin - ${spotless-maven-plugin.version} - - - - - ${maven.multiModuleProjectDirectory}/src/resources/spotless/java.xml - - - - ${maven.multiModuleProjectDirectory}/src/resources/spotless/copyright.txt - - - - - UTF-8 - 4 - true - true - false - true - false - false - custom_1 - false - false - - - Leading blank line - --> -<project - --> - -<project - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - ${maven-checkstyle-plugin.version} - - src/resources/checkstyle.xml - true - - - - validate - - check - - validate - - - org.eluder.coveralls coveralls-maven-plugin @@ -695,73 +637,6 @@ - - org.apache.rat - apache-rat-plugin - ${apache-rat-plugin.version} - - - **/target/** - **/logs/** - **/*.log - - **/*.iml - **/.idea/** - **/*.classpath - **/.project - **/.settings/** - **/dependency-reduced-pom.xml - - **/.gitignore - **/.gitmodules - **/.git/** - - **/.travis.yml - **/.mvn/jvm.config - **/.mvn/wrapper/maven-wrapper.properties - - **/.github/** - - **/*.md - **/*.MD - **/*.txt - **/docs/** - - **/.babelrc - **/.editorconfig - **/.eslintignore - **/package.json - **/assets/** - **/dist/** - **/etc/** - **/node/** - **/node_modules/** - **/test/coverage/** - **/package-lock.json - - /examples/** - - **/AdminLTE/** - **/bootstrap/** - **/bootstrap-table/** - **/daterangepicker/** - **/font-awesome-4.5.0/** - **/input-mask/** - **/finput-mask/** - **/jquery/** - **/jQuery/** - **/highcharts/** - - - - - - check - - verify - - - @@ -881,82 +756,135 @@ check + + + + org.apache.rat + apache-rat-plugin + ${apache-rat-plugin.version} + + + **/target/** + **/logs/** + **/*.log + + **/*.iml + **/.idea/** + **/*.classpath + **/.project + **/.settings/** + **/dependency-reduced-pom.xml + + **/.gitignore + **/.gitmodules + **/.git/** + + **/.travis.yml + **/.mvn/jvm.config + **/.mvn/wrapper/maven-wrapper.properties + + **/.github/** + + **/*.md + **/*.MD + **/*.txt + **/docs/** + + **/.babelrc + **/.editorconfig + **/.eslintignore + **/package.json + **/assets/** + **/dist/** + **/etc/** + **/node/** + **/node_modules/** + **/test/coverage/** + **/package-lock.json + + /examples/** + + **/AdminLTE/** + **/bootstrap/** + **/bootstrap-table/** + **/daterangepicker/** + **/font-awesome-4.5.0/** + **/input-mask/** + **/finput-mask/** + **/jquery/** + **/jQuery/** + **/highcharts/** + + + + + + check + + verify + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + ${maven-checkstyle-plugin.version} + + src/resources/checkstyle.xml + true + + + + com.diffplug.spotless + spotless-maven-plugin + ${spotless-maven-plugin.version} + + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/java.xml + + + + ${maven.multiModuleProjectDirectory}/src/resources/spotless/copyright.txt + + + + + UTF-8 + 4 + true + true + false + true + false + false + custom_1 + false + false + + + Leading blank line + --> +<project + --> + +<project + + + + + + org.apache.rat apache-rat-plugin - ${apache-rat-plugin.version} - - - **/target/** - **/logs/** - **/*.log - - **/*.iml - **/.idea/** - **/*.classpath - **/.project - **/.settings/** - **/dependency-reduced-pom.xml - - **/.gitignore - **/.gitmodules - **/.git/** - - **/.travis.yml - **/.mvn/jvm.config - **/.mvn/wrapper/maven-wrapper.properties - - **/.github/** - - **/*.md - **/*.MD - **/*.txt - **/docs/** - - **/.babelrc - **/.editorconfig - **/.eslintignore - **/package.json - **/assets/** - **/dist/** - **/etc/** - **/node/** - **/node_modules/** - **/test/coverage/** - **/package-lock.json - - /examples/** - - **/AdminLTE/** - **/bootstrap/** - **/bootstrap-table/** - **/daterangepicker/** - **/font-awesome-4.5.0/** - **/input-mask/** - **/finput-mask/** - **/jquery/** - **/jQuery/** - **/highcharts/** - - - - - - check - - verify - - org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} - - src/resources/checkstyle.xml - true - validate @@ -970,42 +898,14 @@ com.diffplug.spotless spotless-maven-plugin - ${spotless-maven-plugin.version} - - - - - ${maven.multiModuleProjectDirectory}/src/resources/spotless/java.xml - - - - ${maven.multiModuleProjectDirectory}/src/resources/spotless/copyright.txt - - - - - UTF-8 - 4 - true - true - false - true - false - false - custom_1 - false - false - - - Leading blank line - --> - <project - --> - - <project - - - + + + + apply + + compile + + From 4523d9e53343ee91b617f2c632a8e051ab91250e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 19:38:37 +0800 Subject: [PATCH 047/178] Add required check (#2287) * Refactor : refactor the workflow to apploy required check * Add : add branch limit * Refactor : remove uesless needs * Refactor : rename the job in workflow --- .github/workflows/maven.yml | 7 +++- .github/workflows/required-check.yml | 55 ++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/required-check.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 297d59517e..334e5ef59d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -46,9 +46,14 @@ jobs: with: distribution: 'temurin' java-version: ${{ matrix.java }} - - name: Build with Maven + - name: Build with Maven in Windows + if: matrix.os == 'windows-latest' run: | ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install + - name: Build with Maven in Linux or macOS + if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' + run: | + ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install -Pcheck - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.java == '8' uses: codecov/codecov-action@v3 diff --git a/.github/workflows/required-check.yml b/.github/workflows/required-check.yml new file mode 100644 index 0000000000..229dc8df41 --- /dev/null +++ b/.github/workflows/required-check.yml @@ -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. +# + +name: Required - Check + +on: + pull_request: + branches: [ master ] + workflow_dispatch: + +concurrency: + group: check-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check-checkstyle: + name: Check - CheckStyle + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - name: Run CheckStyle + run: ./mvnw checkstyle:check -Pcheck -T1C + + check-spotless: + name: Check - Spotless + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - name: Run Spotless + run: ./mvnw spotless:check -Pcheck -T1C + + check-license: + name: Check - License + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - name: Run Apache Rat + run: ./mvnw apache-rat:check -Pcheck -T1C From 2dc490a71934132e32194073f5f1538b4415bba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 20:27:57 +0800 Subject: [PATCH 048/178] Refactor : refactor the asf file to make required check mandatory (#2289) --- .asf.yaml | 7 +++++++ .github/workflows/maven.yml | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 55bc3fbd97..62adc25fe6 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -35,3 +35,10 @@ github: features: issues: true projects: true + protected_branches: + master: + required_status_checks: + contexts: + - Check - CheckStyle + - Check - Spotless + - Check - License diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 334e5ef59d..37e27cf8a2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,8 +21,6 @@ name: Java CI with Maven on: - push: - branches: [ master ] pull_request: branches: [ master ] From 86c21c988712dcdca7bd5c776d807ff70198563b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 21:34:42 +0800 Subject: [PATCH 049/178] [maven-release-plugin] prepare release 3.0.4 --- elasticjob-api/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-common/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-executor/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml | 2 +- elasticjob-cloud/pom.xml | 2 +- .../elasticjob-cloud-executor-distribution/pom.xml | 2 +- .../elasticjob-cloud-scheduler-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-lite-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-src-distribution/pom.xml | 2 +- elasticjob-distribution/pom.xml | 2 +- .../elasticjob-error-handler-spi/pom.xml | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 2 +- .../elasticjob-error-handler-email/pom.xml | 2 +- .../elasticjob-error-handler-general/pom.xml | 2 +- .../elasticjob-error-handler-wechat/pom.xml | 2 +- .../elasticjob-error-handler-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-error-handler/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-kernel/pom.xml | 2 +- .../elasticjob-dataflow-executor/pom.xml | 2 +- .../elasticjob-executor-type/elasticjob-http-executor/pom.xml | 2 +- .../elasticjob-script-executor/pom.xml | 2 +- .../elasticjob-simple-executor/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-executor/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-api/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-rdb/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-tracing/pom.xml | 2 +- elasticjob-ecosystem/pom.xml | 2 +- elasticjob-infra/elasticjob-infra-common/pom.xml | 2 +- .../elasticjob-registry-center-api/pom.xml | 2 +- .../elasticjob-registry-center-zookeeper-curator/pom.xml | 2 +- .../elasticjob-regitry-center-provider/pom.xml | 2 +- elasticjob-infra/elasticjob-registry-center/pom.xml | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 2 +- elasticjob-infra/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 2 +- .../elasticjob-lite-spring-boot-starter/pom.xml | 2 +- .../elasticjob-lite-spring-core/pom.xml | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-spring/pom.xml | 2 +- elasticjob-lite/pom.xml | 2 +- pom.xml | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index e36f819104..f08e76b41b 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-api ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index 37c515c1ca..a4368dfc32 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-common ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index 7111432cd7..cee6b03e2a 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-executor ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index 7dc994fc36..54d6eb9325 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-scheduler ${project.artifactId} diff --git a/elasticjob-cloud/pom.xml b/elasticjob-cloud/pom.xml index 0a44944cda..1e688af2c7 100644 --- a/elasticjob-cloud/pom.xml +++ b/elasticjob-cloud/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud pom diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index 8984517ce3..fe6fab4598 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-executor-distribution pom diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index c0eb161d3f..5e6e7fa5f4 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-scheduler-distribution pom diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index fa4034102b..a193504ddd 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-distribution pom diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index 5cdeb9c356..6e2c55c1f9 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-src-distribution pom diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index eba35b5202..3d770b37fd 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-distribution pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml index 42dff33886..6cfa3a2e1d 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-spi diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index f925e4664a..e99887b268 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-dingtalk diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index 22f36be9f1..bc4b952d89 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-email diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index f3cf22792d..6a3237691a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-general diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index 46a8696620..8c4e5db7ac 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-wechat diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml index 0fb1b6c4dd..c0676a520f 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-type pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml index e2a1ad3324..03e15bb3e9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler pom diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index 07c9570179..fb4df6ff7e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-executor-kernel ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml index ca7d15387b..ce3a30cd23 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-dataflow-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index ceba1b6ca5..fbad0b7f0a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-http-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml index 3ce051f9b5..b2b38a794d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-script-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml index 41933e3ba8..89c0e6317a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-simple-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index 7ba4b49302..bd2eddde8b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-executor-type pom diff --git a/elasticjob-ecosystem/elasticjob-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/pom.xml index e6a014877e..292ac87686 100644 --- a/elasticjob-ecosystem/elasticjob-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-executor pom diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index 287846d289..54d406377e 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-tracing-api ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index dd4d492c7f..5a36ef6572 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-tracing-rdb ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/pom.xml index cb3660a4e5..009ebae1a6 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-tracing pom diff --git a/elasticjob-ecosystem/pom.xml b/elasticjob-ecosystem/pom.xml index 8f9e1bfe73..e1aab4e471 100644 --- a/elasticjob-ecosystem/pom.xml +++ b/elasticjob-ecosystem/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-ecosystem pom diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 518a2556bf..f5b94a7f4b 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-infra-common ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index e92a2ce428..fd1947585d 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-registry-center-api ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index e0176829a1..d1983ebff0 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-regitry-center-provider - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-registry-center-zookeeper-curator ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index 932d59c8d2..52b8856e7f 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-regitry-center-provider pom diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index a5b3b513d5..6394450349 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-registry-center pom diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index 3a15d0ddc3..c2d08e8bf1 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-restful ${project.artifactId} diff --git a/elasticjob-infra/pom.xml b/elasticjob-infra/pom.xml index 0cc6395f77..be2b5cc181 100644 --- a/elasticjob-infra/pom.xml +++ b/elasticjob-infra/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-infra pom diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 63085747c5..d77bc1df43 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index 851d254315..7cf6867c86 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-lifecycle ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index 0a953fbd01..4e92b48f86 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring-boot-starter ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index e26680449f..3f6b1229c2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index 3ccecc9151..c7b8a43814 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring-namespace ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml index a90634102b..e5c9119494 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring pom diff --git a/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml index 025f6a9ec9..5a26bc553e 100644 --- a/elasticjob-lite/pom.xml +++ b/elasticjob-lite/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite pom diff --git a/pom.xml b/pom.xml index 8c6b9c4e1f..08ab069d38 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 pom Elastic Job Distributed scheduled job @@ -731,7 +731,7 @@ scm:git:https://github.com/apache/shardingsphere-elasticjob.git scm:git:https://github.com/apache/shardingsphere-elasticjob.git https://github.com/apache/shardingsphere-elasticjob.git - HEAD + 3.0.4 From fdcd0252c41cc13be70d5d1410ce7edf730f2577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 21:38:03 +0800 Subject: [PATCH 050/178] [maven-release-plugin] prepare for next development iteration --- elasticjob-api/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-common/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-executor/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml | 2 +- elasticjob-cloud/pom.xml | 2 +- .../elasticjob-cloud-executor-distribution/pom.xml | 2 +- .../elasticjob-cloud-scheduler-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-lite-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-src-distribution/pom.xml | 2 +- elasticjob-distribution/pom.xml | 2 +- .../elasticjob-error-handler-spi/pom.xml | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 2 +- .../elasticjob-error-handler-email/pom.xml | 2 +- .../elasticjob-error-handler-general/pom.xml | 2 +- .../elasticjob-error-handler-wechat/pom.xml | 2 +- .../elasticjob-error-handler-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-error-handler/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-kernel/pom.xml | 2 +- .../elasticjob-dataflow-executor/pom.xml | 2 +- .../elasticjob-executor-type/elasticjob-http-executor/pom.xml | 2 +- .../elasticjob-script-executor/pom.xml | 2 +- .../elasticjob-simple-executor/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-executor/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-api/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-rdb/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-tracing/pom.xml | 2 +- elasticjob-ecosystem/pom.xml | 2 +- elasticjob-infra/elasticjob-infra-common/pom.xml | 2 +- .../elasticjob-registry-center-api/pom.xml | 2 +- .../elasticjob-registry-center-zookeeper-curator/pom.xml | 2 +- .../elasticjob-regitry-center-provider/pom.xml | 2 +- elasticjob-infra/elasticjob-registry-center/pom.xml | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 2 +- elasticjob-infra/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 2 +- .../elasticjob-lite-spring-boot-starter/pom.xml | 2 +- .../elasticjob-lite-spring-core/pom.xml | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-spring/pom.xml | 2 +- elasticjob-lite/pom.xml | 2 +- pom.xml | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index f08e76b41b..e36f819104 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-api ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index a4368dfc32..37c515c1ca 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-common ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index cee6b03e2a..7111432cd7 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-executor ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index 54d6eb9325..7dc994fc36 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-scheduler ${project.artifactId} diff --git a/elasticjob-cloud/pom.xml b/elasticjob-cloud/pom.xml index 1e688af2c7..0a44944cda 100644 --- a/elasticjob-cloud/pom.xml +++ b/elasticjob-cloud/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud pom diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index fe6fab4598..8984517ce3 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-executor-distribution pom diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index 5e6e7fa5f4..c0eb161d3f 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-scheduler-distribution pom diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index a193504ddd..fa4034102b 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-distribution pom diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index 6e2c55c1f9..5cdeb9c356 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-src-distribution pom diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index 3d770b37fd..eba35b5202 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-distribution pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml index 6cfa3a2e1d..42dff33886 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-spi diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index e99887b268..f925e4664a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-dingtalk diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index bc4b952d89..22f36be9f1 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-email diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 6a3237691a..f3cf22792d 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-general diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index 8c4e5db7ac..46a8696620 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-wechat diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml index c0676a520f..0fb1b6c4dd 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-type pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml index 03e15bb3e9..e2a1ad3324 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler pom diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index fb4df6ff7e..07c9570179 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-executor-kernel ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml index ce3a30cd23..ca7d15387b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-dataflow-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index fbad0b7f0a..ceba1b6ca5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-http-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml index b2b38a794d..3ce051f9b5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-script-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml index 89c0e6317a..41933e3ba8 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-simple-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index bd2eddde8b..7ba4b49302 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-executor-type pom diff --git a/elasticjob-ecosystem/elasticjob-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/pom.xml index 292ac87686..e6a014877e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-executor pom diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index 54d406377e..287846d289 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-tracing-api ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index 5a36ef6572..dd4d492c7f 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-tracing-rdb ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/pom.xml index 009ebae1a6..cb3660a4e5 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-tracing pom diff --git a/elasticjob-ecosystem/pom.xml b/elasticjob-ecosystem/pom.xml index e1aab4e471..8f9e1bfe73 100644 --- a/elasticjob-ecosystem/pom.xml +++ b/elasticjob-ecosystem/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-ecosystem pom diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index f5b94a7f4b..518a2556bf 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-infra-common ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index fd1947585d..e92a2ce428 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-registry-center-api ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index d1983ebff0..e0176829a1 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-regitry-center-provider - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-registry-center-zookeeper-curator ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index 52b8856e7f..932d59c8d2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-regitry-center-provider pom diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index 6394450349..a5b3b513d5 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-registry-center pom diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index c2d08e8bf1..3a15d0ddc3 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-restful ${project.artifactId} diff --git a/elasticjob-infra/pom.xml b/elasticjob-infra/pom.xml index be2b5cc181..0cc6395f77 100644 --- a/elasticjob-infra/pom.xml +++ b/elasticjob-infra/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-infra pom diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index d77bc1df43..63085747c5 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index 7cf6867c86..851d254315 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-lifecycle ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index 4e92b48f86..0a953fbd01 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring-boot-starter ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index 3f6b1229c2..e26680449f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index c7b8a43814..3ccecc9151 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring-namespace ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml index e5c9119494..a90634102b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring pom diff --git a/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml index 5a26bc553e..025f6a9ec9 100644 --- a/elasticjob-lite/pom.xml +++ b/elasticjob-lite/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite pom diff --git a/pom.xml b/pom.xml index 08ab069d38..8c6b9c4e1f 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT pom Elastic Job Distributed scheduled job @@ -731,7 +731,7 @@ scm:git:https://github.com/apache/shardingsphere-elasticjob.git scm:git:https://github.com/apache/shardingsphere-elasticjob.git https://github.com/apache/shardingsphere-elasticjob.git - 3.0.4 + HEAD From cc5693340e8554e25af04aa2309e5bede7bdf711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 21:52:17 +0800 Subject: [PATCH 051/178] [maven-release-plugin] prepare release 3.0.4 --- elasticjob-api/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-common/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-executor/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml | 2 +- elasticjob-cloud/pom.xml | 2 +- .../elasticjob-cloud-executor-distribution/pom.xml | 2 +- .../elasticjob-cloud-scheduler-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-lite-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-src-distribution/pom.xml | 2 +- elasticjob-distribution/pom.xml | 2 +- .../elasticjob-error-handler-spi/pom.xml | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 2 +- .../elasticjob-error-handler-email/pom.xml | 2 +- .../elasticjob-error-handler-general/pom.xml | 2 +- .../elasticjob-error-handler-wechat/pom.xml | 2 +- .../elasticjob-error-handler-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-error-handler/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-kernel/pom.xml | 2 +- .../elasticjob-dataflow-executor/pom.xml | 2 +- .../elasticjob-executor-type/elasticjob-http-executor/pom.xml | 2 +- .../elasticjob-script-executor/pom.xml | 2 +- .../elasticjob-simple-executor/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-executor/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-api/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-rdb/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-tracing/pom.xml | 2 +- elasticjob-ecosystem/pom.xml | 2 +- elasticjob-infra/elasticjob-infra-common/pom.xml | 2 +- .../elasticjob-registry-center-api/pom.xml | 2 +- .../elasticjob-registry-center-zookeeper-curator/pom.xml | 2 +- .../elasticjob-regitry-center-provider/pom.xml | 2 +- elasticjob-infra/elasticjob-registry-center/pom.xml | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 2 +- elasticjob-infra/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 2 +- .../elasticjob-lite-spring-boot-starter/pom.xml | 2 +- .../elasticjob-lite-spring-core/pom.xml | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-spring/pom.xml | 2 +- elasticjob-lite/pom.xml | 2 +- pom.xml | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index e36f819104..f08e76b41b 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-api ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index 37c515c1ca..a4368dfc32 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-common ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index 7111432cd7..cee6b03e2a 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-executor ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index 7dc994fc36..54d6eb9325 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-scheduler ${project.artifactId} diff --git a/elasticjob-cloud/pom.xml b/elasticjob-cloud/pom.xml index 0a44944cda..1e688af2c7 100644 --- a/elasticjob-cloud/pom.xml +++ b/elasticjob-cloud/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud pom diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index 8984517ce3..fe6fab4598 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-executor-distribution pom diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index c0eb161d3f..5e6e7fa5f4 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-cloud-scheduler-distribution pom diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index fa4034102b..a193504ddd 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-distribution pom diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index 5cdeb9c356..6e2c55c1f9 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-src-distribution pom diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index eba35b5202..3d770b37fd 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-distribution pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml index 42dff33886..6cfa3a2e1d 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-spi diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index f925e4664a..e99887b268 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-dingtalk diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index 22f36be9f1..bc4b952d89 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-email diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index f3cf22792d..6a3237691a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-general diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index 46a8696620..8c4e5db7ac 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-wechat diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml index 0fb1b6c4dd..c0676a520f 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler-type pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml index e2a1ad3324..03e15bb3e9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-error-handler pom diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index 07c9570179..fb4df6ff7e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-executor-kernel ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml index ca7d15387b..ce3a30cd23 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-dataflow-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index ceba1b6ca5..fbad0b7f0a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-http-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml index 3ce051f9b5..b2b38a794d 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-script-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml index 41933e3ba8..89c0e6317a 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-simple-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index 7ba4b49302..bd2eddde8b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-executor-type pom diff --git a/elasticjob-ecosystem/elasticjob-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/pom.xml index e6a014877e..292ac87686 100644 --- a/elasticjob-ecosystem/elasticjob-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-executor pom diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index 287846d289..54d406377e 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-tracing-api ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index dd4d492c7f..5a36ef6572 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-tracing-rdb ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/pom.xml index cb3660a4e5..009ebae1a6 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-tracing pom diff --git a/elasticjob-ecosystem/pom.xml b/elasticjob-ecosystem/pom.xml index 8f9e1bfe73..e1aab4e471 100644 --- a/elasticjob-ecosystem/pom.xml +++ b/elasticjob-ecosystem/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-ecosystem pom diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index 518a2556bf..f5b94a7f4b 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-infra-common ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index e92a2ce428..fd1947585d 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-registry-center-api ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index e0176829a1..d1983ebff0 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-regitry-center-provider - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-registry-center-zookeeper-curator ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index 932d59c8d2..52b8856e7f 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-regitry-center-provider pom diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index a5b3b513d5..6394450349 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-registry-center pom diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index 3a15d0ddc3..c2d08e8bf1 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-restful ${project.artifactId} diff --git a/elasticjob-infra/pom.xml b/elasticjob-infra/pom.xml index 0cc6395f77..be2b5cc181 100644 --- a/elasticjob-infra/pom.xml +++ b/elasticjob-infra/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-infra pom diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index 63085747c5..d77bc1df43 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index 851d254315..7cf6867c86 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-lifecycle ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index 0a953fbd01..4e92b48f86 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring-boot-starter ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index e26680449f..3f6b1229c2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index 3ccecc9151..c7b8a43814 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring-namespace ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml index a90634102b..e5c9119494 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite-spring pom diff --git a/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml index 025f6a9ec9..5a26bc553e 100644 --- a/elasticjob-lite/pom.xml +++ b/elasticjob-lite/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 elasticjob-lite pom diff --git a/pom.xml b/pom.xml index 8c6b9c4e1f..08ab069d38 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.1.0-SNAPSHOT + 3.0.4 pom Elastic Job Distributed scheduled job @@ -731,7 +731,7 @@ scm:git:https://github.com/apache/shardingsphere-elasticjob.git scm:git:https://github.com/apache/shardingsphere-elasticjob.git https://github.com/apache/shardingsphere-elasticjob.git - HEAD + 3.0.4 From 0db2fa1d766eb6b67b91b3def666d21821b6ce27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sat, 14 Oct 2023 21:52:27 +0800 Subject: [PATCH 052/178] [maven-release-plugin] prepare for next development iteration --- elasticjob-api/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-common/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-executor/pom.xml | 2 +- elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml | 2 +- elasticjob-cloud/pom.xml | 2 +- .../elasticjob-cloud-executor-distribution/pom.xml | 2 +- .../elasticjob-cloud-scheduler-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-lite-distribution/pom.xml | 2 +- elasticjob-distribution/elasticjob-src-distribution/pom.xml | 2 +- elasticjob-distribution/pom.xml | 2 +- .../elasticjob-error-handler-spi/pom.xml | 2 +- .../elasticjob-error-handler-dingtalk/pom.xml | 2 +- .../elasticjob-error-handler-email/pom.xml | 2 +- .../elasticjob-error-handler-general/pom.xml | 2 +- .../elasticjob-error-handler-wechat/pom.xml | 2 +- .../elasticjob-error-handler-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-error-handler/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-kernel/pom.xml | 2 +- .../elasticjob-dataflow-executor/pom.xml | 2 +- .../elasticjob-executor-type/elasticjob-http-executor/pom.xml | 2 +- .../elasticjob-script-executor/pom.xml | 2 +- .../elasticjob-simple-executor/pom.xml | 2 +- .../elasticjob-executor/elasticjob-executor-type/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-executor/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-api/pom.xml | 2 +- .../elasticjob-tracing/elasticjob-tracing-rdb/pom.xml | 2 +- elasticjob-ecosystem/elasticjob-tracing/pom.xml | 2 +- elasticjob-ecosystem/pom.xml | 2 +- elasticjob-infra/elasticjob-infra-common/pom.xml | 2 +- .../elasticjob-registry-center-api/pom.xml | 2 +- .../elasticjob-registry-center-zookeeper-curator/pom.xml | 2 +- .../elasticjob-regitry-center-provider/pom.xml | 2 +- elasticjob-infra/elasticjob-registry-center/pom.xml | 2 +- elasticjob-infra/elasticjob-restful/pom.xml | 2 +- elasticjob-infra/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-core/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-lifecycle/pom.xml | 2 +- .../elasticjob-lite-spring-boot-starter/pom.xml | 2 +- .../elasticjob-lite-spring-core/pom.xml | 2 +- .../elasticjob-lite-spring-namespace/pom.xml | 2 +- elasticjob-lite/elasticjob-lite-spring/pom.xml | 2 +- elasticjob-lite/pom.xml | 2 +- pom.xml | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) diff --git a/elasticjob-api/pom.xml b/elasticjob-api/pom.xml index f08e76b41b..e36f819104 100644 --- a/elasticjob-api/pom.xml +++ b/elasticjob-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-api ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml index a4368dfc32..37c515c1ca 100755 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-common ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml index cee6b03e2a..7111432cd7 100755 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-executor ${project.artifactId} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml index 54d6eb9325..7dc994fc36 100755 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-cloud - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-scheduler ${project.artifactId} diff --git a/elasticjob-cloud/pom.xml b/elasticjob-cloud/pom.xml index 1e688af2c7..0a44944cda 100644 --- a/elasticjob-cloud/pom.xml +++ b/elasticjob-cloud/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud pom diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml index fe6fab4598..8984517ce3 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-executor-distribution pom diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml index 5e6e7fa5f4..c0eb161d3f 100644 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-cloud-scheduler-distribution pom diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml index a193504ddd..fa4034102b 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-lite-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-distribution pom diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/elasticjob-distribution/elasticjob-src-distribution/pom.xml index 6e2c55c1f9..5cdeb9c356 100644 --- a/elasticjob-distribution/elasticjob-src-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-src-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-distribution - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-src-distribution pom diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index 3d770b37fd..eba35b5202 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-distribution pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml index 6cfa3a2e1d..42dff33886 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-spi diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml index e99887b268..f925e4664a 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-dingtalk diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml index bc4b952d89..22f36be9f1 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-email diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml index 6a3237691a..f3cf22792d 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-general diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml index 8c4e5db7ac..46a8696620 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-wechat diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml index c0676a520f..0fb1b6c4dd 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-error-handler - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler-type pom diff --git a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml index 03e15bb3e9..e2a1ad3324 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml +++ b/elasticjob-ecosystem/elasticjob-error-handler/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-error-handler pom diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml index fb4df6ff7e..07c9570179 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-executor-kernel ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml index ce3a30cd23..ca7d15387b 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-dataflow-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml index fbad0b7f0a..ceba1b6ca5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-http-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml index b2b38a794d..3ce051f9b5 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-script-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml index 89c0e6317a..41933e3ba8 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor-type - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-simple-executor ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml index bd2eddde8b..7ba4b49302 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-executor - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-executor-type pom diff --git a/elasticjob-ecosystem/elasticjob-executor/pom.xml b/elasticjob-ecosystem/elasticjob-executor/pom.xml index 292ac87686..e6a014877e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/pom.xml +++ b/elasticjob-ecosystem/elasticjob-executor/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-executor pom diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml index 54d406377e..287846d289 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-tracing-api ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml index 5a36ef6572..dd4d492c7f 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-tracing - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-tracing-rdb ${project.artifactId} diff --git a/elasticjob-ecosystem/elasticjob-tracing/pom.xml b/elasticjob-ecosystem/elasticjob-tracing/pom.xml index 009ebae1a6..cb3660a4e5 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/pom.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-ecosystem - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-tracing pom diff --git a/elasticjob-ecosystem/pom.xml b/elasticjob-ecosystem/pom.xml index e1aab4e471..8f9e1bfe73 100644 --- a/elasticjob-ecosystem/pom.xml +++ b/elasticjob-ecosystem/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-ecosystem pom diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml index f5b94a7f4b..518a2556bf 100644 --- a/elasticjob-infra/elasticjob-infra-common/pom.xml +++ b/elasticjob-infra/elasticjob-infra-common/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-infra-common ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml index fd1947585d..e92a2ce428 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-registry-center-api ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml index d1983ebff0..e0176829a1 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-regitry-center-provider - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-registry-center-zookeeper-curator ${project.artifactId} diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml index 52b8856e7f..932d59c8d2 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-registry-center - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-regitry-center-provider pom diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml index 6394450349..a5b3b513d5 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/elasticjob-infra/elasticjob-registry-center/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-registry-center pom diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/elasticjob-infra/elasticjob-restful/pom.xml index c2d08e8bf1..3a15d0ddc3 100644 --- a/elasticjob-infra/elasticjob-restful/pom.xml +++ b/elasticjob-infra/elasticjob-restful/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-infra - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-restful ${project.artifactId} diff --git a/elasticjob-infra/pom.xml b/elasticjob-infra/pom.xml index be2b5cc181..0cc6395f77 100644 --- a/elasticjob-infra/pom.xml +++ b/elasticjob-infra/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-infra pom diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml index d77bc1df43..63085747c5 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml index 7cf6867c86..851d254315 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-lifecycle ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml index 4e92b48f86..0a953fbd01 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring-boot-starter ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml index 3f6b1229c2..e26680449f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml index c7b8a43814..3ccecc9151 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite-spring - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring-namespace ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-lite/elasticjob-lite-spring/pom.xml index e5c9119494..a90634102b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-lite/elasticjob-lite-spring/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob-lite - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite-spring pom diff --git a/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml index 5a26bc553e..025f6a9ec9 100644 --- a/elasticjob-lite/pom.xml +++ b/elasticjob-lite/pom.xml @@ -21,7 +21,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT elasticjob-lite pom diff --git a/pom.xml b/pom.xml index 08ab069d38..8c6b9c4e1f 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ org.apache.shardingsphere.elasticjob elasticjob - 3.0.4 + 3.1.0-SNAPSHOT pom Elastic Job Distributed scheduled job @@ -731,7 +731,7 @@ scm:git:https://github.com/apache/shardingsphere-elasticjob.git scm:git:https://github.com/apache/shardingsphere-elasticjob.git https://github.com/apache/shardingsphere-elasticjob.git - 3.0.4 + HEAD From b2a6a70b8870df681de2c7fd0809da7dee96afa7 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 14 Oct 2023 22:36:50 +0800 Subject: [PATCH 053/178] Remove elasticjob cloud (#2288) * Refactor pom for dependency * Remove elasticjob cloud * Rename elastic-job-lite module to elastic-job-engine * Rename elasticjob.lite package to elasticjob.engine * Remove JobStatusTraceEvent.Source * Remove JobStatusTraceEvent.Source * Fix docs --- .github/ISSUE_TEMPLATE/bug-report.md | 2 - README.md | 25 +- README_ZH.md | 26 +- docs/content/dev-manual/roadmap.cn.md | 51 -- docs/content/dev-manual/roadmap.en.md | 51 -- docs/content/downloads/_index.cn.md | 7 +- docs/content/downloads/_index.en.md | 7 +- docs/content/faq/_index.cn.md | 48 +- docs/content/faq/_index.en.md | 50 +- docs/content/features/elastic.cn.md | 34 +- docs/content/features/elastic.en.md | 34 +- docs/content/features/resource.cn.md | 43 -- docs/content/features/resource.en.md | 43 -- docs/content/features/schedule-model.cn.md | 12 +- docs/content/features/schedule-model.en.md | 16 +- docs/content/overview/_index.cn.md | 26 +- docs/content/overview/_index.en.md | 25 +- docs/content/quick-start/_index.cn.md | 61 ++- docs/content/quick-start/_index.en.md | 62 ++- .../quick-start/elasticjob-cloud.cn.md | 82 --- .../quick-start/elasticjob-cloud.en.md | 82 --- .../content/quick-start/elasticjob-lite.cn.md | 67 --- .../content/quick-start/elasticjob-lite.en.md | 67 --- docs/content/user-manual/_index.cn.md | 5 +- docs/content/user-manual/_index.en.md | 7 +- .../configuration/_index.cn.md | 74 +-- .../user-manual/configuration/_index.en.md | 136 +++++ .../built-in-strategy/_index.cn.md | 0 .../built-in-strategy/_index.en.md | 0 .../built-in-strategy/error-handler.cn.md | 0 .../built-in-strategy/error-handler.en.md | 0 .../built-in-strategy/sharding.cn.md | 0 .../built-in-strategy/sharding.en.md | 0 .../built-in-strategy/thread-pool.cn.md | 0 .../built-in-strategy/thread-pool.en.md | 0 .../configuration/java-api.cn.md | 0 .../configuration/java-api.en.md | 0 .../configuration/props.cn.md | 0 .../configuration/props.en.md | 0 .../configuration/spring-boot-starter.cn.md | 94 ++-- .../configuration/spring-boot-starter.en.md | 34 +- .../configuration/spring-namespace.cn.md | 90 ++++ .../configuration/spring-namespace.en.md | 20 +- .../user-manual/elasticjob-cloud/_index.cn.md | 23 - .../user-manual/elasticjob-cloud/_index.en.md | 24 - .../configuration/_index.cn.md | 207 -------- .../configuration/_index.en.md | 208 -------- .../elasticjob-cloud/operation/_index.cn.md | 8 - .../elasticjob-cloud/operation/_index.en.md | 8 - .../operation/deploy-guide.cn.md | 45 -- .../operation/deploy-guide.en.md | 45 -- .../operation/high-availability.cn.md | 25 - .../operation/high-availability.en.md | 26 - .../operation/web-console.cn.md | 24 - .../operation/web-console.en.md | 24 - .../elasticjob-cloud/usage/_index.cn.md | 9 - .../elasticjob-cloud/usage/_index.en.md | 9 - .../elasticjob-cloud/usage/dev-guide.cn.md | 24 - .../elasticjob-cloud/usage/dev-guide.en.md | 24 - .../usage/local-executor.cn.md | 21 - .../usage/local-executor.en.md | 21 - .../user-manual/elasticjob-lite/_index.cn.md | 23 - .../user-manual/elasticjob-lite/_index.en.md | 24 - .../configuration/_index.en.md | 136 ----- .../configuration/spring-namespace.cn.md | 90 ---- .../usage/job-api/_index.cn.md | 8 - .../usage/tracing/table-structure.cn.md | 48 -- .../usage/tracing/table-structure.en.md | 48 -- .../operation/_index.cn.md | 2 +- .../operation/_index.en.md | 2 +- .../operation/deploy-guide.cn.md | 8 +- .../operation/deploy-guide.en.md | 8 +- .../operation/dump.cn.md | 6 +- .../operation/dump.en.md | 4 +- .../operation/execution-monitor.cn.md | 2 +- .../operation/execution-monitor.en.md | 2 +- .../operation/web-console.cn.md | 13 +- .../operation/web-console.en.md | 7 +- .../{elasticjob-lite => }/usage/_index.cn.md | 2 +- .../{elasticjob-lite => }/usage/_index.en.md | 2 +- .../user-manual/usage/job-api/_index.cn.md | 8 + .../usage/job-api/_index.en.md | 2 +- .../usage/job-api/java-api.cn.md | 32 +- .../usage/job-api/java-api.en.md | 16 +- .../usage/job-api/job-interface.cn.md | 2 - .../usage/job-api/job-interface.en.md | 2 - .../usage/job-api/spring-boot-starter.cn.md | 30 +- .../usage/job-api/spring-boot-starter.en.md | 30 +- .../usage/job-api/spring-namespace.cn.md | 29 +- .../usage/job-api/spring-namespace.en.md | 11 +- .../usage/job-listener/_index.cn.md | 2 +- .../usage/job-listener/_index.en.md | 2 +- .../usage/job-listener/java-api.cn.md | 0 .../usage/job-listener/java-api.en.md | 0 .../job-listener/listener-interface.cn.md | 0 .../job-listener/listener-interface.en.md | 0 .../usage/job-listener/spring-namespace.cn.md | 0 .../usage/job-listener/spring-namespace.en.md | 0 .../usage/operation-api/_index.cn.md | 14 +- .../usage/operation-api/_index.en.md | 14 +- .../usage/tracing/_index.cn.md | 0 .../usage/tracing/_index.en.md | 0 .../usage/tracing/java-api.cn.md | 2 +- .../usage/tracing/java-api.en.md | 2 +- .../usage/tracing/spring-boot-starter.cn.md | 4 +- .../usage/tracing/spring-boot-starter.en.md | 4 +- .../usage/tracing/spring-namespace.cn.md | 4 +- .../usage/tracing/spring-namespace.en.md | 2 +- .../usage/tracing/table-structure.cn.md | 47 ++ .../usage/tracing/table-structure.en.md | 47 ++ .../elasticjob-cloud-common/pom.xml | 122 ----- .../cloud/config/CloudJobConfiguration.java | 40 -- .../cloud/config/CloudJobExecutionType.java | 26 - .../pojo/CloudJobConfigurationPOJO.java | 126 ----- .../cloud/statistics/StatisticInterval.java | 37 -- .../rdb/StatisticRdbRepository.java | 485 ----------------- .../type/job/JobExecutionTypeStatistics.java | 33 -- .../type/job/JobRegisterStatistics.java | 41 -- .../type/job/JobRunningStatistics.java | 41 -- .../type/task/TaskResultStatistics.java | 46 -- .../type/task/TaskRunningStatistics.java | 41 -- .../pojo/CloudJobConfigurationPOJOTest.java | 219 -------- .../rdb/StatisticRdbRepositoryTest.java | 223 -------- .../elasticjob-cloud-executor/pom.xml | 69 --- .../elasticjob/cloud/api/JobBootstrap.java | 55 -- .../executor/local/LocalTaskExecutor.java | 73 --- .../executor/prod/DaemonTaskScheduler.java | 200 ------- .../cloud/executor/prod/TaskExecutor.java | 173 ------- .../cloud/facade/CloudJobFacade.java | 115 ----- .../executor/facade/CloudJobFacadeTest.java | 136 ----- .../executor/fixture/TestDataflowJob.java | 42 -- .../cloud/executor/fixture/TestSimpleJob.java | 39 -- .../executor/local/LocalTaskExecutorTest.java | 64 --- .../prod/DaemonTaskSchedulerTest.java | 140 ----- .../cloud/executor/prod/TaskExecutorTest.java | 149 ------ .../executor/prod/TaskExecutorThreadTest.java | 97 ---- .../src/test/resources/logback-test.xml | 40 -- .../elasticjob-cloud-scheduler/pom.xml | 112 ---- .../cloud/console/ConsoleBootstrap.java | 65 --- .../advice/ConsoleExceptionHandler.java | 38 -- .../JsonResponseBodySerializer.java | 46 -- .../controller/CloudAppController.java | 216 -------- .../controller/CloudJobController.java | 414 --------------- .../controller/CloudOperationController.java | 106 ---- .../controller/search/JobEventRdbSearch.java | 289 ----------- .../security/AuthenticationConstants.java | 32 -- .../security/AuthenticationFilter.java | 90 ---- .../console/security/AuthenticationInfo.java | 33 -- .../security/AuthenticationService.java | 60 --- .../elasticjob/cloud/scheduler/Bootstrap.java | 65 --- .../config/app/CloudAppConfiguration.java | 47 -- .../app/CloudAppConfigurationListener.java | 99 ---- .../config/app/CloudAppConfigurationNode.java | 36 -- .../app/CloudAppConfigurationService.java | 95 ---- .../app/pojo/CloudAppConfigurationPOJO.java | 71 --- .../job/CloudJobConfigurationListener.java | 116 ----- .../config/job/CloudJobConfigurationNode.java | 36 -- .../job/CloudJobConfigurationService.java | 96 ---- .../cloud/scheduler/context/JobContext.java | 56 -- .../scheduler/env/AuthConfiguration.java | 34 -- .../scheduler/env/BootstrapEnvironment.java | 237 --------- .../scheduler/env/FrameworkConfiguration.java | 42 -- .../scheduler/env/MesosConfiguration.java | 45 -- .../env/RestfulServerConfiguration.java | 31 -- .../exception/AppConfigurationException.java | 30 -- .../exception/HttpClientException.java | 38 -- .../scheduler/ha/FrameworkIDService.java | 54 -- .../elasticjob/cloud/scheduler/ha/HANode.java | 39 -- .../ha/SchedulerElectionCandidate.java | 53 -- .../mesos/AppConstraintEvaluator.java | 164 ------ .../cloud/scheduler/mesos/FacadeService.java | 338 ------------ .../cloud/scheduler/mesos/JobTaskRequest.java | 104 ---- .../cloud/scheduler/mesos/LaunchingTasks.java | 95 ---- .../cloud/scheduler/mesos/LeasesQueue.java | 69 --- .../scheduler/mesos/MesosStateService.java | 175 ------- .../scheduler/mesos/ReconcileService.java | 100 ---- .../scheduler/mesos/SchedulerEngine.java | 166 ------ .../scheduler/mesos/SchedulerService.java | 161 ------ .../mesos/SupportedExtractionType.java | 59 --- .../cloud/scheduler/mesos/TaskInfoData.java | 51 -- .../mesos/TaskLaunchScheduledService.java | 265 ---------- .../scheduler/producer/ProducerManager.java | 195 ------- .../producer/TransientProducerRepository.java | 72 --- .../producer/TransientProducerScheduler.java | 154 ------ .../cloud/scheduler/state/StateNode.java | 33 -- .../disable/app/CloudAppDisableListener.java | 106 ---- .../state/disable/app/DisableAppNode.java | 37 -- .../state/disable/app/DisableAppService.java | 72 --- .../disable/job/CloudJobDisableListener.java | 85 --- .../state/disable/job/DisableJobNode.java | 37 -- .../state/disable/job/DisableJobService.java | 72 --- .../state/failover/FailoverNode.java | 44 -- .../state/failover/FailoverService.java | 184 ------- .../state/failover/FailoverTaskInfo.java | 34 -- .../scheduler/state/ready/ReadyNode.java | 37 -- .../scheduler/state/ready/ReadyService.java | 178 ------- .../scheduler/state/running/RunningNode.java | 44 -- .../state/running/RunningService.java | 254 --------- .../statistics/StatisticManager.java | 269 ---------- .../statistics/StatisticsScheduler.java | 98 ---- .../statistics/TaskResultMetaData.java | 79 --- .../statistics/job/AbstractStatisticJob.java | 52 -- .../job/JobRunningStatisticJob.java | 146 ------ .../job/RegisteredJobStatisticJob.java | 98 ---- .../statistics/job/StatisticJob.java | 51 -- .../job/TaskResultStatisticJob.java | 104 ---- .../statistics/util/StatisticTimeUtils.java | 72 --- .../cloud/scheduler/util/HttpClientUtils.java | 159 ------ .../cloud/scheduler/util/IOUtils.java | 67 --- ....restful.serializer.ResponseBodySerializer | 18 - .../elasticjob-cloud-scheduler.properties | 68 --- .../src/main/resources/logback.xml | 75 --- .../elasticjob/cloud/ReflectionUtils.java | 77 --- .../console/AbstractCloudControllerTest.java | 101 ---- .../cloud/console/HttpTestUtil.java | 201 -------- .../controller/CloudAppControllerTest.java | 136 ----- .../controller/CloudJobControllerTest.java | 292 ----------- .../console/controller/CloudLoginTest.java | 68 --- .../CloudOperationControllerTest.java | 64 --- .../search/JobEventRdbSearchTest.java | 108 ---- .../CloudAppConfigurationListenerTest.java | 108 ---- .../app/CloudAppConfigurationNodeTest.java | 31 -- .../app/CloudAppConfigurationServiceTest.java | 111 ---- .../pojo/CloudAppConfigurationPOJOTest.java | 56 -- .../CloudJobConfigurationListenerTest.java | 151 ------ .../job/CloudJobConfigurationNodeTest.java | 31 -- .../job/CloudJobConfigurationServiceTest.java | 128 ----- .../scheduler/context/JobContextTest.java | 39 -- .../env/BootstrapEnvironmentTest.java | 129 ----- .../fixture/CloudAppConfigurationBuilder.java | 37 -- .../fixture/CloudAppJsonConstants.java | 37 -- .../fixture/CloudJobConfigurationBuilder.java | 135 ----- .../scheduler/fixture/CloudJsonConstants.java | 81 --- .../scheduler/fixture/EmbedTestingServer.java | 135 ----- .../cloud/scheduler/fixture/TaskNode.java | 62 --- .../scheduler/fixture/TestSimpleJob.java | 28 - .../scheduler/ha/FrameworkIDServiceTest.java | 64 --- .../mesos/AppConstraintEvaluatorTest.java | 187 ------- .../scheduler/mesos/FacadeServiceTest.java | 328 ------------ .../scheduler/mesos/JobTaskRequestTest.java | 104 ---- .../scheduler/mesos/LaunchingTasksTest.java | 81 --- .../scheduler/mesos/LeasesQueueTest.java | 38 -- .../mesos/MesosStateServiceTest.java | 74 --- .../scheduler/mesos/ReconcileServiceTest.java | 88 ---- .../scheduler/mesos/SchedulerEngineTest.java | 296 ----------- .../scheduler/mesos/SchedulerServiceTest.java | 162 ------ .../mesos/SupportedExtractionTypeTest.java | 41 -- .../scheduler/mesos/TaskInfoDataTest.java | 59 --- .../mesos/TaskLaunchScheduledServiceTest.java | 140 ----- .../scheduler/mesos/fixture/OfferBuilder.java | 42 -- .../fixture/master/MesosMasterServerMock.java | 73 --- .../fixture/slave/MesosSlaveServerMock.java | 87 ---- .../scheduler/producer/ProducerJobTest.java | 61 --- .../producer/ProducerManagerTest.java | 202 -------- .../TransientProducerRepositoryTest.java | 83 --- .../TransientProducerSchedulerTest.java | 87 ---- .../app/CloudAppDisableListenerTest.java | 126 ----- .../state/disable/app/DisableAppNodeTest.java | 31 -- .../disable/app/DisableAppServiceTest.java | 71 --- .../job/CloudJobDisableListenerTest.java | 122 ----- .../state/disable/job/DisableJobNodeTest.java | 31 -- .../disable/job/DisableJobServiceTest.java | 71 --- .../state/failover/FailoverNodeTest.java | 39 -- .../state/failover/FailoverServiceTest.java | 219 -------- .../scheduler/state/ready/ReadyNodeTest.java | 31 -- .../state/ready/ReadyServiceTest.java | 285 ---------- .../state/running/RunningNodeTest.java | 38 -- .../state/running/RunningServiceTest.java | 167 ------ .../statistics/StatisticManagerTest.java | 223 -------- .../statistics/StatisticsSchedulerTest.java | 63 --- .../statistics/TaskResultMetaDataTest.java | 56 -- .../statistics/job/BaseStatisticJobTest.java | 59 --- .../job/JobRunningStatisticJobTest.java | 120 ----- .../job/RegisteredJobStatisticJobTest.java | 101 ---- .../job/TaskResultStatisticJobTest.java | 108 ---- .../statistics/job/TestStatisticJob.java | 58 --- .../util/StatisticTimeUtilsTest.java | 72 --- .../cloud/scheduler/util/IOUtilsTest.java | 54 -- .../src/test/resources/logback-test.xml | 43 -- elasticjob-cloud/pom.xml | 35 -- .../pom.xml | 10 +- .../elasticjob-binary-distribution.xml} | 2 +- .../src/main/release-docs/README.txt | 4 +- .../pom.xml | 83 --- .../elasticjob-cloud-binary-distribution.xml | 54 -- .../Dockerfile | 27 - .../pom.xml | 187 ------- ...ob-cloud-scheduler-binary-distribution.xml | 63 --- .../src/main/release-docs/LICENSE | 281 ---------- .../src/main/release-docs/NOTICE | 487 ------------------ .../src/main/release-docs/README.txt | 31 -- .../licenses/LICENSE-checker-framework.txt | 417 --------------- .../licenses/LICENSE-jcl-over-slf4j.txt | 24 - .../licenses/LICENSE-jul-to-slf4j.txt | 24 - .../release-docs/licenses/LICENSE-logback.txt | 14 - .../licenses/LICENSE-mchange-commons.txt | 245 --------- .../release-docs/licenses/LICENSE-slf4j.txt | 24 - .../src/main/resources/bin/dcos.sh | 27 - .../src/main/resources/bin/start.sh | 35 -- .../elasticjob-cloud-scheduler.properties | 68 --- .../src/main/resources/logback.xml | 75 --- .../src/main/release-docs/README.txt | 31 -- elasticjob-distribution/pom.xml | 4 +- .../tracing/event/JobStatusTraceEvent.java | 6 - .../src/test/resources/logback-test.xml | 2 +- .../rdb/storage/RDBJobEventStorage.java | 16 +- .../resources/META-INF/sql/DB2.properties | 4 +- .../main/resources/META-INF/sql/H2.properties | 4 +- .../resources/META-INF/sql/MySQL.properties | 3 +- .../resources/META-INF/sql/Oracle.properties | 4 +- .../META-INF/sql/PostgreSQL.properties | 4 +- .../resources/META-INF/sql/SQL92.properties | 4 +- .../META-INF/sql/SQLServer.properties | 4 +- .../rdb/listener/RDBTracingListenerTest.java | 3 +- .../rdb/storage/RDBJobEventStorageTest.java | 9 +- .../src/test/resources/logback-test.xml | 2 +- .../elasticjob-engine-core}/pom.xml | 4 +- .../engine}/api/bootstrap/JobBootstrap.java | 2 +- .../bootstrap/impl/OneOffJobBootstrap.java | 10 +- .../bootstrap/impl/ScheduleJobBootstrap.java | 8 +- ...tractDistributeOnceElasticJobListener.java | 4 +- .../api/registry/JobInstanceRegistry.java | 8 +- .../annotation/JobAnnotationBuilder.java | 2 +- .../internal/config/ConfigurationNode.java | 4 +- .../internal/config/ConfigurationService.java | 4 +- .../config/RescheduleListenerManager.java | 6 +- .../election/ElectionListenerManager.java | 12 +- .../engine}/internal/election/LeaderNode.java | 4 +- .../internal/election/LeaderService.java | 8 +- .../failover/FailoverListenerManager.java | 18 +- .../internal/failover/FailoverNode.java | 8 +- .../internal/failover/FailoverService.java | 14 +- .../guarantee/GuaranteeListenerManager.java | 6 +- .../internal/guarantee/GuaranteeNode.java | 4 +- .../internal/guarantee/GuaranteeService.java | 8 +- .../internal/instance/InstanceNode.java | 6 +- .../internal/instance/InstanceService.java | 8 +- .../instance/ShutdownListenerManager.java | 8 +- .../listener/AbstractListenerManager.java | 4 +- .../internal/listener/ListenerManager.java | 20 +- .../listener/ListenerNotifierManager.java | 2 +- ...RegistryCenterConnectionStateListener.java | 14 +- .../internal/reconcile/ReconcileService.java | 8 +- .../internal/schedule/JobRegistry.java | 4 +- .../schedule/JobScheduleController.java | 2 +- .../internal/schedule/JobScheduler.java | 12 +- .../schedule/JobShutdownHookPlugin.java | 6 +- .../internal/schedule/JobTriggerListener.java | 6 +- .../engine}/internal/schedule/LiteJob.java | 2 +- .../internal/schedule/LiteJobFacade.java | 15 +- .../internal/schedule/SchedulerFacade.java | 8 +- .../engine}/internal/server/ServerNode.java | 6 +- .../internal/server/ServerService.java | 8 +- .../engine}/internal/server/ServerStatus.java | 2 +- .../setup/DefaultJobClassNameProvider.java | 2 +- .../internal/setup/JobClassNameProvider.java | 2 +- .../setup/JobClassNameProviderFactory.java | 2 +- .../engine}/internal/setup/SetUpFacade.java | 12 +- .../sharding/ExecutionContextService.java | 8 +- .../internal/sharding/ExecutionService.java | 8 +- .../MonitorExecutionListenerManager.java | 6 +- .../sharding/ShardingListenerManager.java | 16 +- .../internal/sharding/ShardingNode.java | 6 +- .../internal/sharding/ShardingService.java | 18 +- .../internal/snapshot/SnapshotService.java | 4 +- .../engine}/internal/storage/JobNodePath.java | 2 +- .../internal/storage/JobNodeStorage.java | 4 +- .../trigger/TriggerListenerManager.java | 6 +- .../engine}/internal/trigger/TriggerNode.java | 6 +- .../internal/trigger/TriggerService.java | 4 +- .../internal/util/SensitiveInfoUtils.java | 2 +- .../impl/OneOffJobBootstrapTest.java | 8 +- .../DistributeOnceElasticJobListenerTest.java | 10 +- .../fixture/ElasticJobListenerCaller.java | 2 +- .../TestDistributeOnceElasticJobListener.java | 4 +- .../fixture/TestElasticJobListener.java | 2 +- .../api/registry/JobInstanceRegistryTest.java | 2 +- .../engine}/fixture/EmbedTestingServer.java | 2 +- .../engine}/fixture/LiteYamlConstants.java | 2 +- .../executor/ClassedFooJobExecutor.java | 4 +- .../fixture/job/AnnotationSimpleJob.java | 2 +- .../fixture/job/AnnotationUnShardingJob.java | 2 +- .../engine}/fixture/job/DetailedFooJob.java | 2 +- .../engine}/fixture/job/FooJob.java | 2 +- .../engine}/integrate/BaseIntegrateTest.java | 16 +- .../disable/DisabledJobIntegrateTest.java | 12 +- .../OneOffDisabledJobIntegrateTest.java | 2 +- .../ScheduleDisabledJobIntegrateTest.java | 8 +- .../enable/EnabledJobIntegrateTest.java | 10 +- .../enable/OneOffEnabledJobIntegrateTest.java | 4 +- .../ScheduleEnabledJobIntegrateTest.java | 4 +- .../TestDistributeOnceElasticJobListener.java | 4 +- .../listener/TestElasticJobListener.java | 2 +- .../annotation/JobAnnotationBuilderTest.java | 4 +- .../integrate/BaseAnnotationTest.java | 18 +- .../integrate/OneOffEnabledJobTest.java | 8 +- .../integrate/ScheduleEnabledJobTest.java | 8 +- .../config/ConfigurationNodeTest.java | 2 +- .../config/ConfigurationServiceTest.java | 10 +- .../config/RescheduleListenerManagerTest.java | 12 +- .../election/ElectionListenerManagerTest.java | 14 +- .../internal/election/LeaderNodeTest.java | 2 +- .../internal/election/LeaderServiceTest.java | 14 +- .../failover/FailoverListenerManagerTest.java | 22 +- .../internal/failover/FailoverNodeTest.java | 2 +- .../failover/FailoverServiceTest.java | 14 +- .../GuaranteeListenerManagerTest.java | 8 +- .../internal/guarantee/GuaranteeNodeTest.java | 2 +- .../guarantee/GuaranteeServiceTest.java | 10 +- .../internal/instance/InstanceNodeTest.java | 4 +- .../instance/InstanceServiceTest.java | 10 +- .../instance/ShutdownListenerManagerTest.java | 12 +- .../listener/ListenerManagerTest.java | 22 +- .../listener/ListenerNotifierManagerTest.java | 2 +- ...stryCenterConnectionStateListenerTest.java | 16 +- .../reconcile/ReconcileServiceTest.java | 10 +- .../internal/schedule/JobRegistryTest.java | 4 +- .../schedule/JobScheduleControllerTest.java | 4 +- .../schedule/JobTriggerListenerTest.java | 6 +- .../internal/schedule/LiteJobFacadeTest.java | 18 +- .../schedule/SchedulerFacadeTest.java | 8 +- .../internal/server/ServerNodeTest.java | 4 +- .../internal/server/ServerServiceTest.java | 10 +- .../DefaultJobClassNameProviderTest.java | 10 +- .../JobClassNameProviderFactoryTest.java | 2 +- .../internal/setup/SetUpFacadeTest.java | 16 +- .../sharding/ExecutionContextServiceTest.java | 10 +- .../sharding/ExecutionServiceTest.java | 10 +- .../MonitorExecutionListenerManagerTest.java | 8 +- .../sharding/ShardingListenerManagerTest.java | 14 +- .../internal/sharding/ShardingNodeTest.java | 2 +- .../sharding/ShardingServiceTest.java | 20 +- .../snapshot/BaseSnapshotServiceTest.java | 10 +- .../snapshot/SnapshotServiceDisableTest.java | 4 +- .../snapshot/SnapshotServiceEnableTest.java | 4 +- .../internal/snapshot/SocketUtils.java | 2 +- .../internal/storage/JobNodePathTest.java | 2 +- .../internal/storage/JobNodeStorageTest.java | 6 +- .../trigger/TriggerListenerManagerTest.java | 10 +- .../internal/util/SensitiveInfoUtilsTest.java | 2 +- .../engine}/util/ReflectionUtils.java | 2 +- ....executor.item.impl.ClassedJobItemExecutor | 2 +- ...asticjob.infra.listener.ElasticJobListener | 8 +- .../src/test/resources/logback-test.xml | 4 +- .../elasticjob-engine-lifecycle}/pom.xml | 6 +- .../engine}/lifecycle/api/JobAPIFactory.java | 16 +- .../lifecycle/api/JobConfigurationAPI.java | 2 +- .../engine}/lifecycle/api/JobOperateAPI.java | 2 +- .../lifecycle/api/JobStatisticsAPI.java | 4 +- .../lifecycle/api/ServerStatisticsAPI.java | 4 +- .../lifecycle/api/ShardingOperateAPI.java | 2 +- .../lifecycle/api/ShardingStatisticsAPI.java | 4 +- .../lifecycle/domain/JobBriefInfo.java | 2 +- .../lifecycle/domain/ServerBriefInfo.java | 2 +- .../lifecycle/domain/ShardingInfo.java | 2 +- .../internal/operate/JobOperateAPIImpl.java | 12 +- .../operate/ShardingOperateAPIImpl.java | 6 +- .../internal/reg/RegistryCenterFactory.java | 2 +- .../settings/JobConfigurationAPIImpl.java | 6 +- .../statistics/JobStatisticsAPIImpl.java | 8 +- .../statistics/ServerStatisticsAPIImpl.java | 8 +- .../statistics/ShardingStatisticsAPIImpl.java | 8 +- .../AbstractEmbedZookeeperBaseTest.java | 2 +- .../lifecycle/api/JobAPIFactoryTest.java | 4 +- .../lifecycle/domain/ShardingStatusTest.java | 2 +- .../fixture/LifecycleYamlConstants.java | 2 +- .../operate/JobOperateAPIImplTest.java | 4 +- .../operate/ShardingOperateAPIImplTest.java | 4 +- .../reg/RegistryCenterFactoryTest.java | 4 +- .../settings/JobConfigurationAPIImplTest.java | 6 +- .../statistics/JobStatisticsAPIImplTest.java | 8 +- .../ServerStatisticsAPIImplTest.java | 6 +- .../ShardingStatisticsAPIImplTest.java | 6 +- .../src/test/resources/logback-test.xml | 2 +- .../README.md | 6 +- .../pom.xml | 6 +- .../job/ElasticJobBootstrapConfiguration.java | 8 +- .../ElasticJobConfigurationProperties.java | 2 +- .../job/ElasticJobLiteAutoConfiguration.java | 10 +- .../spring/boot/job/ElasticJobProperties.java | 2 +- .../ScheduleJobBootstrapStartupRunner.java | 4 +- ...ElasticJobRegistryCenterConfiguration.java | 2 +- .../spring/boot/reg/ZookeeperProperties.java | 2 +- ...lasticJobSnapshotServiceConfiguration.java | 4 +- .../snapshot/SnapshotServiceProperties.java | 2 +- .../ElasticJobTracingConfiguration.java | 2 +- .../boot/tracing/TracingProperties.java | 2 +- ...itional-spring-configuration-metadata.json | 22 +- .../main/resources/META-INF/spring.factories | 2 +- .../main/resources/META-INF/spring.provides | 2 +- ...ot.autoconfigure.AutoConfiguration.imports | 2 +- ...ElasticJobConfigurationPropertiesTest.java | 2 +- .../job/ElasticJobSpringBootScannerTest.java | 12 +- .../boot/job/ElasticJobSpringBootTest.java | 20 +- .../executor/CustomClassedJobExecutor.java | 4 +- .../boot/job/executor/PrintJobExecutor.java | 2 +- .../boot/job/executor/PrintJobProperties.java | 2 +- .../boot/job/fixture/EmbedTestingServer.java | 2 +- .../boot/job/fixture/job/CustomJob.java | 2 +- .../fixture/job/impl/AnnotationCustomJob.java | 4 +- .../job/fixture/job/impl/CustomTestJob.java | 6 +- .../listener/LogElasticJobListener.java | 2 +- .../listener/NoopElasticJobListener.java | 2 +- .../boot/job/repository/BarRepository.java | 2 +- .../repository/impl/BarRepositoryImpl.java | 4 +- .../boot/reg/ZookeeperPropertiesTest.java | 2 +- ...icJobSnapshotServiceConfigurationTest.java | 6 +- .../tracing/TracingConfigurationTest.java | 4 +- ....executor.item.impl.ClassedJobItemExecutor | 2 +- ...ob.executor.item.impl.TypedJobItemExecutor | 2 +- ...asticjob.infra.listener.ElasticJobListener | 4 +- .../test/resources/application-elasticjob.yml | 6 +- .../test/resources/application-snapshot.yml | 2 +- .../test/resources/application-tracing.yml | 2 +- .../src/test/resources/logback-test.xml | 0 .../elasticjob-engine-spring-core}/pom.xml | 6 +- .../core/scanner/ClassPathJobScanner.java | 4 +- .../spring/core/scanner/ElasticJobScan.java | 2 +- .../core/scanner/ElasticJobScanRegistrar.java | 2 +- .../core/scanner/JobScannerConfiguration.java | 2 +- .../SpringProxyJobClassNameProvider.java | 6 +- .../spring/core/util/AopTargetUtils.java | 2 +- ...engine.internal.setup.JobClassNameProvider | 2 +- .../JobClassNameProviderFactoryTest.java | 4 +- .../spring/core/util/AopTargetUtilsTest.java | 2 +- .../engine}/spring/core/util/TargetJob.java | 2 +- .../test/resources/META-INF/logback-test.xml | 0 .../pom.xml | 6 +- .../namespace/ElasticJobNamespaceHandler.java | 12 +- .../job/parser/JobBeanDefinitionParser.java | 8 +- .../job/tag/JobBeanDefinitionTag.java | 2 +- .../parser/ZookeeperBeanDefinitionParser.java | 4 +- .../reg/tag/ZookeeperBeanDefinitionTag.java | 2 +- .../JobScannerBeanDefinitionParser.java | 6 +- .../tag/JobScannerBeanDefinitionTag.java | 2 +- .../parser/SnapshotBeanDefinitionParser.java | 6 +- .../tag/SnapshotBeanDefinitionTag.java | 2 +- .../parser/TracingBeanDefinitionParser.java | 4 +- .../tracing/tag/TracingBeanDefinitionTag.java | 2 +- .../META-INF/namespace/elasticjob.xsd | 0 .../main/resources/META-INF/spring.handlers | 2 +- .../main/resources/META-INF/spring.schemas | 0 .../fixture/aspect/SimpleAspect.java | 4 +- .../fixture/job/DataflowElasticJob.java | 2 +- .../fixture/job/FooSimpleElasticJob.java | 2 +- .../job/annotation/AnnotationSimpleJob.java | 2 +- .../job/ref/RefFooDataflowElasticJob.java | 4 +- .../job/ref/RefFooSimpleElasticJob.java | 4 +- .../fixture/listener/SimpleCglibListener.java | 2 +- .../SimpleJdkDynamicProxyListener.java | 2 +- .../fixture/listener/SimpleListener.java | 2 +- .../fixture/listener/SimpleOnceListener.java | 6 +- .../namespace/fixture/service/FooService.java | 2 +- .../fixture/service/FooServiceImpl.java | 2 +- .../job/AbstractJobSpringIntegrateTest.java | 10 +- .../AbstractOneOffJobSpringIntegrateTest.java | 12 +- ...bSpringNamespaceWithEventTraceRdbTest.java | 2 +- .../JobSpringNamespaceWithJobHandlerTest.java | 2 +- ...ringNamespaceWithListenerAndCglibTest.java | 2 +- ...aceWithListenerAndJdkDynamicProxyTest.java | 2 +- .../JobSpringNamespaceWithListenerTest.java | 2 +- .../job/JobSpringNamespaceWithRefTest.java | 8 +- .../job/JobSpringNamespaceWithTypeTest.java | 6 +- ...JobSpringNamespaceWithoutListenerTest.java | 2 +- ...bSpringNamespaceWithEventTraceRdbTest.java | 2 +- ...fJobSpringNamespaceWithJobHandlerTest.java | 2 +- ...ringNamespaceWithListenerAndCglibTest.java | 2 +- ...aceWithListenerAndJdkDynamicProxyTest.java | 2 +- ...OffJobSpringNamespaceWithListenerTest.java | 2 +- .../OneOffJobSpringNamespaceWithRefTest.java | 10 +- .../OneOffJobSpringNamespaceWithTypeTest.java | 8 +- ...JobSpringNamespaceWithoutListenerTest.java | 2 +- .../AbstractJobSpringIntegrateTest.java | 8 +- .../namespace/scanner/JobScannerTest.java | 2 +- .../SnapshotSpringNamespaceDisableTest.java | 6 +- .../SnapshotSpringNamespaceEnableTest.java | 4 +- .../namespace/snapshot/SocketUtils.java | 2 +- ...okeeperJUnitJupiterSpringContextTests.java | 2 +- .../EmbedZookeeperTestExecutionListener.java | 2 +- .../src/test/resources/META-INF/job/base.xml | 2 +- .../META-INF/job/oneOffWithEventTraceRdb.xml | 4 +- .../META-INF/job/oneOffWithJobHandler.xml | 4 +- .../META-INF/job/oneOffWithJobRef.xml | 4 +- .../META-INF/job/oneOffWithJobType.xml | 0 .../META-INF/job/oneOffWithListener.xml | 4 +- .../job/oneOffWithListenerAndCglib.xml | 6 +- .../oneOffWithListenerAndJdkDynamicProxy.xml | 6 +- .../META-INF/job/oneOffWithoutListener.xml | 4 +- .../META-INF/job/withEventTraceRdb.xml | 4 +- .../resources/META-INF/job/withJobHandler.xml | 4 +- .../resources/META-INF/job/withJobRef.xml | 4 +- .../resources/META-INF/job/withJobType.xml | 0 .../resources/META-INF/job/withListener.xml | 4 +- .../META-INF/job/withListenerAndCglib.xml | 6 +- .../job/withListenerAndJdkDynamicProxy.xml | 6 +- .../META-INF/job/withoutListener.xml | 4 +- .../resources/META-INF/reg/regContext.xml | 0 .../META-INF/scanner/jobScannerContext.xml | 2 +- ...asticjob.infra.listener.ElasticJobListener | 8 +- .../META-INF/snapshot/snapshotDisabled.xml | 0 .../META-INF/snapshot/snapshotEnabled.xml | 0 .../test/resources/conf/job/conf.properties | 4 +- .../test/resources/conf/reg/conf.properties | 0 .../src/test/resources/logback-test.xml | 0 .../src/test/resources/script/demo.bat | 0 .../src/test/resources/script/demo.sh | 0 .../elasticjob-engine-spring}/pom.xml | 10 +- .../pom.xml | 8 +- .../src/test/resources/logback-test.xml | 2 +- .../src/test/resources/logback-test.xml | 2 +- examples/elasticjob-example-cloud/pom.xml | 82 --- .../elasticjob-example-cloud/src/README.txt | 41 -- .../cloud/example/CloudJobMain.java | 29 -- .../resources/META-INF/applicationContext.xml | 14 - .../src/main/resources/assembly/assembly.xml | 25 - .../src/main/resources/bin/start.sh | 2 - .../src/main/resources/logback.xml | 23 - .../src/main/resources/script/demo.sh | 2 - .../example/EmbedZookeeperServer.java | 2 +- examples/elasticjob-example-jobs/pom.xml | 2 +- .../lite/example/fixture/entity/Foo.java | 2 +- .../fixture/repository/FooRepository.java | 4 +- .../repository/FooRepositoryFactory.java | 2 +- .../example/job/dataflow/JavaDataflowJob.java | 8 +- .../job/dataflow/SpringDataflowJob.java | 6 +- .../example/job/simple/JavaOccurErrorJob.java | 2 +- .../example/job/simple/JavaSimpleJob.java | 8 +- .../example/job/simple/SpringSimpleJob.java | 6 +- examples/elasticjob-example-lite-java/pom.xml | 2 +- .../elasticjob/lite/example/JavaMain.java | 12 +- .../elasticjob-example-lite-spring/pom.xml | 2 +- .../elasticjob/lite/example/SpringMain.java | 2 +- .../META-INF/application-context.xml | 14 +- .../pom.xml | 2 +- .../example/SpringBootMain.java | 2 +- .../controller/OneOffJobController.java | 4 +- .../{lite => engine}/example/entity/Foo.java | 2 +- .../example/job/SpringBootDataflowJob.java | 6 +- ...SpringBootOccurErrorNoticeDingtalkJob.java | 2 +- .../SpringBootOccurErrorNoticeEmailJob.java | 2 +- .../SpringBootOccurErrorNoticeWechatJob.java | 2 +- .../example/job/SpringBootSimpleJob.java | 6 +- .../example/repository/FooRepository.java | 4 +- .../src/main/resources/application.yml | 12 +- examples/pom.xml | 14 +- pom.xml | 17 +- 646 files changed, 1670 insertions(+), 22747 deletions(-) delete mode 100644 docs/content/features/resource.cn.md delete mode 100644 docs/content/features/resource.en.md delete mode 100644 docs/content/quick-start/elasticjob-cloud.cn.md delete mode 100644 docs/content/quick-start/elasticjob-cloud.en.md delete mode 100644 docs/content/quick-start/elasticjob-lite.cn.md delete mode 100644 docs/content/quick-start/elasticjob-lite.en.md rename docs/content/user-manual/{elasticjob-lite => }/configuration/_index.cn.md (62%) create mode 100644 docs/content/user-manual/configuration/_index.en.md rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/_index.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/_index.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/error-handler.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/error-handler.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/sharding.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/sharding.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/thread-pool.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/built-in-strategy/thread-pool.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/java-api.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/java-api.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/props.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/props.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/spring-boot-starter.cn.md (57%) rename docs/content/user-manual/{elasticjob-lite => }/configuration/spring-boot-starter.en.md (82%) create mode 100644 docs/content/user-manual/configuration/spring-namespace.cn.md rename docs/content/user-manual/{elasticjob-lite => }/configuration/spring-namespace.en.md (71%) delete mode 100644 docs/content/user-manual/elasticjob-cloud/_index.cn.md delete mode 100644 docs/content/user-manual/elasticjob-cloud/_index.en.md delete mode 100644 docs/content/user-manual/elasticjob-cloud/configuration/_index.cn.md delete mode 100644 docs/content/user-manual/elasticjob-cloud/configuration/_index.en.md delete mode 100644 docs/content/user-manual/elasticjob-cloud/operation/_index.cn.md delete mode 100644 docs/content/user-manual/elasticjob-cloud/operation/_index.en.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.cn.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.en.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/operation/high-availability.cn.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/operation/high-availability.en.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/operation/web-console.cn.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/operation/web-console.en.md delete mode 100644 docs/content/user-manual/elasticjob-cloud/usage/_index.cn.md delete mode 100644 docs/content/user-manual/elasticjob-cloud/usage/_index.en.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/usage/dev-guide.cn.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/usage/dev-guide.en.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/usage/local-executor.cn.md delete mode 100755 docs/content/user-manual/elasticjob-cloud/usage/local-executor.en.md delete mode 100644 docs/content/user-manual/elasticjob-lite/_index.cn.md delete mode 100644 docs/content/user-manual/elasticjob-lite/_index.en.md delete mode 100644 docs/content/user-manual/elasticjob-lite/configuration/_index.en.md delete mode 100644 docs/content/user-manual/elasticjob-lite/configuration/spring-namespace.cn.md delete mode 100644 docs/content/user-manual/elasticjob-lite/usage/job-api/_index.cn.md delete mode 100644 docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.cn.md delete mode 100644 docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.en.md rename docs/content/user-manual/{elasticjob-lite => }/operation/_index.cn.md (59%) rename docs/content/user-manual/{elasticjob-lite => }/operation/_index.en.md (57%) rename docs/content/user-manual/{elasticjob-lite => }/operation/deploy-guide.cn.md (63%) rename docs/content/user-manual/{elasticjob-lite => }/operation/deploy-guide.en.md (69%) rename docs/content/user-manual/{elasticjob-lite => }/operation/dump.cn.md (79%) rename docs/content/user-manual/{elasticjob-lite => }/operation/dump.en.md (87%) rename docs/content/user-manual/{elasticjob-lite => }/operation/execution-monitor.cn.md (66%) rename docs/content/user-manual/{elasticjob-lite => }/operation/execution-monitor.en.md (80%) rename docs/content/user-manual/{elasticjob-lite => }/operation/web-console.cn.md (84%) rename docs/content/user-manual/{elasticjob-lite => }/operation/web-console.en.md (85%) rename docs/content/user-manual/{elasticjob-lite => }/usage/_index.cn.md (79%) rename docs/content/user-manual/{elasticjob-lite => }/usage/_index.en.md (77%) create mode 100644 docs/content/user-manual/usage/job-api/_index.cn.md rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/_index.en.md (54%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/java-api.cn.md (86%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/java-api.en.md (93%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/job-interface.cn.md (96%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/job-interface.en.md (95%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/spring-boot-starter.cn.md (73%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/spring-boot-starter.en.md (71%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/spring-namespace.cn.md (80%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-api/spring-namespace.en.md (94%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/_index.cn.md (76%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/_index.en.md (76%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/java-api.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/java-api.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/listener-interface.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/listener-interface.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/spring-namespace.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/job-listener/spring-namespace.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/operation-api/_index.cn.md (82%) rename docs/content/user-manual/{elasticjob-lite => }/usage/operation-api/_index.en.md (83%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/_index.cn.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/_index.en.md (100%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/java-api.cn.md (85%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/java-api.en.md (85%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/spring-boot-starter.cn.md (84%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/spring-boot-starter.en.md (84%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/spring-namespace.cn.md (95%) rename docs/content/user-manual/{elasticjob-lite => }/usage/tracing/spring-namespace.en.md (96%) create mode 100644 docs/content/user-manual/usage/tracing/table-structure.cn.md create mode 100644 docs/content/user-manual/usage/tracing/table-structure.en.md delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/pom.xml delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobExecutionTypeStatistics.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRegisterStatistics.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRunningStatistics.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskResultStatistics.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskRunningStatistics.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/pom.xml delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutor.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-executor/src/test/resources/logback-test.xml delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/ConsoleBootstrap.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/advice/ConsoleExceptionHandler.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/serializer/JsonResponseBodySerializer.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppController.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobController.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationController.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationConstants.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationFilter.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationInfo.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/Bootstrap.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfiguration.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListener.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContext.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/FrameworkConfiguration.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/MesosConfiguration.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/RestfulServerConfiguration.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/HttpClientException.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/HANode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluator.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueue.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionType.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoData.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepository.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/StateNode.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListener.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppService.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListener.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverTaskInfo.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManager.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/AbstractStatisticJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/StatisticJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtils.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/HttpClientUtils.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtils.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/conf/elasticjob-cloud-scheduler.properties delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/logback.xml delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/HttpTestUtil.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJsonConstants.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TestSimpleJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/master/MesosMasterServerMock.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/slave/MesosSlaveServerMock.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java delete mode 100644 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java delete mode 100755 elasticjob-cloud/elasticjob-cloud-scheduler/src/test/resources/logback-test.xml delete mode 100644 elasticjob-cloud/pom.xml rename elasticjob-distribution/{elasticjob-lite-distribution => elasticjob-bin-distribution}/pom.xml (92%) rename elasticjob-distribution/{elasticjob-lite-distribution/src/main/assembly/elasticjob-lite-binary-distribution.xml => elasticjob-bin-distribution/src/main/assembly/elasticjob-binary-distribution.xml} (96%) rename elasticjob-distribution/{elasticjob-cloud-executor-distribution => elasticjob-bin-distribution}/src/main/release-docs/README.txt (85%) delete mode 100644 elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml delete mode 100644 elasticjob-distribution/elasticjob-cloud-executor-distribution/src/main/assembly/elasticjob-cloud-binary-distribution.xml delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/Dockerfile delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/NOTICE delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/README.txt delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-checker-framework.txt delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jcl-over-slf4j.txt delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jul-to-slf4j.txt delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-logback.txt delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-mchange-commons.txt delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-slf4j.txt delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/dcos.sh delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/start.sh delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/conf/elasticjob-cloud-scheduler.properties delete mode 100644 elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/logback.xml delete mode 100644 elasticjob-distribution/elasticjob-lite-distribution/src/main/release-docs/README.txt rename {elasticjob-lite/elasticjob-lite-core => elasticjob-engine/elasticjob-engine-core}/pom.xml (97%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/api/bootstrap/JobBootstrap.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/api/bootstrap/impl/OneOffJobBootstrap.java (86%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/api/bootstrap/impl/ScheduleJobBootstrap.java (88%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/api/listener/AbstractDistributeOnceElasticJobListener.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/api/registry/JobInstanceRegistry.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/annotation/JobAnnotationBuilder.java (98%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/config/ConfigurationNode.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/config/ConfigurationService.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/config/RescheduleListenerManager.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/election/ElectionListenerManager.java (89%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/election/LeaderNode.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/election/LeaderService.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/failover/FailoverListenerManager.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/failover/FailoverNode.java (89%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/failover/FailoverService.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/guarantee/GuaranteeListenerManager.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/guarantee/GuaranteeNode.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/guarantee/GuaranteeService.java (95%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/instance/InstanceNode.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/instance/InstanceService.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/instance/ShutdownListenerManager.java (89%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/listener/AbstractListenerManager.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/listener/ListenerManager.java (79%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/listener/ListenerNotifierManager.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/listener/RegistryCenterConnectionStateListener.java (81%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/reconcile/ReconcileService.java (89%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobRegistry.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobScheduleController.java (98%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobScheduler.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobShutdownHookPlugin.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobTriggerListener.java (85%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/LiteJob.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/LiteJobFacade.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/SchedulerFacade.java (85%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/server/ServerNode.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/server/ServerService.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/server/ServerStatus.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/setup/DefaultJobClassNameProvider.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/setup/JobClassNameProvider.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/setup/JobClassNameProviderFactory.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/setup/SetUpFacade.java (85%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ExecutionContextService.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ExecutionService.java (95%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/MonitorExecutionListenerManager.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ShardingListenerManager.java (86%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ShardingNode.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ShardingService.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/snapshot/SnapshotService.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/storage/JobNodePath.java (98%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/storage/JobNodeStorage.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/trigger/TriggerListenerManager.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/trigger/TriggerNode.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/trigger/TriggerService.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/internal/util/SensitiveInfoUtils.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/api/bootstrap/impl/OneOffJobBootstrapTest.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/api/listener/DistributeOnceElasticJobListenerTest.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/api/listener/fixture/ElasticJobListenerCaller.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/api/listener/fixture/TestDistributeOnceElasticJobListener.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/api/listener/fixture/TestElasticJobListener.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/api/registry/JobInstanceRegistryTest.java (98%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/fixture/EmbedTestingServer.java (98%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/fixture/LiteYamlConstants.java (98%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/fixture/executor/ClassedFooJobExecutor.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/fixture/job/AnnotationSimpleJob.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/fixture/job/AnnotationUnShardingJob.java (95%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/fixture/job/DetailedFooJob.java (95%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/fixture/job/FooJob.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/BaseIntegrateTest.java (84%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/disable/DisabledJobIntegrateTest.java (85%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/disable/OneOffDisabledJobIntegrateTest.java (95%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/disable/ScheduleDisabledJobIntegrateTest.java (89%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/enable/EnabledJobIntegrateTest.java (88%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/enable/OneOffEnabledJobIntegrateTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/enable/ScheduleEnabledJobIntegrateTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/listener/TestDistributeOnceElasticJobListener.java (88%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/integrate/listener/TestElasticJobListener.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/annotation/JobAnnotationBuilderTest.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/annotation/integrate/BaseAnnotationTest.java (82%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/annotation/integrate/OneOffEnabledJobTest.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/annotation/integrate/ScheduleEnabledJobTest.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/config/ConfigurationNodeTest.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/config/ConfigurationServiceTest.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/config/RescheduleListenerManagerTest.java (89%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/election/ElectionListenerManagerTest.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/election/LeaderNodeTest.java (95%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/election/LeaderServiceTest.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/failover/FailoverListenerManagerTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/failover/FailoverNodeTest.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/failover/FailoverServiceTest.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/guarantee/GuaranteeListenerManagerTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/guarantee/GuaranteeNodeTest.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/guarantee/GuaranteeServiceTest.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/instance/InstanceNodeTest.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/instance/InstanceServiceTest.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/instance/ShutdownListenerManagerTest.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/listener/ListenerManagerTest.java (79%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/listener/ListenerNotifierManagerTest.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/listener/RegistryCenterConnectionStateListenerTest.java (88%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/reconcile/ReconcileServiceTest.java (89%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobRegistryTest.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobScheduleControllerTest.java (98%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/JobTriggerListenerTest.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/LiteJobFacadeTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/schedule/SchedulerFacadeTest.java (90%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/server/ServerNodeTest.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/server/ServerServiceTest.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/setup/DefaultJobClassNameProviderTest.java (84%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/setup/JobClassNameProviderFactoryTest.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/setup/SetUpFacadeTest.java (82%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ExecutionContextServiceTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ExecutionServiceTest.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/MonitorExecutionListenerManagerTest.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ShardingListenerManagerTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ShardingNodeTest.java (95%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/sharding/ShardingServiceTest.java (94%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/snapshot/BaseSnapshotServiceTest.java (87%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/snapshot/SnapshotServiceDisableTest.java (93%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/snapshot/SnapshotServiceEnableTest.java (92%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/snapshot/SocketUtils.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/storage/JobNodePathTest.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/storage/JobNodeStorageTest.java (97%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/trigger/TriggerListenerManagerTest.java (91%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/internal/util/SensitiveInfoUtilsTest.java (96%) rename {elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/util/ReflectionUtils.java (97%) rename {elasticjob-lite/elasticjob-lite-core => elasticjob-engine/elasticjob-engine-core}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (90%) rename {elasticjob-lite/elasticjob-lite-core => elasticjob-engine/elasticjob-engine-core}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (72%) rename {elasticjob-lite/elasticjob-lite-core => elasticjob-engine/elasticjob-engine-core}/src/test/resources/logback-test.xml (89%) rename {elasticjob-lite/elasticjob-lite-lifecycle => elasticjob-engine/elasticjob-engine-lifecycle}/pom.xml (93%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/JobAPIFactory.java (84%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/JobConfigurationAPI.java (95%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/JobOperateAPI.java (97%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/JobStatisticsAPI.java (91%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/ServerStatisticsAPI.java (88%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/ShardingOperateAPI.java (94%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/ShardingStatisticsAPI.java (88%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/domain/JobBriefInfo.java (95%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/domain/ServerBriefInfo.java (96%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/domain/ShardingInfo.java (96%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/operate/JobOperateAPIImpl.java (92%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/operate/ShardingOperateAPIImpl.java (88%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/reg/RegistryCenterFactory.java (97%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/settings/JobConfigurationAPIImpl.java (90%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/statistics/JobStatisticsAPIImpl.java (95%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java (91%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java (90%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/AbstractEmbedZookeeperBaseTest.java (98%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/api/JobAPIFactoryTest.java (93%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/domain/ShardingStatusTest.java (96%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/fixture/LifecycleYamlConstants.java (97%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/operate/JobOperateAPIImplTest.java (98%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/operate/ShardingOperateAPIImplTest.java (91%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/reg/RegistryCenterFactoryTest.java (94%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/settings/JobConfigurationAPIImplTest.java (95%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java (96%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java (94%) rename {elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine}/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java (95%) rename {elasticjob-lite/elasticjob-lite-lifecycle => elasticjob-engine/elasticjob-engine-lifecycle}/src/test/resources/logback-test.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/README.md (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/pom.xml (93%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ElasticJobBootstrapConfiguration.java (96%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ElasticJobConfigurationProperties.java (97%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ElasticJobLiteAutoConfiguration.java (81%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ElasticJobProperties.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ScheduleJobBootstrapStartupRunner.java (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/reg/ZookeeperProperties.java (97%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java (92%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/reg/snapshot/SnapshotServiceProperties.java (93%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/tracing/ElasticJobTracingConfiguration.java (97%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/tracing/TracingProperties.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/main/resources/META-INF/additional-spring-configuration-metadata.json (77%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/main/resources/META-INF/spring.factories (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/main/resources/META-INF/spring.provides (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (89%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ElasticJobConfigurationPropertiesTest.java (98%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ElasticJobSpringBootScannerTest.java (81%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/ElasticJobSpringBootTest.java (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/executor/CustomClassedJobExecutor.java (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/executor/PrintJobExecutor.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/executor/PrintJobProperties.java (92%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/fixture/EmbedTestingServer.java (98%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/fixture/job/CustomJob.java (93%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/fixture/job/impl/CustomTestJob.java (86%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/fixture/listener/LogElasticJobListener.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/fixture/listener/NoopElasticJobListener.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/repository/BarRepository.java (92%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/job/repository/impl/BarRepositoryImpl.java (86%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/reg/ZookeeperPropertiesTest.java (97%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java (86%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/boot/tracing/TracingConfigurationTest.java (92%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (89%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (79%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/test/resources/application-elasticjob.yml (85%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/test/resources/application-snapshot.yml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/test/resources/application-tracing.yml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter}/src/test/resources/logback-test.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core}/pom.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/scanner/ClassPathJobScanner.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/scanner/ElasticJobScan.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/scanner/ElasticJobScanRegistrar.java (97%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/scanner/JobScannerConfiguration.java (96%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/setup/SpringProxyJobClassNameProvider.java (86%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/util/AopTargetUtils.java (97%) rename elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProvider => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider (89%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/setup/JobClassNameProviderFactoryTest.java (87%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/util/AopTargetUtilsTest.java (96%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/core/util/TargetJob.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core}/src/test/resources/META-INF/logback-test.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/pom.xml (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/ElasticJobNamespaceHandler.java (70%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/parser/JobBeanDefinitionParser.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/tag/JobBeanDefinitionTag.java (97%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java (85%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java (92%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java (86%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java (93%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java (92%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/main/resources/META-INF/namespace/elasticjob.xsd (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/main/resources/META-INF/spring.handlers (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/main/resources/META-INF/spring.schemas (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/aspect/SimpleAspect.java (92%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/job/DataflowElasticJob.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/job/FooSimpleElasticJob.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java (88%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/listener/SimpleCglibListener.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/listener/SimpleListener.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/listener/SimpleOnceListener.java (88%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/service/FooService.java (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/fixture/service/FooServiceImpl.java (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/AbstractJobSpringIntegrateTest.java (85%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java (84%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithListenerTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithRefTest.java (85%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithTypeTest.java (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java (84%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java (85%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java (84%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/scanner/JobScannerTest.java (93%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java (82%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java (86%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/snapshot/SocketUtils.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine}/spring/namespace/test/EmbedZookeeperTestExecutionListener.java (98%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/base.xml (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithJobHandler.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithJobRef.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithJobType.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithListener.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/oneOffWithoutListener.xml (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withEventTraceRdb.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withJobHandler.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withJobRef.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withJobType.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withListener.xml (94%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withListenerAndCglib.xml (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml (91%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/job/withoutListener.xml (95%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/reg/regContext.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/scanner/jobScannerContext.xml (96%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (66%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/snapshot/snapshotDisabled.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/META-INF/snapshot/snapshotEnabled.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/conf/job/conf.properties (90%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/conf/reg/conf.properties (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/logback-test.xml (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/script/demo.bat (100%) rename {elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace => elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace}/src/test/resources/script/demo.sh (100%) rename {elasticjob-lite/elasticjob-lite-spring => elasticjob-engine/elasticjob-engine-spring}/pom.xml (90%) rename {elasticjob-lite => elasticjob-engine}/pom.xml (87%) delete mode 100755 examples/elasticjob-example-cloud/pom.xml delete mode 100755 examples/elasticjob-example-cloud/src/README.txt delete mode 100755 examples/elasticjob-example-cloud/src/main/java/org/apache/shardingsphere/elasticjob/cloud/example/CloudJobMain.java delete mode 100755 examples/elasticjob-example-cloud/src/main/resources/META-INF/applicationContext.xml delete mode 100755 examples/elasticjob-example-cloud/src/main/resources/assembly/assembly.xml delete mode 100755 examples/elasticjob-example-cloud/src/main/resources/bin/start.sh delete mode 100755 examples/elasticjob-example-cloud/src/main/resources/logback.xml delete mode 100755 examples/elasticjob-example-cloud/src/main/resources/script/demo.sh rename examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/EmbedZookeeperServer.java (96%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/SpringBootMain.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/controller/OneOffJobController.java (93%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/entity/Foo.java (96%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/job/SpringBootDataflowJob.java (90%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/job/SpringBootOccurErrorNoticeDingtalkJob.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/job/SpringBootOccurErrorNoticeEmailJob.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/job/SpringBootOccurErrorNoticeWechatJob.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/job/SpringBootSimpleJob.java (89%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{lite => engine}/example/repository/FooRepository.java (93%) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index cfe90d867d..8432a76f1d 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -19,8 +19,6 @@ Please answer these questions before submitting your issue. Thanks! ### Which version of ElasticJob did you use? -### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud? - ### Expected behavior ### Actual behavior diff --git a/README.md b/README.md index adbdfc16bf..7e97dd8749 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ [![Stargazers over time](https://starchart.cc/apache/shardingsphere-elasticjob.svg)](https://starchart.cc/apache/shardingsphere-elasticjob) -ElasticJob is a distributed scheduling solution consisting of two separate projects, ElasticJob-Lite and ElasticJob-Cloud. - Through the functions of flexible scheduling, resource management and job management, it creates a distributed scheduling solution suitable for Internet scenarios, and provides a diversified job ecosystem through open architecture design. @@ -31,24 +29,9 @@ You are welcome to communicate with the community via the [mailing list](mailto: Using ElasticJob developers can no longer worry about the non functional requirements such as job scale out, so that they can focus more on business coding. At the same time, it can release operators too, so that they do not have to worry about high availability and management, and can automatically operate by simply adding servers. -### ElasticJob-Lite - -A lightweight, decentralized solution that provides distributed task sharding services. - -![ElasticJob-Lite Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) - -### ElasticJob-Cloud +It is a lightweight, decentralized solution that provides distributed task sharding services. -Uses Mesos to manage and isolate resources. - -![ElasticJob-Cloud Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_cloud.png) - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| ----------------- | ----------------- | ------------------ | -| Decentralization | Yes | No | -| Resource Assign | No | Yes | -| Job Execution | Daemon | Daemon + Transient | -| Deploy Dependency | ZooKeeper | ZooKeeper + Mesos | +![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) ## Features @@ -94,7 +77,3 @@ Maven 3.5.0 or above required. ### ZooKeeper ZooKeeper 3.6.0 or above required. [See details](https://zookeeper.apache.org/) - -### Mesos (ElasticJob-Cloud only) - -Mesos 1.1.0 or compatible version required (For ElasticJob-Cloud only). [See details](https://mesos.apache.org/) diff --git a/README_ZH.md b/README_ZH.md index f294db35bd..b9874902eb 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -4,7 +4,7 @@ [![Stargazers over time](https://starchart.cc/apache/shardingsphere-elasticjob.svg)](https://starchart.cc/apache/shardingsphere-elasticjob) -ElasticJob 是面向互联网生态和海量任务的分布式调度解决方案,由两个相互独立的子项目 ElasticJob-Lite 和 ElasticJob-Cloud 组成。 +ElasticJob 是面向互联网生态和海量任务的分布式调度解决方案。 它通过弹性调度、资源管控、以及作业治理的功能,打造一个适用于互联网场景的分布式调度解决方案,并通过开放的架构设计,提供多元化的作业生态。 它的各个产品使用统一的作业 API,开发者仅需一次开发,即可随意部署。 @@ -24,25 +24,9 @@ ElasticJob 已于 2020 年 5 月 28 日成为 [Apache ShardingSphere](https://sh 使用 ElasticJob 能够让开发工程师不再担心任务的线性吞吐量提升等非功能需求,使他们能够更加专注于面向业务编码设计; 同时,它也能够解放运维工程师,使他们不必再担心任务的可用性和相关管理需求,只通过轻松的增加服务节点即可达到自动化运维的目的。 +它定位为轻量级无中心化解决方案,使用 jar 的形式提供分布式任务的协调服务。 -### ElasticJob-Lite - -定位为轻量级无中心化解决方案,使用 jar 的形式提供分布式任务的协调服务。 - -![ElasticJob-Lite Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) - -### ElasticJob-Cloud - -采用自研 Mesos Framework 的解决方案,额外提供资源治理、应用分发以及进程隔离等功能。 - -![ElasticJob-Cloud Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_cloud.png) - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| --------- | ----------------- | ------------------ | -| 无中心化 | 是 | 否 | -| 资源分配 | 不支持 | 支持 | -| 作业模式 | 常驻 | 常驻 + 瞬时 | -| 部署依赖 | ZooKeeper | ZooKeeper + Mesos | +![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) ## 功能列表 @@ -88,7 +72,3 @@ ElasticJob 已于 2020 年 5 月 28 日成为 [Apache ShardingSphere](https://sh ### ZooKeeper 请使用 ZooKeeper 3.6.0 及其以上版本。[详情参见](https://zookeeper.apache.org/) - -### Mesos(仅 ElasticJob-Cloud 使用) - -请使用 Mesos 1.1.0 及其兼容版本。[详情参见](https://mesos.apache.org/) diff --git a/docs/content/dev-manual/roadmap.cn.md b/docs/content/dev-manual/roadmap.cn.md index 21b0fcad46..6b1c2d60f3 100644 --- a/docs/content/dev-manual/roadmap.cn.md +++ b/docs/content/dev-manual/roadmap.cn.md @@ -5,8 +5,6 @@ weight = 5 chapter = true +++ -## Kernel - - [x] Unified Job Config API - [x] Core Config - [x] Type Config @@ -22,9 +20,6 @@ chapter = true - [ ] Other Event Listener - [ ] Unified Schedule API - [ ] Unified Resource API - -## ElasticJob-Lite - - [x] Distributed Features - [x] High Availability - [x] Elastic scale in/out @@ -49,49 +44,3 @@ chapter = true - [x] Namespace - [x] Bean Injection - [x] Spring Boot Starter(3.0.0-alpha 提供) - -## ElasticJob-Cloud -- [x] Transient Job - - [x] High Availability - - [x] Elastic scale in/out - - [x] Failover - - [x] Misfire - - [x] Idempotency -- [x] Daemon Job - - [x] High Availability - - [x] Elastic scale in/out - - [ ] Failover - - [ ] Misfire - - [x] Idempotency -- [x] Mesos Scheduler - - [x] High Availability - - [x] Reconcile - - [ ] Redis Based Queue Improvement - - [ ] Http Driver -- [x] Mesos Executor - - [x] Executor Reuse Pool - - [ ] Progress Reporting - - [ ] Health Detection - - [ ] Log Redirect -- [x] Lifecycle Management - - [x] Job Add/Remove - - [ ] Job Pause/Resume - - [x] Job Disable/Enable - - [ ] Job Shutdown - - [x] App Add/Remove - - [x] App Disable/Enable - - [x] Restful API - - [x] Web Console -- [ ] Job Dependency - - [ ] Listener - - [ ] Workflow - - [ ] DAG -- [x] Job Distribution - - [x] Mesos Based Distribution - - [ ] Docker Based Distribution -- [x] Resources Management - - [x] Resources Allocate - - [ ] Cross Data Center - - [ ] A/B Test -- [x] Spring Integrate - - [x] Bean Injection diff --git a/docs/content/dev-manual/roadmap.en.md b/docs/content/dev-manual/roadmap.en.md index 3cc304b442..ebc983293e 100644 --- a/docs/content/dev-manual/roadmap.en.md +++ b/docs/content/dev-manual/roadmap.en.md @@ -5,8 +5,6 @@ weight = 5 chapter = true +++ -## Kernel - - [x] Unified Job Config API - [x] Core Config - [x] Type Config @@ -22,9 +20,6 @@ chapter = true - [ ] Other Event Listener - [ ] Unified Schedule API - [ ] Unified Resource API - -## ElasticJob-Lite - - [x] Distributed Features - [x] High Availability - [x] Elastic scale in/out @@ -49,49 +44,3 @@ chapter = true - [x] Namespace - [x] Bean Injection - [x] Spring Boot Starter (Since 3.0.0-alpha) - -## ElasticJob-Cloud -- [x] Transient Job - - [x] High Availability - - [x] Elastic scale in/out - - [x] Failover - - [x] Misfire - - [x] Idempotency -- [x] Daemon Job - - [x] High Availability - - [x] Elastic scale in/out - - [ ] Failover - - [ ] Misfire - - [x] Idempotency -- [x] Mesos Scheduler - - [x] High Availability - - [x] Reconcile - - [ ] Redis Based Queue Improvement - - [ ] Http Driver -- [x] Mesos Executor - - [x] Executor Reuse Pool - - [ ] Progress Reporting - - [ ] Health Detection - - [ ] Log Redirect -- [x] Lifecycle Management - - [x] Job Add/Remove - - [ ] Job Pause/Resume - - [x] Job Disable/Enable - - [ ] Job Shutdown - - [x] App Add/Remove - - [x] App Disable/Enable - - [x] Restful API - - [x] Web Console -- [ ] Job Dependency - - [ ] Listener - - [ ] Workflow - - [ ] DAG -- [x] Job Distribution - - [x] Mesos Based Distribution - - [ ] Docker Based Distribution -- [x] Resources Management - - [x] Resources Allocate - - [ ] Cross Data Center - - [ ] A/B Test -- [x] Spring Integrate - - [x] Bean Injection diff --git a/docs/content/downloads/_index.cn.md b/docs/content/downloads/_index.cn.md index 776de91a22..fb618730b7 100644 --- a/docs/content/downloads/_index.cn.md +++ b/docs/content/downloads/_index.cn.md @@ -16,15 +16,12 @@ ElasticJob 的发布版包括源码包及其对应的二进制包。 ##### ElasticJob - 版本: 3.0.3 ( 发布日期: Mar 31, 2023 ) - 源码: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.sha512) ] -- ElasticJob-Lite 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Scheduler 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Executor 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.sha512) ] +- ElasticJob 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] ##### ElasticJob-UI - 版本: 3.0.2 ( 发布日期: Oct 31, 2022 ) - 源码: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-ui-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-ui-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-ui-src.zip.sha512) ] -- ElasticJob-Lite-UI 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-UI 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-ui-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-ui-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-ui-bin.tar.gz.sha512) ] +- ElasticJob-UI 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.sha512) ] 即将发布 diff --git a/docs/content/downloads/_index.en.md b/docs/content/downloads/_index.en.md index 34cf23c79a..3f98eae068 100644 --- a/docs/content/downloads/_index.en.md +++ b/docs/content/downloads/_index.en.md @@ -16,15 +16,12 @@ The downloads are distributed via mirror sites and should be checked for tamperi ##### ElasticJob - Version: 3.0.3 ( Release Date: Mar 31, 2023 ) - Source Codes: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.sha512) ] -- ElasticJob-Lite Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Scheduler Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-scheduler-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-Executor Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-cloud-executor-bin.tar.gz.sha512) ] +- ElasticJob Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] ##### ElasticJob-UI - Version: 3.0.2 ( Release Date: Oct 31, 2022 ) - Source Codes: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-ui-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-ui-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-ui-src.zip.sha512) ] -- ElasticJob-Lite-UI Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.sha512) ] -- ElasticJob-Cloud-UI Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-ui-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-ui-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-cloud-ui-bin.tar.gz.sha512) ] +- ElasticJob-UI Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-ui-3.0.2/apache-shardingsphere-elasticjob-3.0.2-lite-ui-bin.tar.gz.sha512) ] ## All Releases diff --git a/docs/content/faq/_index.cn.md b/docs/content/faq/_index.cn.md index 18cd5dbe09..66e8326067 100644 --- a/docs/content/faq/_index.cn.md +++ b/docs/content/faq/_index.cn.md @@ -17,13 +17,9 @@ ElasticJob 使用 lombok 实现极简代码。关于更多使用和安装细节 动态添加作业这个概念每个人理解不尽相同。 -ElasticJob-Lite 为 jar 包,由开发或运维人员负责启动。启动时自动向注册中心注册作业信息并进行分布式协调,因此并不需要手工在注册中心填写作业信息。 +ElasticJob 为 jar 包,由开发或运维人员负责启动。启动时自动向注册中心注册作业信息并进行分布式协调,因此并不需要手工在注册中心填写作业信息。 但注册中心与作业部署机无从属关系,注册中心并不能控制将单点的作业分发至其他作业机,也无法将远程服务器未启动的作业启动。 -ElasticJob-Lite 并不会包含 ssh 免密管理等功能。 - -ElasticJob-Cloud 为 mesos 框架,由 mesos 负责作业启动和分发。 -但需要将作业打包上传,并调用 ElasticJob-Cloud 提供的 RESTful API 写入注册中心。 -打包上传属于部署系统的范畴 ElasticJob-Cloud 并未涉及。 +ElasticJob 并不会包含 ssh 免密管理等功能。 综上所述,ElasticJob 已做了基本动态添加功能,但无法做到真正意义的完全自动化添加。 @@ -31,9 +27,9 @@ ElasticJob-Cloud 为 mesos 框架,由 mesos 负责作业启动和分发。 回答: -ElasticJob-Lite 采用无中心化设计,若每个客户端的配置不一致,不做控制的话,最后一个启动的客户端配置将会成为注册中心的最终配置。 +ElasticJob 采用无中心化设计,若每个客户端的配置不一致,不做控制的话,最后一个启动的客户端配置将会成为注册中心的最终配置。 -ElasticJob-Lite 提出了 overwrite 概念,可通过 JobConfiguration 或 Spring 命名空间配置。 +ElasticJob 提出了 overwrite 概念,可通过 JobConfiguration 或 Spring 命名空间配置。 `overwrite=true` 即允许客户端配置覆盖注册中心,反之则不允许。 如果注册中心无相关作业的配置,则无论 overwrite 是否配置,客户端配置都将写入注册中心。 @@ -45,7 +41,7 @@ ElasticJob-Lite 提出了 overwrite 概念,可通过 JobConfiguration 或 Spri 这样做的目的是为了防止作业重分片时,将与注册中心失去联系的节点执行的分片分配给另外节点,导致同一分片在两个节点中同时执行。 当作业节点恢复与注册中心联系时,将重新参与分片并恢复执行新的分配到的分片。 -## 5. ElasticJob-Lite 有何使用限制? +## 5. ElasticJob 有何使用限制? 回答: @@ -55,46 +51,34 @@ ElasticJob-Lite 提出了 overwrite 概念,可通过 JobConfiguration 或 Spri * 开启 monitorExecution 才能实现分布式作业幂等性(即不会在多个作业服务器运行同一个分片)的功能,但 monitorExecution 对短时间内执行的作业(如秒级触发)性能影响较大,建议关闭并自行实现幂等性。 -## 6. 怀疑 ElasticJob-Lite 在分布式环境中有问题,但无法重现又不能在线上环境调试,应该怎么做? +## 6. 怀疑 ElasticJob 在分布式环境中有问题,但无法重现又不能在线上环境调试,应该怎么做? 回答: -分布式问题非常难于调试和重现,为此 ElasticJob-Lite 提供了 dump 命令。 +分布式问题非常难于调试和重现,为此 ElasticJob 提供了 dump 命令。 -如果您怀疑某些场景出现问题,可参照[作业信息导出](/cn/user-manual/elasticjob-lite/operation/dump/)将作业运行时信息提交至社区。 +如果您怀疑某些场景出现问题,可参照[作业信息导出](/cn/user-manual/elasticjob/operation/dump/)将作业运行时信息提交至社区。 ElasticJob 已将 IP 地址等敏感信息过滤,导出的信息可在公网安全传输。 -## 7. ElasticJob-Cloud 有何使用限制? - -回答: - -* 作业启动成功后修改作业名称视为新作业,原作业废弃。 - -## 8. 在 ElasticJob-Cloud 中添加任务后,为什么任务一直在 ready 状态,而不开始执行? - -回答: - -任务在 mesos 有单独的 agent 可提供所需的资源时才会启动,否则会等待直到有足够的资源。 - -## 9. 控制台界面无法正常显示? +## 7. 控制台界面无法正常显示? 回答: 使用控制台时应确保与 ElasticJob 相关版本保持一致,否则会导致不可用。 -## 10. 为什么控制台界面中的作业状态是分片待调整? +## 8. 为什么控制台界面中的作业状态是分片待调整? 回答: 分片待调整表示作业已启动但尚未获得分片时的状态。 -## 11. 为什么首次启动存在任务调度延迟的情况? +## 9. 为什么首次启动存在任务调度延迟的情况? 回答: ElasticJob 执行任务会获取本机IP,首次可能存在获取IP较慢的情况。尝试设置 `-Djava.net.preferIPv4Stack=true`. -## 12. Windows环境下,运行ShardingSphere-ElasticJob-UI,找不到或无法加载主类 org.apache.shardingsphere.elasticjob.lite.ui.Bootstrap,如何解决? +## 10. Windows环境下,运行ShardingSphere-ElasticJob-UI,找不到或无法加载主类 org.apache.shardingsphere.elasticjob.engine.ui.Bootstrap,如何解决? 回答: @@ -108,7 +92,7 @@ ElasticJob 执行任务会获取本机IP,首次可能存在获取IP较慢的 tar zxvf apache-shardingsphere-elasticjob-${RELEASE.VERSION}-lite-ui-bin.tar.gz ``` -## 13. 运行 Cloud Scheduler 持续输出日志 "Elastic job: IP:PORT has leadership",不能正常运行 +## 11. 运行 Cloud Scheduler 持续输出日志 "Elastic job: IP:PORT has leadership",不能正常运行 回答: @@ -118,7 +102,7 @@ Cloud Scheduler 依赖 Mesos 库,启动时需要通过 `-Djava.library.path` Mesos 相关请参考 [Apache Mesos](https://mesos.apache.org/)。 -## 14. 在多网卡的情况下无法获取到合适的 IP +## 12. 在多网卡的情况下无法获取到合适的 IP 回答: @@ -130,7 +114,7 @@ Mesos 相关请参考 [Apache Mesos](https://mesos.apache.org/)。 1. 指定IP地址 192.168.0.100:`-Delasticjob.preferred.network.ip=192.168.0.100`。 1. 泛指IP地址(正则表达式) 192.168.*:`-Delasticjob.preferred.network.ip=192.168.*`。 -## 15. zk授权升级,在滚动部署过程中出现实例假死,回退到历史版本也依然存在假死。 +## 13. zk授权升级,在滚动部署过程中出现实例假死,回退到历史版本也依然存在假死。 回答: @@ -147,4 +131,4 @@ xxxx-07-27 22:33:55.224 [DEBUG] [localhost-startStop-1-EventThread] [] [] [] - o 解决方案: 1.如果您在升级的过程中出现回退历史版本也依然假死的问题,建议删除zk上所有作业目录,之后再重启历史版本。 -2.计算出合理的作业执行间隙,比如晚上21:00-21:30作业不会触发,在此期间先将实例全部停止,然后将带密码的版本全部部署上线。 \ No newline at end of file +2.计算出合理的作业执行间隙,比如晚上21:00-21:30作业不会触发,在此期间先将实例全部停止,然后将带密码的版本全部部署上线。 diff --git a/docs/content/faq/_index.en.md b/docs/content/faq/_index.en.md index 976d2b8860..daebc029bc 100644 --- a/docs/content/faq/_index.en.md +++ b/docs/content/faq/_index.en.md @@ -17,13 +17,9 @@ Answer: For the concept of dynamically adding job, everyone has a different understanding. -`ElasticJob-Lite` is provided in jar package, which is started by developers or operation. When the job is started, it will automatically register job information to the registry center, and the registry center will perform distributed coordination, so there is no need to manually add job information in the registry center. +`ElasticJob` is provided in jar package, which is started by developers or operation. When the job is started, it will automatically register job information to the registry center, and the registry center will perform distributed coordination, so there is no need to manually add job information in the registry center. However, registry center has no affiliation with the job server, can't control the distribution of single-point jobs to other job machines, and also can't start the job of remote server. -`ElasticJob-Lite` doesn't support ssh secret management and other functions. - -`ElasticJob-Cloud` is a `mesos` framework, and `mesos` is responsible for job starting and distribution. -But you need to package the job and upload it, and call the `REST API` provided by `ElasticJob-Cloud` to write job information into the registry center. -Packaging and uploading job are the deployment system's functions, `ElasticJob-Cloud` does not support it. +`ElasticJob` doesn't support ssh secret management and other functions. In summary, `ElasticJob` has supported basic dynamically adding jobs, but it can't be fully automated. @@ -31,9 +27,9 @@ In summary, `ElasticJob` has supported basic dynamically adding jobs, but it can Answer: -`ElasticJob-Lite` adopts a decentralized design. If the configuration of each client is inconsistent and is not controlled, the configuration of the client which is last started will be the final configuration of the registry center. +`ElasticJob` adopts a decentralized design. If the configuration of each client is inconsistent and is not controlled, the configuration of the client which is last started will be the final configuration of the registry center. -`ElasticJob-Lite` proposes the concept of `overwrite`, which can be configured through `JobConfiguration` or `Spring` namespace. +`ElasticJob` proposes the concept of `overwrite`, which can be configured through `JobConfiguration` or `Spring` namespace. `overwrite=true` indicates that the client's configuration is allowed to override the registry center, and on the contrary is not allowed. If there is no configuration of related jobs in the registry center, regardless of whether the property of `overwrite` is configured, the client's configuration will be still written into the registry center. @@ -45,7 +41,7 @@ In order to ensure the consistency of the job in the distributed system, once th The purpose of this is to prevent the assignment of the shards executed by the node that has lost contact with the registry center to another node when the job is re-sharded, causing the same shard to be executed on both nodes at the same time. When the node resumes contact with the registry center, it will re-participate in the sharding and resume execution of the newly shard. -## 5. What are the usage restrictions of `ElasticJob-Lite`? +## 5. What are the usage restrictions of `ElasticJob`? Answer: @@ -55,47 +51,35 @@ Answer: * Enable `monitorExecution` to realize the function of distributed job idempotence (that is, the same shard will not be run on different job servers), but `monitorExecution` has a greater impact on the performance of jobs executed in a short period of time (such as second-level triggers). It is recommended to turn it off and realize idempotence by yourself. -## 6. What should you do if you suspect that `ElasticJob-Lite` has a problem in a distributed environment, but it cannot be reproduced and cannot be debugged in the online environment? +## 6. What should you do if you suspect that `ElasticJob` has a problem in a distributed environment, but it cannot be reproduced and cannot be debugged in the online environment? Answer: -Distributed problems are very difficult to debug and reproduce. For this reason, `ElasticJob-Lite` provides the `dump` command. +Distributed problems are very difficult to debug and reproduce. For this reason, `ElasticJob` provides the `dump` command. -If you suspect a problem in some scenarios, you can refer to the [dump](/en/user-manual/elasticjob-lite/operation/dump/) document to submit the job runtime information to the community. +If you suspect a problem in some scenarios, you can refer to the [dump](/en/user-manual/elasticjob/operation/dump/) document to submit the job runtime information to the community. `ElasticJob` has filtered sensitive information such as `IP`, and the dump file can be safely transmitted on the Internet. -## 7. What are the usage restrictions of `ElasticJob-Cloud`? - -Answer: - -* After the job start successfully, modifying the job name is regarded as a new job, and the original job is discarded. - -## 8. When add a task in the `ElasticJob-Cloud`, why does it remain in the ready state, but doesn't start? - -Answer: - -The task will start when `mesos` has a separate `agent` that can provide the required resources, otherwise it will wait until there are enough resources. - -## 9. Why can't the Console page display normally? +## 7. Why can't the Console page display normally? Answer: Make sure that the `Web Console`'s version is consistent with `ElasticJob`, otherwise it will become unavailable. -## 10. Why is the job state shard to be adjusted in the Console? +## 8. Why is the job state shard to be adjusted in the Console? Answer: Shard to be adjusted indicates the state when the job has started but has not yet obtained the shard. -## 11. Why is there a task scheduling delay in the first startup? +## 9. Why is there a task scheduling delay in the first startup? Answer: ElasticJob will obtain the local IP when performing task scheduling, and it may be slow to obtain the IP for the first time. Try to set `-Djava.net.preferIPv4Stack=true`. -## 12. In Windows env, run ShardingSphere-ElasticJob-UI, could not find or load main class org.apache.shardingsphere.elasticjob.lite.ui.Bootstrap. Why? +## 10. In Windows env, run ShardingSphere-ElasticJob-UI, could not find or load main class org.apache.shardingsphere.elasticjob.engine.ui.Bootstrap. Why? Answer: @@ -107,7 +91,7 @@ Open cmd.exe and execute the following command: tar zxvf apache-shardingsphere-elasticjob-${RELEASE.VERSION}-lite-ui-bin.tar.gz ``` -## 13. Unable to startup Cloud Scheduler. Continuously output "Elastic job: IP:PORT has leadership" +## 11. Unable to startup Cloud Scheduler. Continuously output "Elastic job: IP:PORT has leadership" Answer: @@ -117,7 +101,7 @@ For instance, Mesos native libraries are under `/usr/local/lib`, so the property About Apache Mesos, please refer to [Apache Mesos](https://mesos.apache.org/). -## 14. Unable to obtain a suitable IP in the case of multiple network interfaces +## 12. Unable to obtain a suitable IP in the case of multiple network interfaces Answer: @@ -129,7 +113,7 @@ For example 1. specify network addresses, 192.168.0.100: `-Delasticjob.preferred.network.ip=192.168.0.100`. 1. specify network addresses for regular expressions, 192.168.*: `-Delasticjob.preferred.network.ip=192.168.*`. -## 15. During the zk authorization upgrade process, there was a false death of the instance during the rolling deployment process, and even if the historical version was rolled back, there was still false death. +## 13. During the zk authorization upgrade process, there was a false death of the instance during the rolling deployment process, and even if the historical version was rolled back, there was still false death. Answer: @@ -143,5 +127,5 @@ Through the logs, it can be found that an -102 exception will be thrown: xxxx-07-27 22:33:55.224 [DEBUG] [localhost-startStop-1-EventThread] [] [] [] - o.a.c.f.r.c.TreeCache : processResult: CuratorEventImpl{type=GET_DATA, resultCode=-102, path='/xxx/leader/election/latch/_c_bccccdcc-1134-4e0a-bb52-59a13836434a-latch-0000000047', name='null', children=null, context=null, stat=null, data=null, watchedEvent=null, aclList=null} ``` -1.If you encounter the issue of returning to the historical version and still pretending to be dead during the upgrade process, it is recommended to delete all job directories on zk and restart the historical version afterwards. -2.Calculate a reasonable job execution gap, such as when the job will not trigger from 21:00 to 21:30 in the evening. During this period, first stop all instances, and then deploy all versions with passwords online. \ No newline at end of file +1. If you encounter the issue of returning to the historical version and still pretending to be dead during the upgrade process, it is recommended to delete all job directories on zk and restart the historical version afterwards. +2. Calculate a reasonable job execution gap, such as when the job will not trigger from 21:00 to 21:30 in the evening. During this period, first stop all instances, and then deploy all versions with passwords online. diff --git a/docs/content/features/elastic.cn.md b/docs/content/features/elastic.cn.md index 6dc5af9d85..bb15c53b88 100644 --- a/docs/content/features/elastic.cn.md +++ b/docs/content/features/elastic.cn.md @@ -55,9 +55,9 @@ ElasticJob 提供最灵活的方式,最大限度的提高执行作业的吞吐 将分片总数设置为 1,并使用多于 1 台的服务器执行作业,作业将会以 1 主 n 从的方式执行。 一旦执行作业的服务器宕机,等待执行的服务器将会在下次作业启动时替补执行。开启失效转移功能效果更好,如果本次作业在执行过程中宕机,备机会立即替补执行。 -## ElasticJob-Lite 实现原理 +## 实现原理 -ElasticJob-Lite 并无作业调度中心节点,而是基于部署作业框架的程序在到达相应时间点时各自触发调度。 +ElasticJob 并无作业调度中心节点,而是基于部署作业框架的程序在到达相应时间点时各自触发调度。 注册中心仅用于作业注册和监控信息存储。而主作业节点仅用于处理分片和清理等功能。 ### 弹性分布式实现 @@ -92,13 +92,13 @@ ElasticJob-Lite 并无作业调度中心节点,而是基于部署作业框架 分片项序号的子节点存储详细信息。每个分片项下的子节点用于控制和记录分片运行状态。 节点详细信息说明: -| 子节点名 | 临时节点 | 描述 | -| -------- |:------- |:------------------------------------------------------------------------- | -| instance | 否 | 执行该分片项的作业运行实例主键 | -| running | 是 | 分片项正在运行的状态
仅配置 monitorExecution 时有效 | -| failover | 是 | 如果该分片项被失效转移分配给其他作业服务器,则此节点值记录执行此分片的作业服务器 IP | -| misfire | 否 | 是否开启错过任务重新执行 | -| disabled | 否 | 是否禁用此分片项 | +| 子节点名 | 临时节点 | 描述 | +|----------|:-----|:--------------------------------------------| +| instance | 否 | 执行该分片项的作业运行实例主键 | +| running | 是 | 分片项正在运行的状态
仅配置 monitorExecution 时有效 | +| failover | 是 | 如果该分片项被失效转移分配给其他作业服务器,则此节点值记录执行此分片的作业服务器 IP | +| misfire | 否 | 是否开启错过任务重新执行 | +| disabled | 否 | 是否禁用此分片项 | ### servers 节点 @@ -114,14 +114,14 @@ ElasticJob-Lite 并无作业调度中心节点,而是基于部署作业框架 leader节点是内部使用的节点,如果对作业框架原理不感兴趣,可不关注此节点。 -| 子节点名 | 临时节点 | 描述 | -| -------------------- |:------- |:--------------------------------------------------------------------------- | -| election\instance | 是 | 主节点服务器IP地址
一旦该节点被删除将会触发重新选举
重新选举的过程中一切主节点相关的操作都将阻塞 | -| election\latch | 否 | 主节点选举的分布式锁
为 curator 的分布式锁使用 | -| sharding\necessary | 否 | 是否需要重新分片的标记
如果分片总数变化,或作业服务器节点上下线或启用/禁用,以及主节点选举,会触发设置重分片标记
作业在下次执行时使用主节点重新分片,且中间不会被打断
作业执行时不会触发分片 | -| sharding\processing | 是 | 主节点在分片时持有的节点
如果有此节点,所有的作业执行都将阻塞,直至分片结束
主节点分片结束或主节点崩溃会删除此临时节点 | -| failover\items\分片项 | 否 | 一旦有作业崩溃,则会向此节点记录
当有空闲作业服务器时,会从此节点抓取需失效转移的作业项 | -| failover\items\latch | 否 | 分配失效转移分片项时占用的分布式锁
为 curator 的分布式锁使用 | +| 子节点名 | 临时节点 | 描述 | +|----------------------|:-----|:----------------------------------------------------------------------------------------------------------------| +| election\instance | 是 | 主节点服务器IP地址
一旦该节点被删除将会触发重新选举
重新选举的过程中一切主节点相关的操作都将阻塞 | +| election\latch | 否 | 主节点选举的分布式锁
为 curator 的分布式锁使用 | +| sharding\necessary | 否 | 是否需要重新分片的标记
如果分片总数变化,或作业服务器节点上下线或启用/禁用,以及主节点选举,会触发设置重分片标记
作业在下次执行时使用主节点重新分片,且中间不会被打断
作业执行时不会触发分片 | +| sharding\processing | 是 | 主节点在分片时持有的节点
如果有此节点,所有的作业执行都将阻塞,直至分片结束
主节点分片结束或主节点崩溃会删除此临时节点 | +| failover\items\分片项 | 否 | 一旦有作业崩溃,则会向此节点记录
当有空闲作业服务器时,会从此节点抓取需失效转移的作业项 | +| failover\items\latch | 否 | 分配失效转移分片项时占用的分布式锁
为 curator 的分布式锁使用 | ### 流程图 diff --git a/docs/content/features/elastic.en.md b/docs/content/features/elastic.en.md index 2091462401..e6c3faf1ec 100644 --- a/docs/content/features/elastic.en.md +++ b/docs/content/features/elastic.en.md @@ -53,9 +53,9 @@ The unfinished job from a crashed server will be transferred and executed contin Setting the total number of sharding items to 1 and more than 1 servers to execute the jobs makes the job run in the mode of `1` master and `n` slaves. Once the servers that are executing jobs are down, the idle servers will take over the jobs and execute them in the next scheduling, or better, if the failover option is enabled, the idle servers can take over the failed jobs immediately. -## ElasticJob-Lite Implementation Principle +## Implementation Principle -ElasticJob-Lite does not have a job scheduling center node, but the programs based on the deployment job framework trigger the scheduling when the corresponding time point is reached. +ElasticJob does not have a job scheduling center node, but the programs based on the deployment job framework trigger the scheduling when the corresponding time point is reached. The registration center is only used for job registration and monitoring information storage. The main job node is only used to handle functions such as sharding and cleaning. ### Elastic Distributed Implementation @@ -91,13 +91,13 @@ Job sharding information. The child node is the sharding item sequence number, s The child node of the sharding item sequence number stores detailed information. The child node under each shard is used to control and record the running status of the shard. Node details description: -| Child node name | Ephemeral node | Description | -| ---------------- |:---------------- |:------------------------------------------------------------------------------------------------------------------------------------ | -| instance | NO | The primary key of the job running instance that executes the shard | -| running | YES | The running state of the shard item.
Only valid when monitorExecution is configured | -| failover | YES | If the shard item is assigned to another job server by failover, this node value records the job server IP that executes the shard | -| misfire | NO | Whether to restart the missed task | -| disabled | NO | Whether to disable this shard | +| Child node name | Ephemeral node | Description | +|-----------------|:---------------|:-----------------------------------------------------------------------------------------------------------------------------------| +| instance | NO | The primary key of the job running instance that executes the shard | +| running | YES | The running state of the shard item.
Only valid when monitorExecution is configured | +| failover | YES | If the shard item is assigned to another job server by failover, this node value records the job server IP that executes the shard | +| misfire | NO | Whether to restart the missed task | +| disabled | NO | Whether to disable this shard | ### servers node @@ -113,11 +113,11 @@ They are used for master node election, sharding and failover processing respect The leader node is an internally used node. If you are not interested in the principle of the job framework, you don't need to pay attention to this node. -| Child node name | Ephemeral node | Description | -| ------------------------- |:-------------- |:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| election\instance | YES | The IP address of the master node server.
Once the node is deleted, a re-election will be triggered.
All operations related to the master node will be blocked during the re-election process. | -| election\latch | NO | Distributed locks elected by the master node
Used for distributed locks of curator | -| sharding\necessary | NO | The flag for re-sharding. If the total number of shards changes, or the job server node goes online or offline or enabled/disabled, as well as the master node election, the re-sharded flag will be triggered. The master node is re-sharded without being interrupted in the middle
The sharding will not be triggered when the job is executed | -| sharding\processing | YES | The node held by the master node during sharding.
If there is this node, all job execution will be blocked until the sharding ends.
The ephemeral node will be deleted when the master node sharding is over or the master node crashes | -| failover\items\shard item | NO | Once a job crashes, it will record to this node.
When there is an idle job server, it will grab the job items that need to failover from this node | -| failover\items\latch | NO | Distributed locks used when allocating failover shard items.
Used by curator distributed locks | +| Child node name | Ephemeral node | Description | +|---------------------------|:---------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| election\instance | YES | The IP address of the master node server.
Once the node is deleted, a re-election will be triggered.
All operations related to the master node will be blocked during the re-election process. | +| election\latch | NO | Distributed locks elected by the master node
Used for distributed locks of curator | +| sharding\necessary | NO | The flag for re-sharding. If the total number of shards changes, or the job server node goes online or offline or enabled/disabled, as well as the master node election, the re-sharded flag will be triggered. The master node is re-sharded without being interrupted in the middle
The sharding will not be triggered when the job is executed | +| sharding\processing | YES | The node held by the master node during sharding.
If there is this node, all job execution will be blocked until the sharding ends.
The ephemeral node will be deleted when the master node sharding is over or the master node crashes | +| failover\items\shard item | NO | Once a job crashes, it will record to this node.
When there is an idle job server, it will grab the job items that need to failover from this node | +| failover\items\latch | NO | Distributed locks used when allocating failover shard items.
Used by curator distributed locks | diff --git a/docs/content/features/resource.cn.md b/docs/content/features/resource.cn.md deleted file mode 100644 index b0e95aa7ea..0000000000 --- a/docs/content/features/resource.cn.md +++ /dev/null @@ -1,43 +0,0 @@ -+++ -pre = "3.3. " -title = "资源分配" -weight = 3 -chapter = true -+++ - -资源分配功能为 ElasticJob-Cloud 所特有的功能。 - -## 作业运行模式 - -ElasticJob-Cloud 分为瞬时作业和常驻作业 2 种运行模式。 - -### 瞬时作业 - -在每一次作业执行完毕后立刻释放资源,保证利用现有资源错峰执行。 -资源分配和容器启动均占用一定时长,且作业执行时资源不一定充足,因此作业执行会有延迟。 -瞬时作业适用于间隔时间长,资源消耗多且对执行时间无严格要求的作业。 - -### 常驻作业 - -无论在运行时还是等待运行时,均一直占用分配的资源,可节省过多容器启动和资源分配的开销,适用于间隔时间短,资源需求量稳定的作业。 - -## 调度器 - -ElasticJob-Cloud 基于 Mesos 的 Framework 开发,用于资源调度和应用分发,需要独立启动并提供服务。 - -## 作业应用 - -指作业打包部署后的应用,描述了作业启动需要用到的 CPU、内存、启动脚本及应用下载路径等基本信息。 -每个作业应用可以包含一个或多个作业。 - -## 作业 - -即实际运行的具体任务,和 ElasticJob-Lite 共用同样的作业生态。 -在注册作业之前必须先注册作业应用。 - -## 资源 - -指作业启动或运行需要用到的 CPU、内存。 -配置在作业应用维度表示整个应用启动需要用的资源; -配置在作业维度表示每个作业运行需要的资源。 -作业启动需要的资源为指定作业应用需要的资源与作业需要资源的总和。 diff --git a/docs/content/features/resource.en.md b/docs/content/features/resource.en.md deleted file mode 100644 index 3b99387651..0000000000 --- a/docs/content/features/resource.en.md +++ /dev/null @@ -1,43 +0,0 @@ -+++ -pre = "3.3. " -title = "Resource Assign" -weight = 3 -chapter = true -+++ - -The resource allocation function is unique to ElasticJob-Cloud. - -## Execution mode - -ElasticJob-Cloud is divided into two execution modes: transient and daemon execution. - -### Transient execution - -The resources are released immediately after the execution of each job to ensure that the existing resources are used for staggered execution. -Resource allocation and container startup both take up a certain amount of time, and resources may not be sufficient during job execution, so job execution may be delayed. -Transient execution is suitable for jobs with long intervals, high resource consumption and no strict requirements on execution time. - -### Daemon execution - -Whether it is running or waiting to run, it always occupies the allocated resources, which can save too many container startup and resource allocation costs, and is suitable for jobs with short intervals and stable resource requirements. - -## Scheduler - -ElasticJob-Cloud is developed based on the Mesos Framework and is used for resource scheduling and application distribution. It needs to be started independently and provides services. - -## Job Application - -Refers to the application after the job is packaged and deployed, and describes the basic information such as the CPU, memory, startup script, and application download path that are needed to start the job. -Each job application can contain one or more jobs. - -## Job - -That is, the specific tasks that are actually run share the same job ecology as ElasticJob-Lite. -The job application must be registered before registering the job. - -## Resource - -Refers to the CPU and memory required to start or run a job. -Configuration in the job application dimension indicates the resources needed for the entire application to start; -Configuration in the job dimension indicates the resources required for each job to run. -The resources required for job startup are the sum of the resources required by the specified job application and the resources required by the job. diff --git a/docs/content/features/schedule-model.cn.md b/docs/content/features/schedule-model.cn.md index 0b6db13727..4aee64acde 100644 --- a/docs/content/features/schedule-model.cn.md +++ b/docs/content/features/schedule-model.cn.md @@ -5,15 +5,5 @@ weight = 1 chapter = true +++ -与大部分的作业平台不同,ElasticJob 的调度模型划分为支持线程级别调度的进程内调度 ElasticJob-Lite,和进程级别调度的 ElasticJob-Cloud。 - -## 进程内调度 - -ElasticJob-Lite 是面向进程内的线程级调度框架。通过它,作业能够透明化的与业务应用系统相结合。 +ElasticJob 是面向进程内的线程级调度框架。通过它,作业能够透明化的与业务应用系统相结合。 它能够方便的与 Spring 、Dubbo 等 Java 框架配合使用,在作业中可自由使用 Spring 注入的 Bean,如数据源连接池、Dubbo 远程服务等,更加方便的贴合业务开发。 - -## 进程级调度 - -ElasticJob-Cloud 拥有进程内调度和进程级别调度两种方式。 -由于 ElasticJob-Cloud 能够对作业服务器的资源进行控制,因此其作业类型可划分为常驻任务和瞬时任务。 -常驻任务类似于 ElasticJob-Lite,是进程内调度;瞬时任务则完全不同,它充分的利用了资源分配的削峰填谷能力,是进程级的调度,每次任务会启动全新的进程处理。 diff --git a/docs/content/features/schedule-model.en.md b/docs/content/features/schedule-model.en.md index 8bb872a918..230c8c9c6b 100644 --- a/docs/content/features/schedule-model.en.md +++ b/docs/content/features/schedule-model.en.md @@ -5,15 +5,7 @@ weight = 1 chapter = true +++ -Unlike most job platforms, ElasticJob's scheduling model is divided into in-process scheduling ElasticJob-Lite that supports thread-level scheduling, and ElasticJob-Cloud for process-level scheduling. - -## In-process scheduling - -ElasticJob-Lite is a thread-level scheduling framework for in-process. Through it, Job can be transparently combined with business application systems. -It can be easily used in conjunction with Java frameworks such as Spring and Dubbo. Spring DI (Dependency Injection) Beans can be freely used in Job, such as data source connection pool and Dubbo remote service, etc., which is more convenient for business development. - -## Process-level scheduling - -ElasticJob-Cloud has two methods: in-process scheduling and process-level scheduling. -Because ElasticJob-Cloud can control the resources of the job server, its job types can be divided into resident tasks and transient tasks. -The resident task is similar to ElasticJob-Lite, which is an in-process scheduling; the transient task is completely different. It fully utilizes the peak-cutting and valley-filling capabilities of resource allocation, and is a process-level scheduling. Each task will start a new process. \ No newline at end of file +ElasticJob is a thread-level scheduling framework for in-process. +Through it, Job can be transparently combined with business application systems. +It can be easily used in conjunction with Java frameworks such as Spring and Dubbo. +Spring DI (Dependency Injection) Beans can be freely used in Job, such as data source connection pool and Dubbo remote service, etc., which is more convenient for business development. diff --git a/docs/content/overview/_index.cn.md b/docs/content/overview/_index.cn.md index 2358b87759..9263d34e23 100644 --- a/docs/content/overview/_index.cn.md +++ b/docs/content/overview/_index.cn.md @@ -11,8 +11,7 @@ chapter = true [![GitHub watchers](https://img.shields.io/github/watchers/apache/shardingsphere-elasticjob.svg?style=social&label=Watch)](https://github.com/apache/shardingsphere-elasticjob/watchers) [![Stargazers over time](https://starchart.cc/apache/shardingsphere-elasticjob.svg)](https://starchart.cc/apache/shardingsphere-elasticjob) -ElasticJob 是面向互联网生态和海量任务的分布式调度解决方案,由两个相互独立的子项目 ElasticJob-Lite 和 ElasticJob-Cloud 组成。 -它通过弹性调度、资源管控、以及作业治理的功能,打造一个适用于互联网场景的分布式调度解决方案,并通过开放的架构设计,提供多元化的作业生态。 +ElasticJob 通过弹性调度、资源管控、以及作业治理的功能,打造一个适用于互联网场景的分布式调度解决方案,并通过开放的架构设计,提供多元化的作业生态。 它的各个产品使用统一的作业 API,开发者仅需一次开发,即可随意部署。 ElasticJob 已于 2020 年 5 月 28 日成为 [Apache ShardingSphere](https://shardingsphere.apache.org/) 的子项目。 @@ -31,24 +30,9 @@ ElasticJob 已于 2020 年 5 月 28 日成为 [Apache ShardingSphere](https://sh 使用 ElasticJob 能够让开发工程师不再担心任务的线性吞吐量提升等非功能需求,使他们能够更加专注于面向业务编码设计; 同时,它也能够解放运维工程师,使他们不必再担心任务的可用性和相关管理需求,只通过轻松的增加服务节点即可达到自动化运维的目的。 -### ElasticJob-Lite +ElasticJob 定位为轻量级无中心化解决方案,使用 jar 的形式提供分布式任务的协调服务。 -定位为轻量级无中心化解决方案,使用 jar 的形式提供分布式任务的协调服务。 - -![ElasticJob-Lite Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) - -### ElasticJob-Cloud - -采用自研 Mesos Framework 的解决方案,额外提供资源治理、应用分发以及进程隔离等功能。 - -![ElasticJob-Cloud Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_cloud.png) - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| --------- | ----------------- | ------------------ | -| 无中心化 | 是 | 否 | -| 资源分配 | 不支持 | 支持 | -| 作业模式 | 常驻 | 常驻 + 瞬时 | -| 部署依赖 | ZooKeeper | ZooKeeper + Mesos | +![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) ## 功能列表 @@ -94,7 +78,3 @@ ElasticJob 已于 2020 年 5 月 28 日成为 [Apache ShardingSphere](https://sh ### ZooKeeper 请使用 ZooKeeper 3.6.0 及其以上版本。[详情参见](https://zookeeper.apache.org/) - -### Mesos(仅 ElasticJob-Cloud 使用) - -请使用 Mesos 1.1.0 及其兼容版本。[详情参见](https://mesos.apache.org/) diff --git a/docs/content/overview/_index.en.md b/docs/content/overview/_index.en.md index 974e613c2f..6b4c1b252f 100644 --- a/docs/content/overview/_index.en.md +++ b/docs/content/overview/_index.en.md @@ -11,8 +11,6 @@ chapter = true [![GitHub watchers](https://img.shields.io/github/watchers/apache/shardingsphere-elasticjob.svg?style=social&label=Watch)](https://github.com/apache/shardingsphere-elasticjob/watchers) [![Stargazers over time](https://starchart.cc/apache/shardingsphere-elasticjob.svg)](https://starchart.cc/apache/shardingsphere-elasticjob) -ElasticJob is a distributed scheduling solution consisting of two separate projects, ElasticJob-Lite and ElasticJob-Cloud. - Through the functions of flexible scheduling, resource management and job management, it creates a distributed scheduling solution suitable for Internet scenarios, and provides a diversified job ecosystem through open architecture design. @@ -36,24 +34,9 @@ Welcome communicate with community via [mail list](mailto:dev@shardingsphere.apa Using ElasticJob can make developers no longer worry about the non-functional requirements such as jobs scale out, so that they can focus more on business coding; At the same time, it can release operators too, so that they do not have to worry about jobs high availability and management, and can automatic operation by simply adding servers. -### ElasticJob-Lite - -A lightweight, decentralized solution that provides distributed task sharding services. - -![ElasticJob-Lite Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) - -### ElasticJob-Cloud +ElasticJob is a lightweight, decentralized solution that provides distributed task sharding services. -Uses Mesos to manage and isolate resources. - -![ElasticJob-Cloud Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_cloud.png) - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| ----------------- | ----------------- | ------------------ | -| Decentralization | Yes | No | -| Resource Assign | No | Yes | -| Job Execution | Daemon | Daemon + Transient | -| Deploy Dependency | ZooKeeper | ZooKeeper + Mesos | +![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) ## Features @@ -99,7 +82,3 @@ Maven 3.5.0 or above required. ### ZooKeeper ZooKeeper 3.6.0 or above required. [See details](https://zookeeper.apache.org/) - -### Mesos (ElasticJob-Cloud only) - -Mesos 1.1.0 or compatible version required. [See details](https://mesos.apache.org/) \ No newline at end of file diff --git a/docs/content/quick-start/_index.cn.md b/docs/content/quick-start/_index.cn.md index bae7073e40..d9a6c2e188 100644 --- a/docs/content/quick-start/_index.cn.md +++ b/docs/content/quick-start/_index.cn.md @@ -5,4 +5,63 @@ weight = 2 chapter = true +++ -本章节以尽量短的时间,为使用者提供最简单的 ElasticJob 的快速入门。 \ No newline at end of file +## 引入 Maven 依赖 + +```xml + + org.apache.shardingsphere.elasticjob + elasticjob-engine-core + ${latest.release.version} + +``` + +## 作业开发 + +```java +public class MyJob implements SimpleJob { + + @Override + public void execute(ShardingContext context) { + switch (context.getShardingItem()) { + case 0: + // do something by sharding item 0 + break; + case 1: + // do something by sharding item 1 + break; + case 2: + // do something by sharding item 2 + break; + // case n: ... + } + } +} +``` + +## 作业配置 + +```java + JobConfiguration jobConfig = JobConfiguration.newBuilder("MyJob", 3).cron("0/5 * * * * ?").build(); +``` + +## 作业调度 + +```java +public class MyJobDemo { + + public static void main(String[] args) { + new ScheduleJobBootstrap(createRegistryCenter(), new MyJob(), createJobConfiguration()).schedule(); + } + + private static CoordinatorRegistryCenter createRegistryCenter() { + CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("zk_host:2181", "my-job")); + regCenter.init(); + return regCenter; + } + + private static JobConfiguration createJobConfiguration() { + // 创建作业配置 + // ... + } +} +``` diff --git a/docs/content/quick-start/_index.en.md b/docs/content/quick-start/_index.en.md index b2f198ad58..19d9dbb23d 100644 --- a/docs/content/quick-start/_index.en.md +++ b/docs/content/quick-start/_index.en.md @@ -5,4 +5,64 @@ weight = 2 chapter = true +++ -In shortest time, this chapter provides users with a simplest quick start with ElasticJob. +## Import Maven Dependency + +```xml + + org.apache.shardingsphere.elasticjob + elasticjob-engine-core + ${latest.release.version} + +``` + +## Develop Job + +```java +public class MyJob implements SimpleJob { + + @Override + public void execute(ShardingContext context) { + switch (context.getShardingItem()) { + case 0: + // do something by sharding item 0 + break; + case 1: + // do something by sharding item 1 + break; + case 2: + // do something by sharding item 2 + break; + // case n: ... + } + } +} +``` + +## Configure Job + +```java + JobConfiguration jobConfig = JobConfiguration.newBuilder("MyJob", 3).cron("0/5 * * * * ?").build(); +``` + +## Schedule Job + +```java +public class MyJobDemo { + + public static void main(String[] args) { + new ScheduleJobBootstrap(createRegistryCenter(), new MyJob(), createJobConfiguration()).schedule(); + } + + private static CoordinatorRegistryCenter createRegistryCenter() { + CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("zk_host:2181", "my-job")); + regCenter.init(); + return regCenter; + } + + private static JobConfiguration createJobConfiguration() { + // create job configuration + // ... + } +} +``` + diff --git a/docs/content/quick-start/elasticjob-cloud.cn.md b/docs/content/quick-start/elasticjob-cloud.cn.md deleted file mode 100644 index cb9818f0ab..0000000000 --- a/docs/content/quick-start/elasticjob-cloud.cn.md +++ /dev/null @@ -1,82 +0,0 @@ -+++ -pre = "2.2. " -title = "ElasticJob-Cloud" -weight = 2 -chapter = true -+++ - -## 引入 Maven 依赖 - -```xml - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-executor - ${latest.release.version} - -``` - -## 作业开发 - -```java -public class MyJob implements SimpleJob { - - @Override - public void execute(ShardingContext context) { - switch (context.getShardingItem()) { - case 0: - // do something by sharding item 0 - break; - case 1: - // do something by sharding item 1 - break; - case 2: - // do something by sharding item 2 - break; - // case n: ... - } - } -} -``` - -## 作业启动 - -需定义 `main` 方法并调用 `JobBootstrap.execute()`,例子如下: - -```java -public class MyJobDemo { - - public static void main(final String[] args) { - JobBootstrap.execute(new MyJob()); - } -} -``` - -## 作业打包 - -```bash -tar -cvf my-job.tar.gz my-job -``` - -## API 鉴权 - -```bash -curl -H "Content-Type: application/json" -X POST http://elasticjob_cloud_host:8899/api/login -d '{"username": "root", "password": "pwd"}' -``` - -响应体: - -```json -{"accessToken":"some_token"} -``` - -## 作业发布 - -```bash -curl -l -H "Content-type: application/json" -H "accessToken: some_token" -X POST -d '{"appName":"my_app","appURL":"http://app_host:8080/my-job.tar.gz","cpuCount":0.1,"memoryMB":64.0,"bootstrapScript":"bin/start.sh","appCacheEnable":true,"eventTraceSamplingCount":0}' http://elasticjob_cloud_host:8899/api/app -``` - -## 作业调度 - -```bash -curl -l -H "Content-type: application/json" -H "accessToken: some_token" -X POST -d '{"jobName":"my_job","appName":"my_app","jobExecutionType":"TRANSIENT","cron":"0/5 * * * * ?","shardingTotalCount":3,"cpuCount":0.1,"memoryMB":64.0}' http://elasticjob_cloud_host:8899/api/job/register -``` diff --git a/docs/content/quick-start/elasticjob-cloud.en.md b/docs/content/quick-start/elasticjob-cloud.en.md deleted file mode 100644 index 65563f8ec5..0000000000 --- a/docs/content/quick-start/elasticjob-cloud.en.md +++ /dev/null @@ -1,82 +0,0 @@ -+++ -pre = "2.2. " -title = "ElasticJob-Cloud" -weight = 2 -chapter = true -+++ - -## Import Maven Dependency - -```xml - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-executor - ${latest.release.version} - -``` - -## Develop Job Details - -```java -public class MyJob implements SimpleJob { - - @Override - public void execute(ShardingContext context) { - switch (context.getShardingItem()) { - case 0: - // do something by sharding item 0 - break; - case 1: - // do something by sharding item 1 - break; - case 2: - // do something by sharding item 2 - break; - // case n: ... - } - } -} -``` - -## Develop Job Bootstrap - -Define `main` method and call `JobBootstrap.execute()`, example as follows: - -```java -public class MyJobDemo { - - public static void main(final String[] args) { - JobBootstrap.execute(new MyJob()); - } -} -``` - -## Pack Job - -```bash -tar -cvf my-job.tar.gz my-job -``` - -## API Authentication - -```bash -curl -H "Content-Type: application/json" -X POST http://elasticjob_cloud_host:8899/api/login -d '{"username": "root", "password": "pwd"}' -``` - -Response body: -```json -{"accessToken":"some_token"} -``` - - -## Publish Job - -```bash -curl -l -H "Content-type: application/json" -H "accessToken: some_token" -X POST -d '{"appName":"my_app","appURL":"http://app_host:8080/my-job.tar.gz","cpuCount":0.1,"memoryMB":64.0,"bootstrapScript":"bin/start.sh","appCacheEnable":true,"eventTraceSamplingCount":0}' http://elasticjob_cloud_host:8899/api/app -``` - -## Schedule Job - -```bash -curl -l -H "Content-type: application/json" -H "accessToken: some_token" -X POST -d '{"jobName":"my_job","appName":"my_app","jobExecutionType":"TRANSIENT","cron":"0/5 * * * * ?","shardingTotalCount":3,"cpuCount":0.1,"memoryMB":64.0}' http://elasticjob_cloud_host:8899/api/job/register -``` diff --git a/docs/content/quick-start/elasticjob-lite.cn.md b/docs/content/quick-start/elasticjob-lite.cn.md deleted file mode 100644 index 697c16b5f9..0000000000 --- a/docs/content/quick-start/elasticjob-lite.cn.md +++ /dev/null @@ -1,67 +0,0 @@ -+++ -pre = "2.1. " -title = "ElasticJob-Lite" -weight = 1 -chapter = true -+++ - -## 引入 Maven 依赖 - -```xml - - org.apache.shardingsphere.elasticjob - elasticjob-lite-core - ${latest.release.version} - -``` - -## 作业开发 - -```java -public class MyJob implements SimpleJob { - - @Override - public void execute(ShardingContext context) { - switch (context.getShardingItem()) { - case 0: - // do something by sharding item 0 - break; - case 1: - // do something by sharding item 1 - break; - case 2: - // do something by sharding item 2 - break; - // case n: ... - } - } -} -``` - -## 作业配置 - -```java - JobConfiguration jobConfig = JobConfiguration.newBuilder("MyJob", 3).cron("0/5 * * * * ?").build(); -``` - -## 作业调度 - -```java -public class MyJobDemo { - - public static void main(String[] args) { - new ScheduleJobBootstrap(createRegistryCenter(), new MyJob(), createJobConfiguration()).schedule(); - } - - private static CoordinatorRegistryCenter createRegistryCenter() { - CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("zk_host:2181", "my-job")); - regCenter.init(); - return regCenter; - } - - private static JobConfiguration createJobConfiguration() { - // 创建作业配置 - // ... - } -} -``` diff --git a/docs/content/quick-start/elasticjob-lite.en.md b/docs/content/quick-start/elasticjob-lite.en.md deleted file mode 100644 index 1c4653d082..0000000000 --- a/docs/content/quick-start/elasticjob-lite.en.md +++ /dev/null @@ -1,67 +0,0 @@ -+++ -pre = "2.1. " -title = "ElasticJob-Lite" -weight = 1 -chapter = true -+++ - -## Import Maven Dependency - -```xml - - org.apache.shardingsphere.elasticjob - elasticjob-lite-core - ${latest.release.version} - -``` - -## Develop Job - -```java -public class MyJob implements SimpleJob { - - @Override - public void execute(ShardingContext context) { - switch (context.getShardingItem()) { - case 0: - // do something by sharding item 0 - break; - case 1: - // do something by sharding item 1 - break; - case 2: - // do something by sharding item 2 - break; - // case n: ... - } - } -} -``` - -## Configure Job - -```java - JobConfiguration jobConfig = JobConfiguration.newBuilder("MyJob", 3).cron("0/5 * * * * ?").build(); -``` - -## Schedule Job - -```java -public class MyJobDemo { - - public static void main(String[] args) { - new ScheduleJobBootstrap(createRegistryCenter(), new MyJob(), createJobConfiguration()).schedule(); - } - - private static CoordinatorRegistryCenter createRegistryCenter() { - CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("zk_host:2181", "my-job")); - regCenter.init(); - return regCenter; - } - - private static JobConfiguration createJobConfiguration() { - // create job configuration - // ... - } -} -``` diff --git a/docs/content/user-manual/_index.cn.md b/docs/content/user-manual/_index.cn.md index 88c95bdffc..a0736d3b21 100644 --- a/docs/content/user-manual/_index.cn.md +++ b/docs/content/user-manual/_index.cn.md @@ -5,5 +5,8 @@ weight = 4 chapter = true +++ -本章节详细阐述 ElasticJob 的 2 个相关产品 ElasticJob-Lite 和 ElasticJob-Cloud 的使用。 +ElasticJob 定位为轻量级无中心化解决方案,使用 jar 的形式提供分布式任务的协调服务。 +![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) + +他的优势在于无中心化设计且外部依赖少,适用于资源分配稳定的业务系统。 diff --git a/docs/content/user-manual/_index.en.md b/docs/content/user-manual/_index.en.md index 61f8b270f5..3b2b5d51d5 100644 --- a/docs/content/user-manual/_index.en.md +++ b/docs/content/user-manual/_index.en.md @@ -5,4 +5,9 @@ weight = 4 chapter = true +++ -This chapter describes how to use projects of ElasticJob: ElasticJob-Lite and ElasticJob-Cloud. +ElasticJob is a lightweight, decentralized solution that provides distributed task sharding services. + +![ElasticJob Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) + +The advantages of ElasticJob are no centralized design and less external dependence, +which is suitable for business application with stable resource allocation. diff --git a/docs/content/user-manual/elasticjob-lite/configuration/_index.cn.md b/docs/content/user-manual/configuration/_index.cn.md similarity index 62% rename from docs/content/user-manual/elasticjob-lite/configuration/_index.cn.md rename to docs/content/user-manual/configuration/_index.cn.md index 8e007e613d..9acd9fba71 100644 --- a/docs/content/user-manual/elasticjob-lite/configuration/_index.cn.md +++ b/docs/content/user-manual/configuration/_index.cn.md @@ -5,26 +5,26 @@ weight = 2 chapter = true +++ -通过配置可以快速清晰的理解 ElasticJob-Lite 所提供的功能。 +通过配置可以快速清晰的理解 ElasticJob 所提供的功能。 -本章节是 ElasticJob-Lite 的配置参考手册,需要时可当做字典查阅。 +本章节是 ElasticJob 的配置参考手册,需要时可当做字典查阅。 -ElasticJob-Lite 提供了 3 种配置方式,用于不同的使用场景。 +ElasticJob 提供了 3 种配置方式,用于不同的使用场景。 ## 注册中心配置项 ### 可配置属性 -| 属性名 | 类型 | 缺省值 | 描述 | -| ----------------------------- |:-------- |:------- |:-------------------------- | -| serverLists | String | | 连接 ZooKeeper 服务器的列表 | -| namespace | String | | ZooKeeper 的命名空间 | -| baseSleepTimeMilliseconds | int | 1000 | 等待重试的间隔时间的初始毫秒数 | -| maxSleepTimeMilliseconds | String | 3000 | 等待重试的间隔时间的最大毫秒数 | -| maxRetries | String | 3 | 最大重试次数 | -| sessionTimeoutMilliseconds | int | 60000 | 会话超时毫秒数 | -| connectionTimeoutMilliseconds | int | 15000 | 连接超时毫秒数 | -| digest | String | 无需验证 | 连接 ZooKeeper 的权限令牌 | +| 属性名 | 类型 | 缺省值 | 描述 | +|-------------------------------|:-------|:------|:--------------------| +| serverLists | String | | 连接 ZooKeeper 服务器的列表 | +| namespace | String | | ZooKeeper 的命名空间 | +| baseSleepTimeMilliseconds | int | 1000 | 等待重试的间隔时间的初始毫秒数 | +| maxSleepTimeMilliseconds | String | 3000 | 等待重试的间隔时间的最大毫秒数 | +| maxRetries | String | 3 | 最大重试次数 | +| sessionTimeoutMilliseconds | int | 60000 | 会话超时毫秒数 | +| connectionTimeoutMilliseconds | int | 15000 | 连接超时毫秒数 | +| digest | String | 无需验证 | 连接 ZooKeeper 的权限令牌 | ### 核心配置项说明 @@ -37,26 +37,26 @@ ElasticJob-Lite 提供了 3 种配置方式,用于不同的使用场景。 ### 可配置属性 -| 属性名 | 类型 | 缺省值 | 描述 | -| ----------------------------- |:---------- |:-------------- |:----------------------------------- | -| jobName | String | | 作业名称 | -| shardingTotalCount | int | | 作业分片总数 | -| cron | String | | CRON 表达式,用于控制作业触发时间 | -| timeZone | String | | CRON 的时区设置 | -| shardingItemParameters | String | | 个性化分片参数 | -| jobParameter | String | | 作业自定义参数 | -| monitorExecution | boolean | true | 监控作业运行时状态 | -| failover | boolean | false | 是否开启任务执行失效转移 | -| misfire | boolean | true | 是否开启错过任务重新执行 | -| maxTimeDiffSeconds | int | -1(不检查) | 最大允许的本机与注册中心的时间误差秒数 | -| reconcileIntervalMinutes | int | 10 | 修复作业服务器不一致状态服务调度间隔分钟 | -| jobShardingStrategyType | String | AVG_ALLOCATION | 作业分片策略类型 | -| jobExecutorServiceHandlerType | String | CPU | 作业线程池处理策略 | -| jobErrorHandlerType | String | | 作业错误处理策略 | -| description | String | | 作业描述信息 | -| props | Properties | | 作业属性配置信息 | -| disabled | boolean | false | 作业是否禁止启动 | -| overwrite | boolean | false | 本地配置是否可覆盖注册中心配置 | +| 属性名 | 类型 | 缺省值 | 描述 | +|-------------------------------|:-----------|:---------------|:---------------------| +| jobName | String | | 作业名称 | +| shardingTotalCount | int | | 作业分片总数 | +| cron | String | | CRON 表达式,用于控制作业触发时间 | +| timeZone | String | | CRON 的时区设置 | +| shardingItemParameters | String | | 个性化分片参数 | +| jobParameter | String | | 作业自定义参数 | +| monitorExecution | boolean | true | 监控作业运行时状态 | +| failover | boolean | false | 是否开启任务执行失效转移 | +| misfire | boolean | true | 是否开启错过任务重新执行 | +| maxTimeDiffSeconds | int | -1(不检查) | 最大允许的本机与注册中心的时间误差秒数 | +| reconcileIntervalMinutes | int | 10 | 修复作业服务器不一致状态服务调度间隔分钟 | +| jobShardingStrategyType | String | AVG_ALLOCATION | 作业分片策略类型 | +| jobExecutorServiceHandlerType | String | CPU | 作业线程池处理策略 | +| jobErrorHandlerType | String | | 作业错误处理策略 | +| description | String | | 作业描述信息 | +| props | Properties | | 作业属性配置信息 | +| disabled | boolean | false | 作业是否禁止启动 | +| overwrite | boolean | false | 本地配置是否可覆盖注册中心配置 | ### 核心配置项说明 @@ -90,19 +90,19 @@ ElasticJob-Lite 提供了 3 种配置方式,用于不同的使用场景。 **jobShardingStrategyType:** -详情请参见[内置分片策略列表](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding)。 +详情请参见[内置分片策略列表](/cn/user-manual/elasticjob/configuration/built-in-strategy/sharding)。 **jobExecutorServiceHandlerType:** -详情请参见[内置线程池策略列表](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool)。 +详情请参见[内置线程池策略列表](/cn/user-manual/elasticjob/configuration/built-in-strategy/thread-pool)。 **jobErrorHandlerType:** -详情请参见[内置错误处理策略列表](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler)。 +详情请参见[内置错误处理策略列表](/cn/user-manual/elasticjob/configuration/built-in-strategy/error-handler)。 **props:** -详情请参见[作业属性配置列表](/cn/user-manual/elasticjob-lite/configuration/props)。 +详情请参见[作业属性配置列表](/cn/user-manual/elasticjob/configuration/props)。 **disabled:** diff --git a/docs/content/user-manual/configuration/_index.en.md b/docs/content/user-manual/configuration/_index.en.md new file mode 100644 index 0000000000..c437e417ac --- /dev/null +++ b/docs/content/user-manual/configuration/_index.en.md @@ -0,0 +1,136 @@ ++++ +pre = "4.1.2 " +title = "Configuration" +weight = 2 +chapter = true ++++ + +Through which developers can quickly and clearly understand the functions provided by ElasticJob. + +This chapter is a configuration manual for ElasticJob, which can also be referred to as a dictionary if necessary. + +ElasticJob has provided 3 kinds of configuration methods for different situations. + +## Registry Center Configuration + +### Configuration + +| Name | Data Type | Default Value | Description | +|-------------------------------|:----------|:--------------|:---------------------------------------------------------| +| serverLists | String | | ZooKeeper server IP list | +| namespace | String | | ZooKeeper namespace | +| baseSleepTimeMilliseconds | int | 1000 | The initial value of milliseconds for the retry interval | +| maxSleepTimeMilliseconds | String | 3000 | The maximum value of milliseconds for the retry interval | +| maxRetries | String | 3 | Maximum number of retries | +| sessionTimeoutMilliseconds | int | 60000 | Session timeout in milliseconds | +| connectionTimeoutMilliseconds | int | 15000 | Connection timeout in milliseconds | +| digest | String | no need | Permission token to connect to ZooKeeper | + +### Core Configuration Description + +**serverLists:** + +Include IP and port, multiple addresses are separated by commas, such as: `host1:2181,host2:2181` + +## Job Configuration + +### Configuration + +| Name | Data Type | Default Value | Description | +|-------------------------------|:-----------|:---------------|:------------------------------------------------------------------------------------| +| jobName | String | | Job name | +| shardingTotalCount | int | | Sharding total count | +| cron | String | | CRON expression, control the job trigger time | +| timeZone | String | | time zone of CRON | +| shardingItemParameters | String | | Sharding item parameters | +| jobParameter | String | | Job parameter | +| monitorExecution | boolean | true | Monitor job execution status | +| failover | boolean | false | Enable or disable job failover | +| misfire | boolean | true | Enable or disable the missed task to re-execute | +| maxTimeDiffSeconds | int | -1(no check) | The maximum value for time difference between server and registry center in seconds | +| reconcileIntervalMinutes | int | 10 | Service scheduling interval in minutes for repairing job server inconsistent state | +| jobShardingStrategyType | String | AVG_ALLOCATION | Job sharding strategy type | +| jobExecutorServiceHandlerType | String | CPU | Job thread pool handler type | +| jobErrorHandlerType | String | | Job error handler type | +| description | String | | Job description | +| props | Properties | | Job properties | +| disabled | boolean | false | Enable or disable start the job | +| overwrite | boolean | false | Enable or disable local configuration override registry center configuration | + +### Core Configuration Description + +**shardingItemParameters:** + +The sequence numbers and parameters of the Sharding items are separated by equal sign, and multiple key-value pairs are separated by commas. +The Sharding sequence number starts from `0` and can't be greater than or equal to the total number of job fragments. +For example: `0=a,1=b,2=c` + +**jobParameter:** + +With this parameter, user can pass parameters for the business method of job scheduling, which is used to implement the job with parameters. +For example: `Amount of data acquired each time`, `Primary key of the job instance read from the database`, etc. + +**monitorExecution:** + +When the execution time and interval of each job are very short, it is recommended not to monitor the running status of the job to improve efficiency. +There is no need to monitor because it is a transient state. User can add data accumulation monitoring by self. And there is no guarantee that the data will be selected repeatedly, idempotency should be achieved in the job. +If the job execution time and interval time are longer, it is recommended to monitor the job status, and it can guarantee that the data will not be selected repeatedly. + +**maxTimeDiffSeconds:** + +If the time error exceeds the configured seconds, an exception will be thrown when the job starts. + +**reconcileIntervalMinutes:** + +In a distributed system, due to network, clock and other reasons, ZooKeeper may be inconsistent with the actual running job. This inconsistency cannot be completely avoided through positive verification. +It is necessary to start another thread to periodically calibrate the consistency between the registry center and the job status, that is, to maintain the final consistency of ElasticJob. + +Less than `1` means no repair is performed. + +**jobShardingStrategyType:** + +For details, see[Job Sharding Strategy](/en/user-manual/elasticjob/configuration/built-in-strategy/sharding)。 + +**jobExecutorServiceHandlerType:** + +For details, see[Thread Pool Strategy](/en/user-manual/elasticjob/configuration/built-in-strategy/thread-pool)。 + +**jobErrorHandlerType:** + +For details, see[Error Handler Strategy](/en/user-manual/elasticjob/configuration/built-in-strategy/error-handler)。 + +**props:** + +For details, see[Job Properties](/en/user-manual/elasticjob/configuration/props)。 + +**disabled:** + +It can be used for deployment, forbid jobs to start, and then start them uniformly after the deployment is completed. + +**overwrite:** + +If the value is `true`, local configuration override registry center configuration every time the job is started. + +## Job Listener Configuration + +### Common Listener Configuration + +Configuration: no + +### Distributed Listener Configuration + +Configuration + +| Name | Data Type | Default Value | Description | +| ------------------------------ |:------------ |:-------------- |:----------------------------------------------------------- | +| started-timeout-milliseconds | long | Long.MAX_VALUE | The timeout in milliseconds before the last job is executed | +| completed-timeout-milliseconds | long | Long.MAX_VALUE | The timeout in milliseconds after the last job is executed | + +## Event Tracing Configuration + +### Configuration + +| Name | Data Type | Default Value | Description | +| ------- |:-------------- |:------------- |:------------------------------------------- | +| type | String | | The type of event tracing storage adapter | +| storage | Generics Type | | The object of event tracing storage adapter | diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/_index.cn.md b/docs/content/user-manual/configuration/built-in-strategy/_index.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/_index.cn.md rename to docs/content/user-manual/configuration/built-in-strategy/_index.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/_index.en.md b/docs/content/user-manual/configuration/built-in-strategy/_index.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/_index.en.md rename to docs/content/user-manual/configuration/built-in-strategy/_index.en.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler.cn.md b/docs/content/user-manual/configuration/built-in-strategy/error-handler.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler.cn.md rename to docs/content/user-manual/configuration/built-in-strategy/error-handler.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler.en.md b/docs/content/user-manual/configuration/built-in-strategy/error-handler.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler.en.md rename to docs/content/user-manual/configuration/built-in-strategy/error-handler.en.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding.cn.md b/docs/content/user-manual/configuration/built-in-strategy/sharding.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding.cn.md rename to docs/content/user-manual/configuration/built-in-strategy/sharding.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding.en.md b/docs/content/user-manual/configuration/built-in-strategy/sharding.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding.en.md rename to docs/content/user-manual/configuration/built-in-strategy/sharding.en.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool.cn.md b/docs/content/user-manual/configuration/built-in-strategy/thread-pool.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool.cn.md rename to docs/content/user-manual/configuration/built-in-strategy/thread-pool.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool.en.md b/docs/content/user-manual/configuration/built-in-strategy/thread-pool.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool.en.md rename to docs/content/user-manual/configuration/built-in-strategy/thread-pool.en.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/java-api.cn.md b/docs/content/user-manual/configuration/java-api.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/java-api.cn.md rename to docs/content/user-manual/configuration/java-api.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/java-api.en.md b/docs/content/user-manual/configuration/java-api.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/java-api.en.md rename to docs/content/user-manual/configuration/java-api.en.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/props.cn.md b/docs/content/user-manual/configuration/props.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/props.cn.md rename to docs/content/user-manual/configuration/props.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/props.en.md b/docs/content/user-manual/configuration/props.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/configuration/props.en.md rename to docs/content/user-manual/configuration/props.en.md diff --git a/docs/content/user-manual/elasticjob-lite/configuration/spring-boot-starter.cn.md b/docs/content/user-manual/configuration/spring-boot-starter.cn.md similarity index 57% rename from docs/content/user-manual/elasticjob-lite/configuration/spring-boot-starter.cn.md rename to docs/content/user-manual/configuration/spring-boot-starter.cn.md index 824d5615da..f4f8f405be 100644 --- a/docs/content/user-manual/elasticjob-lite/configuration/spring-boot-starter.cn.md +++ b/docs/content/user-manual/configuration/spring-boot-starter.cn.md @@ -4,12 +4,12 @@ weight = 2 chapter = true +++ -使用 Spring-boot 需在 pom.xml 文件中添加 elasticjob-lite-spring-boot-starter 模块的依赖。 +使用 Spring-boot 需在 pom.xml 文件中添加 elasticjob-engine-spring-boot-starter 模块的依赖。 ```xml org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-boot-starter + elasticjob-engine-spring-boot-starter ${latest.release.version} ``` @@ -20,16 +20,16 @@ chapter = true 可配置属性: -| 属性名 | 是否必填 | -| ------------------------------- |:-------- | -| server-lists | 是 | -| namespace | 是 | -| base-sleep-time-milliseconds | 否 | -| max-sleep-time-milliseconds | 否 | -| max-retries | 否 | -| session-timeout-milliseconds | 否 | -| connection-timeout-milliseconds | 否 | -| digest | 否 | +| 属性名 | 是否必填 | +|---------------------------------|:-----| +| server-lists | 是 | +| namespace | 是 | +| base-sleep-time-milliseconds | 否 | +| max-sleep-time-milliseconds | 否 | +| max-retries | 否 | +| session-timeout-milliseconds | 否 | +| connection-timeout-milliseconds | 否 | +| digest | 否 | 配置格式参考: @@ -38,12 +38,12 @@ chapter = true elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-lite-springboot + namespace: elasticjob-engine-springboot ``` **Properties** ``` -elasticjob.reg-center.namespace=elasticjob-lite-springboot +elasticjob.reg-center.namespace=elasticjob-engine-springboot elasticjob.reg-center.server-lists=localhost:6181 ``` @@ -53,28 +53,28 @@ elasticjob.reg-center.server-lists=localhost:6181 可配置属性: -| 属性名 | 是否必填 | -| --------------------------------- |:-------- | -| elasticJobClass / elasticJobType | 是 | -| cron | 否 | -| timeZone | 否 | -| jobBootstrapBeanName | 否 | -| sharding-total-count | 是 | -| sharding-item-parameters | 否 | -| job-parameter | 否 | -| monitor-execution | 否 | -| failover | 否 | -| misfire | 否 | -| max-time-diff-seconds | 否 | -| reconcile-interval-minutes | 否 | -| job-sharding-strategy-type | 否 | -| job-executor-service-handler-type | 否 | -| job-error-handler-type | 否 | -| job-listener-types | 否 | -| description | 否 | -| props | 否 | -| disabled | 否 | -| overwrite | 否 | +| 属性名 | 是否必填 | +|-----------------------------------|:-----| +| elasticJobClass / elasticJobType | 是 | +| cron | 否 | +| timeZone | 否 | +| jobBootstrapBeanName | 否 | +| sharding-total-count | 是 | +| sharding-item-parameters | 否 | +| job-parameter | 否 | +| monitor-execution | 否 | +| failover | 否 | +| misfire | 否 | +| max-time-diff-seconds | 否 | +| reconcile-interval-minutes | 否 | +| job-sharding-strategy-type | 否 | +| job-executor-service-handler-type | 否 | +| job-error-handler-type | 否 | +| job-listener-types | 否 | +| description | 否 | +| props | 否 | +| disabled | 否 | +| overwrite | 否 | **elasticJobClass 与 elasticJobType 互斥,每项作业只能有一种类型** @@ -89,7 +89,7 @@ elasticjob.reg-center.server-lists=localhost:6181 elasticjob: jobs: simpleJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootSimpleJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob cron: 0/5 * * * * ? timeZone: GMT+08:00 shardingTotalCount: 3 @@ -110,7 +110,7 @@ elasticjob: **Properties** ``` -elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootSimpleJob +elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob elasticjob.jobs.simpleJob.cron=0/5 * * * * ? elasticjob.jobs.simpleJob.timeZone=GMT+08:00 elasticjob.jobs.simpleJob.sharding-total-count=3 @@ -129,11 +129,11 @@ elasticjob.jobs.manualScriptJob.props.script.command.line=echo Manual SCRIPT Job 配置前缀:`elasticjob.tracing` -| 属性名 | 可选值 | 是否必填 |描述 | -| -----------------|:-------- |:------- |:--------- | -| type | RDB | 否 | | -| includeJobNames | | 否 | 作业白名单 | -| excludeJobNames | | 否 | 作业黑名单 | +| 属性名 | 可选值 | 是否必填 | 描述 | +|-----------------|:----|:-----|:------| +| type | RDB | 否 | | +| includeJobNames | | 否 | 作业白名单 | +| excludeJobNames | | 否 | 作业黑名单 | **includeJobNames 与 excludeJobNames 互斥,事件追踪配置只能有一种属性** @@ -162,10 +162,10 @@ elasticjob.tracing.excludeJobNames=[ job-name ] 配置前缀:`elasticjob.dump` -| 属性名 | 缺省值 | 是否必填 | -| -----------------|:------------- |:-------- | -| enabled | true | 否 | -| port | | 是 | +| 属性名 | 缺省值 | 是否必填 | +|---------|:-----|:-----| +| enabled | true | 否 | +| port | | 是 | Spring Boot 提供了作业信息导出端口快速配置,只需在配置中指定导出所用的端口号即可启用导出功能。 如果没有指定端口号,导出功能不会生效。 diff --git a/docs/content/user-manual/elasticjob-lite/configuration/spring-boot-starter.en.md b/docs/content/user-manual/configuration/spring-boot-starter.en.md similarity index 82% rename from docs/content/user-manual/elasticjob-lite/configuration/spring-boot-starter.en.md rename to docs/content/user-manual/configuration/spring-boot-starter.en.md index eb403a7eb1..ae7afd8a72 100644 --- a/docs/content/user-manual/elasticjob-lite/configuration/spring-boot-starter.en.md +++ b/docs/content/user-manual/configuration/spring-boot-starter.en.md @@ -4,12 +4,12 @@ weight = 2 chapter = true +++ -To use the Spring boot, user need to add the dependency of the `elasticjob-lite-spring-boot-starter` module in the `pom.xml` file. +To use the Spring boot, user need to add the dependency of the `elasticjob-engine-spring-boot-starter` module in the `pom.xml` file. ```xml org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-boot-starter + elasticjob-engine-spring-boot-starter ${latest.release.version} ``` @@ -21,7 +21,7 @@ Prefix: `elasticjob.reg-center` Configuration: | Property name | Required | -| ------------------------------- |:-------- | +|---------------------------------|:---------| | server-lists | Yes | | namespace | Yes | | base-sleep-time-milliseconds | No | @@ -38,12 +38,12 @@ Reference: elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-lite-springboot + namespace: elasticjob-engine-springboot ``` **Properties** ``` -elasticjob.reg-center.namespace=elasticjob-lite-springboot +elasticjob.reg-center.namespace=elasticjob-engine-springboot elasticjob.reg-center.server-lists=localhost:6181 ``` @@ -54,7 +54,7 @@ Prefix: `elasticjob.jobs` Configuration: | Property name | Required | -| --------------------------------- |:-------- | +|-----------------------------------|:---------| | elasticJobClass / elasticJobType | Yes | | cron | No | | timeZone | No | @@ -90,7 +90,7 @@ Reference: elasticjob: jobs: simpleJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootSimpleJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob cron: 0/5 * * * * ? timeZone: GMT+08:00 shardingTotalCount: 3 @@ -111,7 +111,7 @@ elasticjob: **Properties** ``` -elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootSimpleJob +elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob elasticjob.jobs.simpleJob.cron=0/5 * * * * ? elasticjob.jobs.simpleJob.timeZone=GMT+08:00 elasticjob.jobs.simpleJob.sharding-total-count=3 @@ -130,11 +130,11 @@ elasticjob.jobs.manualScriptJob.props.script.command.line=echo Manual SCRIPT Job Prefix: `elasticjob.tracing` -| Property name | Options | Required | Description | -| -----------------|:---------|:-------- |:----------------- | -| type | RDB | No | | -| includeJobNames | | No | allow list of job | -| excludeJobNames | | No | block list of job | +| Property name | Options | Required | Description | +|-----------------|:--------|:---------|:------------------| +| type | RDB | No | | +| includeJobNames | | No | allow list of job | +| excludeJobNames | | No | block list of job | **"includeJobNames" and "excludeJobNames" are mutually exclusive.** @@ -163,10 +163,10 @@ elasticjob.tracing.excludeJobNames=[ job-name ] Prefix: `elasticjob.dump` -| Property name | Default value | Required | -| -----------------|:------------- |:-------- | -| enabled | true | No | -| port | | Yes | +| Property name | Default value | Required | +|---------------|:--------------|:---------| +| enabled | true | No | +| port | | Yes | Designate a port as dump port in configurations. The Spring Boot Starter will enable dumping automatically. If the port for job dump was missing, dump won't be enabled. diff --git a/docs/content/user-manual/configuration/spring-namespace.cn.md b/docs/content/user-manual/configuration/spring-namespace.cn.md new file mode 100644 index 0000000000..af51309b20 --- /dev/null +++ b/docs/content/user-manual/configuration/spring-namespace.cn.md @@ -0,0 +1,90 @@ ++++ +title = "Spring 命名空间" +weight = 3 +chapter = true ++++ + +使用 Spring 命名空间需在 pom.xml 文件中添加 elasticjob-engine-spring 模块的依赖。 + +```xml + + org.apache.shardingsphere.elasticjob + elasticjob-engine-spring-namespace + ${latest.release.version} + +``` + +命名空间:[http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd](http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd) + +## 注册中心配置 + +\ + +可配置属性: + +| 属性名 | 是否必填 | +|---------------------------------|:-----| +| id | 是 | +| server-lists | 是 | +| namespace | 是 | +| base-sleep-time-milliseconds | 否 | +| max-sleep-time-milliseconds | 否 | +| max-retries | 否 | +| session-timeout-milliseconds | 否 | +| connection-timeout-milliseconds | 否 | +| digest | 否 | + +## 作业配置 + +\ + +可配置属性: + +| 属性名 | 是否必填 | +|-----------------------------------|:-----| +| id | 是 | +| class | 否 | +| job-ref | 否 | +| registry-center-ref | 是 | +| tracing-ref | 否 | +| cron | 是 | +| timeZone | 否 | +| sharding-total-count | 是 | +| sharding-item-parameters | 否 | +| job-parameter | 否 | +| monitor-execution | 否 | +| failover | 否 | +| misfire | 否 | +| max-time-diff-seconds | 否 | +| reconcile-interval-minutes | 否 | +| job-sharding-strategy-type | 否 | +| job-executor-service-handler-type | 否 | +| job-error-handler-type | 否 | +| job-listener-types | 否 | +| description | 否 | +| props | 否 | +| disabled | 否 | +| overwrite | 否 | + +## 事件追踪配置 + +\ + +可配置属性: + +| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | +|-----------------|:-----------|:-----|:----|:----------------| +| id | String | 是 | | 事件追踪 Bean 主键 | +| data-source-ref | DataSource | 是 | | 事件追踪数据源 Bean 名称 | + +## 快照导出配置 + +\ + +可配置属性: + +| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | +|---------------------|:-------|:-----|:----|:---------------------------------------------------------------| +| id | String | 是 | | 监控服务在 Spring 容器中的主键 | +| registry-center-ref | String | 是 | | 注册中心 Bean 的引用,需引用 reg:zookeeper 的声明 | +| dump-port | String | 是 | | 导出作业信息数据端口
使用方法: echo "dump@jobName" \| nc 127.0.0.1 9888 | diff --git a/docs/content/user-manual/elasticjob-lite/configuration/spring-namespace.en.md b/docs/content/user-manual/configuration/spring-namespace.en.md similarity index 71% rename from docs/content/user-manual/elasticjob-lite/configuration/spring-namespace.en.md rename to docs/content/user-manual/configuration/spring-namespace.en.md index 34301a2614..4ece71528e 100644 --- a/docs/content/user-manual/elasticjob-lite/configuration/spring-namespace.en.md +++ b/docs/content/user-manual/configuration/spring-namespace.en.md @@ -4,12 +4,12 @@ weight = 2 chapter = true +++ -To use the Spring namespace, user need to add the dependency of the `elasticjob-lite-spring` module in the `pom.xml` file. +To use the Spring namespace, user need to add the dependency of the `elasticjob-engine-spring` module in the `pom.xml` file. ```xml org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-namespace + elasticjob-engine-spring-namespace ${latest.release.version} ``` @@ -23,7 +23,7 @@ Spring namespace: [http://shardingsphere.apache.org/schema/elasticjob/elasticjob Configuration: | Name | Required | -| ------------------------------- |:-------- | +|---------------------------------|:---------| | id | Yes | | server-lists | Yes | | namespace | Yes | @@ -41,7 +41,7 @@ Configuration: Configuration: | Name | Required | -| --------------------------------- |:-------- | +|-----------------------------------|:---------| | id | Yes | | class | No | | job-ref | No | @@ -72,7 +72,7 @@ Configuration: Configuration: | Name | Data Type | Required | Default Value | Description | -| --------------- |:---------- |:-------- |:------------- |:------------------------------------------- | +|-----------------|:-----------|:---------|:--------------|:------------------------------------------------| | id | String | Yes | | The bean's identify of the event tracing | | data-source-ref | DataSource | No | | The bean's name of the event tracing DataSource | @@ -82,8 +82,8 @@ Configuration: Configuration: -| Name | Data Type | Required | Default Value | Description | -| ------------------- |:----------- |:-------- |:------------- |:------------------------------------------------------------------------------- | -| id | String | Yes | | The identify of the monitoring service in the Spring container | -| registry-center-ref | String | Yes | | Registry center bean's reference, need to the statement of the `reg:zookeeper` | -| dump-port | String | Yes | | Job dump port
usage: echo "dump@jobName" \| nc 127.0.0.1 9888 | +| Name | Data Type | Required | Default Value | Description | +|---------------------|:----------|:---------|:--------------|:-------------------------------------------------------------------------------| +| id | String | Yes | | The identify of the monitoring service in the Spring container | +| registry-center-ref | String | Yes | | Registry center bean's reference, need to the statement of the `reg:zookeeper` | +| dump-port | String | Yes | | Job dump port
usage: echo "dump@jobName" \| nc 127.0.0.1 9888 | diff --git a/docs/content/user-manual/elasticjob-cloud/_index.cn.md b/docs/content/user-manual/elasticjob-cloud/_index.cn.md deleted file mode 100644 index 5f8f7c3966..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/_index.cn.md +++ /dev/null @@ -1,23 +0,0 @@ -+++ -pre = "4.2. " -title = "ElasticJob-Cloud" -weight = 2 -chapter = true -+++ - -## 简介 - -ElasticJob-Cloud 采用自研 Mesos Framework 的解决方案,额外提供资源治理、应用分发以及进程隔离等功能。 - -![ElasticJob-Cloud Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_cloud.png) - -## 对比 - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| --------- | ----------------- | ------------------ | -| 无中心化 | 是 | `否` | -| 资源分配 | 不支持 | `支持` | -| 作业模式 | 常驻 | `常驻 + 瞬时` | -| 部署依赖 | ZooKeeper | `ZooKeeper + Mesos` | - -ElasticJob-Cloud 的优势在于对资源细粒度治理,适用于需要削峰填谷的大数据系统。 diff --git a/docs/content/user-manual/elasticjob-cloud/_index.en.md b/docs/content/user-manual/elasticjob-cloud/_index.en.md deleted file mode 100644 index c5975608ef..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/_index.en.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -pre = "4.2. " -title = "ElasticJob-Cloud" -weight = 2 -chapter = true -+++ - -## Introduction - -ElasticJob-Cloud uses Mesos to manage and isolate resources. - -![ElasticJob-Cloud Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_cloud.png) - -## Comparison - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| ----------------- | ----------------- | -------------------- | -| Decentralization | Yes | `No` | -| Resource Assign | No | `Yes` | -| Job Execution | Daemon | `Daemon + Transient` | -| Deploy Dependency | ZooKeeper | `ZooKeeper + Mesos` | - -The advantages of ElasticJob-Cloud are resource management and isolation, -which is suitable for big data application with starve resource environment. diff --git a/docs/content/user-manual/elasticjob-cloud/configuration/_index.cn.md b/docs/content/user-manual/elasticjob-cloud/configuration/_index.cn.md deleted file mode 100644 index ce110b9642..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/configuration/_index.cn.md +++ /dev/null @@ -1,207 +0,0 @@ -+++ -pre = "4.2.2. " -title = "配置手册" -weight = 2 -chapter = true -+++ - -ElasticJob-Cloud 提供应用发布及作业注册等 RESTful API, 可通过 curl 操作。 - -请求 url 前缀为 `/api` - -## 鉴权 API - -### 获取 AccessToken - -url: login - -方法:POST - -参数类型:application/json - -参数列表: - -| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | -| ----------------------- |:------- |:------- |:--------- |:----------------------------- | -| username | String | 是 | | API 鉴权用户名 | -| password | String | 是 | | API 鉴权密码 | - -响应体: - -| 属性名 | 类型 | 描述 | -| ----------------------- |:------- |:----------------------------- | -| accessToken | String | API 鉴权 token | - -示例: - -```bash -curl -H "Content-Type: application/json" -X POST http://elasticjob_cloud_host:8899/api/login -d '{"username": "root", "password": "pwd"}' -``` - -响应体: - -```json -{"accessToken":"some_token"} -``` - -## 应用 API - -### 发布应用 - -url:app - -方法:POST - -参数类型:application/json - -参数列表: - -| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | -| ----------------------- |:------- |:------- |:--------- |:----------------------------- | -| appName | String | 是 | | 作业应用名称 | -| appURL | String | 是 | | 作业应用所在路径 | -| cpuCount | double | 否 | 1 | 作业应用启动所需要的 CPU 数量 | -| memoryMB | double | 否 | 128 | 作业应用启动所需要的内存 MB | -| bootstrapScript | String | 是 | | 启动脚本 | -| appCacheEnable | boolean | 否 | true | 每次执行作业时是否从缓存中读取应用 | -| eventTraceSamplingCount | int | 否 | 0(不采样)| 常驻作业事件采样率统计条数 | - -参数详细说明: - -**appName:** - -为 ElasticJob-Cloud 的作业应用唯一标识。 - -**appURL:** - -必须提供可以通过网络访问的路径。 - -**bootstrapScript:** - -如:bin\start.sh - -**appCacheEnable:** - -禁用则每次执行任务均从应用仓库下载应用至本地。 - -**eventTraceSamplingCount:** - -为避免数据量过大,可对频繁调度的常驻作业配置采样率,即作业每执行 N 次,才会记录作业执行及追踪相关数据。 - -示例: - -```bash -curl -l -H "Content-type: application/json" -X POST -d '{"appName":"my_app","appURL":"http://app_host:8080/my-job.tar.gz","cpuCount":0.1,"memoryMB":64.0,"bootstrapScript":"bin/start.sh","appCacheEnable":true,"eventTraceSamplingCount":0}' http://elastic_job_cloud_host:8899/api/app -``` - -### 修改应用配置 - -url:app - -方法:PUT - -参数类型:application/json - -参数列表: - -| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | -| ----------------------- |:------- |:------- |:--------- |:------------------------------- | -| appName | String | 是 | | 作业应用名称 | -| appCacheEnable | boolean | 是 | true | 每次执行作业时是否从缓存中读取应用 | -| eventTraceSamplingCount | int | 否 | 0(不采样)| 常驻作业事件采样率统计条数 | - -示例: - -```bash -curl -l -H "Content-type: application/json" -X PUT -d '{"appName":"my_app","appCacheEnable":true}' http://elastic_job_cloud_host:8899/api/app -``` - -## 作业 API - -### 注册作业 - -url:job/register - -方法:POST - -参数类型:application/json - -参数列表: - -| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | -| ----------------------------- |:---------- |:------- |:------ |:------------------------------------------------- | -| appName | String | 是 | | 作业应用名称 | -| cpuCount | double | 是 | | 单片作业所需要的 CPU 数量,最小值为 0.001 | -| memoryMB | double | 是 | | 单片作业所需要的内存 MB,最小值为 1 | -| jobExecutionType | Enum | 是 | | 作业执行类型。TRANSIENT 为瞬时作业,DAEMON 为常驻作业 | -| jobName | String | 是 | | 作业名称 | -| cron | String | 否 | | cron 表达式,用于配置作业触发时间 | -| shardingTotalCount | int | 是 | | 作业分片总数 | -| shardingItemParameters | String | 否 | | 自定义分片参数 | -| jobParameter | String | 否 | | 作业自定义参数 | -| failover | boolean | 否 | false | 是否开启失效转移 | -| misfire | boolean | 否 | false | 是否开启错过任务重新执行 | -| jobExecutorServiceHandlerType | boolean | 否 | false | 作业线程池处理策略 | -| jobErrorHandlerType | boolean | 否 | false | 作业错误处理策略 | -| description | String | 否 | | 作业描述信息 | -| props | Properties | 否 | | 作业属性配置信息 | - -使用脚本类型的瞬时作业可直接将脚本上传至 appURL,而无需打成 tar 包。 -如果只有单个脚本文件可无需压缩。 -如是复杂脚本应用,仍可上传 tar 包,支持各种常见压缩格式。 - -示例: - -```bash -curl -l -H "Content-type: application/json" -X POST -d '{"appName":"my_app","cpuCount":0.1,"memoryMB":64.0,"jobExecutionType":"TRANSIENT","jobName":"my_job","cron":"0/5 * * * * ?","shardingTotalCount":5,"failover":true,"misfire":true}' http://elastic_job_cloud_host:8899/api/job/register -``` - -### 修改作业配置 - -url:job/update - -方法:PUT - -参数类型:application/json - -参数:同注册作业 - -示例: - -```bash -curl -l -H "Content-type: application/json" -X PUT -d '{"appName":"my_app","jobName":"my_job","cpuCount":0.1,"memoryMB":64.0,"jobExecutionType":"TRANSIENT","cron":"0/5 * * * * ?","shardingTotalCount":5,"failover":true,"misfire":true}' http://elastic_job_cloud_host:8899/api/job/update -``` - -### 注销作业 - -url:job/deregister - -方法:DELETE - -参数类型:application/json - -参数:作业名称 - -示例: - -```bash -curl -l -H "Content-type: application/json" -X DELETE -d 'my_job' http://elastic_job_cloud_host:8899/api/job/deregister -``` - -### 触发一次作业 - -url:job/trigger - -方法:POST - -参数类型:application/json - -参数:作业名称 - -说明:即事件驱动,通过调用 API 而非定时的触发作业。目前仅对瞬时作业生效。 - -示例: - -```bash -curl -l -H "Content-type: application/json" -X POST -d 'my_job' http://elastic_job_cloud_host:8899/api/job/trigger -``` diff --git a/docs/content/user-manual/elasticjob-cloud/configuration/_index.en.md b/docs/content/user-manual/elasticjob-cloud/configuration/_index.en.md deleted file mode 100644 index 79eb0b8e00..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/configuration/_index.en.md +++ /dev/null @@ -1,208 +0,0 @@ -+++ -pre = "4.2.2. " -title = "Configuration" -weight = 2 -chapter = true -+++ - -ElasticJob-Cloud provides RESTful APIs such as application publishing and job registration, which can be operated by curl. - -Request URL prefix is `/api` - -## Authentication API - -### Get AccessToken - -url: login - -Method: POST - -Content type: application/json - -Parameter list: - -| Property name | Type | Required or not | Default value | Description | -| ----------------------- |:------- |:--------------- |:-------------- |:------------------------------------------------------------ | -| username | String | Yes | | API authentication username | -| password | String | Yes | | API authentication password | - -Response parameter: - -| Property name | Type | Description | -| ----------------------- |:------- |:----------------------------- | -| accessToken | String | API authentication token | - -Example: - -```bash -curl -H "Content-Type: application/json" -X POST http://elasticjob_cloud_host:8899/api/login -d '{"username": "root", "password": "pwd"}' -``` - -Response body: - -```json -{"accessToken":"some_token"} -``` - - -## Application API - -### Publish application - -url: app - -Method: POST - -Parameter type: application/json - -Parameter list: - -| Property name | Type | Required or not | Default value | Description | -| ----------------------- |:------- |:--------------- |:-------------- |:------------------------------------------------------------ | -| appName | String | Yes | | Job application name | -| appURL | String | Yes | | Path of job application | -| cpuCount | double | No | 1 | The number of CPUs required for the job application to start | -| memoryMB | double | No | 128 | MB of memory required to start the job application | -| bootstrapScript | String | Yes | | Boot script | -| appCacheEnable | boolean | No | true | Whether to read the application from the cache every time the job is executed | -| eventTraceSamplingCount | int | No | 0 (no sampling)| Number of resident job event sampling rate statistics | - -Detailed parameter description: - -**appName:** - -It is the unique identifier of ElasticJob-Cloud's job application. - -**appURL:** - -A path that can be accessed through the network must be provided. - -**bootstrapScript:** - -Example: bin\start.sh - -**appCacheEnable:** - -Disabled, every time the task is executed, the application will be downloaded from the application repository to the local. - -**eventTraceSamplingCount:** - -To avoid excessive data volume, you can configure the sampling rate for frequently scheduled resident jobs, that is, every N times the job is executed, the job execution and tracking related data will be recorded. - -Example: - -```bash -curl -l -H "Content-type: application/json" -X POST -d '{"appName":"my_app","appURL":"http://app_host:8080/my-job.tar.gz","cpuCount":0.1,"memoryMB":64.0,"bootstrapScript":"bin/start.sh","appCacheEnable":true,"eventTraceSamplingCount":0}' http://elastic_job_cloud_host:8899/api/app -``` - -### Modify application configuration - -url: app - -Method: PUT - -Parameter type: application/json - -Parameter list: - -| Property name | Type | Required or not | Default value | Description | -| ----------------------- |:------- |:--------------- |:------------------ |:---------------------------------------------------- | -| appName | String | Yes | | Job application name | -| appCacheEnable | boolean | Yes | true | Whether to read the application from the cache every time the job is executed | -| eventTraceSamplingCount | int | No | 0 (no sampling) | Number of resident job event sampling rate statistics| - -Example: - -```bash -curl -l -H "Content-type: application/json" -X PUT -d '{"appName":"my_app","appCacheEnable":true}' http://elastic_job_cloud_host:8899/api/app -``` - -## Job API - -### Register job - -url: job/register - -Method: POST - -Parameter type: application/json - -Parameter list: - -| Property name | Type | Required or not | Default value | Description | -| ----------------------------- |:---------- |:---------------- |:-------------- |:-------------------------------------------------------------------------------------- | -| appName | String | Yes | | Job application name | -| cpuCount | double | Yes | | The number of CPUs required for a single chip operation, the minimum value is 0.001 | -| memoryMB | double | Yes | | The memory MB required for a single chip operation, the minimum is 1 | -| jobExecutionType | Enum | Yes | | Job execution type. TRANSIENT is a transient operation, DAEMON is a resident operation | -| jobName | String | Yes | | Job name | -| cron | String | No | | cron expression, used to configure job trigger time | -| shardingTotalCount | int | Yes | | Total number of job shards | -| shardingItemParameters | String | No | | Custom sharding parameters | -| jobParameter | String | No | | Job custom parameters | -| failover | boolean | No | false | Whether to enable failover | -| misfire | boolean | No | false | Whether to enable missed tasks to re-execute | -| jobExecutorServiceHandlerType | boolean | No | false | Job thread pool processing strategy | -| jobErrorHandlerType | boolean | No | false | Job error handling strategy | -| description | String | No | | Job description information | -| props | Properties | No | | Job property configuration information | - -Use the script type instantaneous job to upload the script directly to appURL without tar package. -If there is only a single script file, no compression is required. -If it is a complex script application, you can still upload a tar package and support various common compression formats. - -Example: - -```bash -curl -l -H "Content-type: application/json" -X POST -d '{"appName":"my_app","cpuCount":0.1,"memoryMB":64.0,"jobExecutionType":"TRANSIENT","jobName":"my_job","cron":"0/5 * * * * ?","shardingTotalCount":5,"failover":true,"misfire":true}' http://elastic_job_cloud_host:8899/api/job/register -``` - -### update job configuration - -url: job/update - -Method: PUT - -Parameter type: application/json - -Parameters: same as registration job - -Example: - -```bash -curl -l -H "Content-type: application/json" -X PUT -d '{"appName":"my_app","jobName":"my_job","cpuCount":0.1,"memoryMB":64.0,"jobExecutionType":"TRANSIENT","cron":"0/5 * * * * ?","shardingTotalCount":5,"failover":true,"misfire":true}' http://elastic_job_cloud_host:8899/api/job/update -``` - -### Deregister Job - -url: job/deregister - -Method: DELETE - -Parameter type: application/json - -Parameters: Job name - -Example: - -```bash -curl -l -H "Content-type: application/json" -X DELETE -d 'my_job' http://elastic_job_cloud_host:8899/api/job/deregister -``` - -### Trigger job - -url: job/trigger - -Method: POST - -Parameter type: application/json - -Parameters: Job name - -Description: Event-driven, triggering jobs by calling API instead of timing. Currently only valid for transient operations. - -Example: - -```bash -curl -l -H "Content-type: application/json" -X POST -d 'my_job' http://elastic_job_cloud_host:8899/api/job/trigger -``` diff --git a/docs/content/user-manual/elasticjob-cloud/operation/_index.cn.md b/docs/content/user-manual/elasticjob-cloud/operation/_index.cn.md deleted file mode 100644 index 30923b4d72..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/_index.cn.md +++ /dev/null @@ -1,8 +0,0 @@ -+++ -pre = "4.2.3. " -title = "运维手册" -weight = 3 -chapter = true -+++ - -本章节是 ElasticJob-Cloud 的运维参考手册。 diff --git a/docs/content/user-manual/elasticjob-cloud/operation/_index.en.md b/docs/content/user-manual/elasticjob-cloud/operation/_index.en.md deleted file mode 100644 index 14495df08f..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/_index.en.md +++ /dev/null @@ -1,8 +0,0 @@ -+++ -pre = "4.2.3. " -title = "Operation" -weight = 3 -chapter = true -+++ - -This chapter is an operation manual for ElasticJob-Cloud. diff --git a/docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.cn.md b/docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.cn.md deleted file mode 100755 index f97b6cda6e..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.cn.md +++ /dev/null @@ -1,45 +0,0 @@ -+++ -title = "部署指南" -weight = 1 -chapter = true -+++ - -## 调度器部署步骤 - -1. 启动 ElasticJob-Cloud-Scheduler 和 Mesos 指定作为注册中心的 ZooKeeper -1. 启动 Mesos Master 和 Mesos Agent -1. 解压 `elasticjob-cloud-scheduler-${version}.tar.gz` -1. 执行 `bin\start.sh` 脚本启动 elasticjob-cloud-scheduler - -## 作业部署步骤 - -1. 确保 ZooKeeper, Mesos Master/Agent 以及 ElasticJob-Cloud-Scheduler 已正确启动 -1. 将打包作业的 tar.gz 文件放至网络可访问的位置,如:ftp或http。打包的 tar.gz 文件中 `main` 方法需要调用 ElasticJob-Cloud 提供的 `JobBootstrap.execute` 方法 -1. 使用 curl 命令调用 RESTful API 发布应用及注册作业。详情请参见:[配置指南](/cn/user-manual/elasticjob-cloud/configuration) - -## 调度器配置步骤 - -可修改 `conf\elasticjob-cloud-scheduler.properties` 文件变更系统配置。 - -配置项说明: - -| 属性名称 | 是否必填 | 默认值 | 描述 | -| ------------------------ |:------- |:------------------------- |:------------------------------------------------------------------------------------------ | -| hostname | 是 | | 服务器真实的 IP 或 hostname,不能是 127.0.0.1 或 localhost | -| user | 否 | | Mesos framework 使用的用户名称 | -| mesos_url | 是 | zk://127.0.0.1:2181/mesos | Mesos 所使用的 ZooKeeper 地址 | -| zk_servers | 是 | 127.0.0.1:2181 | ElasticJob-Cloud 所使用的 ZooKeeper 地址 | -| zk_namespace | 否 | elasticjob-cloud | ElasticJob-Cloud 所使用的 ZooKeeper 命名空间 | -| zk_digest | 否 | | ElasticJob-Cloud 所使用的 ZooKeeper 登录凭证 | -| http_port | 是 | 8899 | RESTful API 所使用的端口号 | -| job_state_queue_size | 是 | 10000 | 堆积作业最大值, 超过此阀值的堆积作业将直接丢弃。阀值过大可能会导致 ZooKeeper 无响应,应根据实测情况调整 | -| event_trace_rdb_driver | 否 | | 作业事件追踪数据库驱动 | -| event_trace_rdb_url | 否 | | 作业事件追踪数据库 URL | -| event_trace_rdb_username | 否 | | 作业事件追踪数据库用户名 | -| event_trace_rdb_password | 否 | | 作业事件追踪数据库密码 | -| auth_username | 否 | root | API 鉴权用户名 | -| auth_password | 否 | pwd | API 鉴权密码 | - -*** - -* 停止:不提供停止脚本,可直接使用 kill 命令终止进程。 diff --git a/docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.en.md b/docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.en.md deleted file mode 100755 index 3d8d316cd2..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/deploy-guide.en.md +++ /dev/null @@ -1,45 +0,0 @@ -+++ -title = "Deploy Guide" -weight = 1 -chapter = true -+++ - -## Scheduler deployment steps - -1. Start ElasticJob-Cloud-Scheduler and Mesos, and specify ZooKeeper as the registry. -2. Start Mesos Master and Mesos Agent. -3. Unzip `elasticjob-cloud-scheduler-${version}.tar.gz`. -4. Run `bin\start.sh` to start ElasticJob-Cloud-Scheduler. - -## Job deployment steps - -1. Ensure that ZooKeeper, Mesos Master/Agent and ElasticJob-Cloud-Scheduler have been started correctly. -2. Place the tar.gz file of the packaging job in a network accessible location, such as ftp or http. The `main` method in the packaged tar.gz file needs to call the `JobBootstrap.execute` method provided by ElasticJob-Cloud. -3. Use curl command to call RESTful API to publish applications and register jobs. For details: [Configuration](/en/user-manual/elasticjob-cloud/configuration) - -## Scheduler configuration steps - -Modify the `conf\elasticjob-cloud-scheduler.properties` to change the system configuration. - -Configuration description: - -| Attribute Name | Required | Default | Description | -| ------------------------ |:------- |:------------------------- |:------------------------------------------------------------------------------------------ | -| hostname | yes | | The real IP or hostname of the server, cannot be 127.0.0.1 or localhost | -| user | no | | User name used by Mesos framework | -| mesos_url | yes | zk://127.0.0.1:2181/mesos | Zookeeper url used by Mesos | -| zk_servers | yes | 127.0.0.1:2181 | Zookeeper address used by ElasticJob-Cloud | -| zk_namespace | no | elasticjob-cloud | Zookeeper namespace used by ElasticJob-Cloud | -| zk_digest | no | | Zookeeper digest used by ElasticJob-Cloud | -| http_port | yes | 8899 | Port used by RESTful API | -| job_state_queue_size | yes | 10000 | The maximum value of the accumulation job, the accumulation job exceeding this threshold will be discarded. Too large value may cause ZooKeeper to become unresponsive, and should be adjusted according to the actual measurement | -| event_trace_rdb_driver | no | | Driver of Job event tracking database | -| event_trace_rdb_url | no | | Url of Job event tracking database | -| event_trace_rdb_username | no | | Username of Job event tracking database | -| event_trace_rdb_password | no | | Password of Job event tracking database | -| auth_username | no | root | API authentication username | -| auth_password | no | pwd | API authentication password | - -*** - -* Stop: No stop script is provided, you can directly use the kill command to terminate the process. diff --git a/docs/content/user-manual/elasticjob-cloud/operation/high-availability.cn.md b/docs/content/user-manual/elasticjob-cloud/operation/high-availability.cn.md deleted file mode 100755 index ab312b71d0..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/high-availability.cn.md +++ /dev/null @@ -1,25 +0,0 @@ -+++ -title = "高可用" -weight = 2 -chapter = true -+++ - -## 介绍 - -调度器的高可用是通过运行几个指向同一个 ZooKeeper 集群的 ElasticJob-Cloud-Scheduler 实例来实现的。 -ZooKeeper 用于在当前主 ElasticJob-Cloud-Scheduler 实例失败的情况下执行领导者选举。 -通过至少两个调度器实例来构成集群,集群中只有一个调度器实例提供服务,其他实例处于`待命`状态。 -当该实例失败时,集群会选举剩余实例中的一个来继续提供服务。 - -## 配置 - -每个 ElasticJob-Cloud-Scheduler 实例必须使用相同的 ZooKeeper 集群。 -例如,如果 ZooKeeper 的 Quorum 为 zk://1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181/elasticjob-cloud,则 `elasticjob-cloud-scheduler.properties` 中 ZooKeeper 相关配置为: - -```properties -# ElasticJob-Cloud's ZooKeeper address -zk_servers=1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181 - -# ElasticJob-Cloud's ZooKeeper namespace -zk_namespace=elasticjob-cloud -``` diff --git a/docs/content/user-manual/elasticjob-cloud/operation/high-availability.en.md b/docs/content/user-manual/elasticjob-cloud/operation/high-availability.en.md deleted file mode 100755 index 319185bf45..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/high-availability.en.md +++ /dev/null @@ -1,26 +0,0 @@ -+++ -title = "High Available" -weight = 2 -chapter = true -+++ - -## Introduction - -The high availability of the scheduler is achieved by running several ElasticJob-Cloud-Scheduler instances pointing to the same ZooKeeper cluster. -ZooKeeper is used to perform leader election when the current primary ElasticJob-Cloud-Scheduler instance fails. -At least two scheduler instances are used to form a cluster. Only one scheduler instance in the cluster provides services, and the other instances are in the `standby` state. -When the instance fails, the cluster will elect one of the remaining instances to continue providing services. - -## Configuration - -Each ElasticJob-Cloud-Scheduler instance must use the same ZooKeeper cluster. -For example,if the Quorum of ZooKeeper is zk://1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181/elasticjob-cloud,the ZooKeeper related configuration in `elasticjob-cloud-scheduler.properties` is: - -```properties -# ElasticJob-Cloud's ZooKeeper address -zk_servers=1.2.3.4:2181,2.3.4.5:2181,3.4.5.6:2181 - -# ElasticJob-Cloud's ZooKeeper namespace -zk_namespace=elasticjob-cloud -``` - diff --git a/docs/content/user-manual/elasticjob-cloud/operation/web-console.cn.md b/docs/content/user-manual/elasticjob-cloud/operation/web-console.cn.md deleted file mode 100755 index 10273e2ea2..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/web-console.cn.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -title = "运维平台" -weight = 3 -chapter = true -+++ - -运维平台内嵌于 elasticjob-cloud-scheduler 的 jar 包中,无需额外启动 WEB 服务器。 -可通过修改配置文件中 http_port 参数来调整启动端口,默认端口为 8899,访问地址为 `http://{your_scheduler_ip}:8899`。 - -## 登录 - -提供两种账户,管理员及访客,管理员拥有全部操作权限,访客仅拥有察看权限。 -默认管理员用户名和密码是 root/root,访客用户名和密码是 guest/guest,可通过 `conf\auth.properties` 修改管理员及访客用户名及密码。 - -## 功能列表 - -- 应用管理(发布、修改、查看) -- 作业管理(注册、修改、查看以及删除) -- 作业状态查看(待运行、运行中、待失效转移) -- 作业历史查看(运行轨迹、执行状态、历史仪表盘) - -## 设计理念 - -运维平台采用纯静态 HTML + JavaScript 方式与后台的 RESTful API 交互,通过读取作业注册中心展示作业配置和状态,数据库展现作业运行轨迹及执行状态,或更新作业注册中心数据修改作业配置。 diff --git a/docs/content/user-manual/elasticjob-cloud/operation/web-console.en.md b/docs/content/user-manual/elasticjob-cloud/operation/web-console.en.md deleted file mode 100755 index 709e9d0a52..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/operation/web-console.en.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -title = "Console" -weight = 3 -chapter = true -+++ - -The operation and maintenance platform is embedded in the jar package of elasticjob-cloud-scheduler, and there is no need to start an additional WEB server. -The startup port can be adjusted by modifying the http_port parameter in the configuration file. The default port is 8899 and the access address is `http://{your_scheduler_ip}:8899`. - -## Log in - -Two types of accounts are provided, administrator and guest. The administrator has all operation permissions, and the visitor only has viewing permissions. -The default administrator user name and password are root/root, and the guest user name and password are guest/guest. You can modify the administrator and guest user names and passwords through `conf\auth.properties`. - -## Function list - -- Application management (publish, modify, view) -- Job management (register, modify, view and delete) -- View job status (waiting to run, running, pending failover) -- Job history view (running track, execution status, historical dashboard) - -## Design concept - -The operation and maintenance platform uses pure static HTML + JavaScript to interact with the back-end RESTful API. It displays the job configuration and status by reading the job registry, the database displays the job running track and execution status, or updates the job registry data to modify the job configuration. \ No newline at end of file diff --git a/docs/content/user-manual/elasticjob-cloud/usage/_index.cn.md b/docs/content/user-manual/elasticjob-cloud/usage/_index.cn.md deleted file mode 100644 index d48c087c98..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/usage/_index.cn.md +++ /dev/null @@ -1,9 +0,0 @@ -+++ -pre = "4.2.1. " -title = "使用手册" -weight = 1 -chapter = true -+++ - -本章节将介绍 ElasticJob-Cloud 相关使用。 -更多使用细节请参见[使用示例](https://github.com/apache/shardingsphere-elasticjob/tree/master/examples)。 diff --git a/docs/content/user-manual/elasticjob-cloud/usage/_index.en.md b/docs/content/user-manual/elasticjob-cloud/usage/_index.en.md deleted file mode 100644 index 6430c56bb7..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/usage/_index.en.md +++ /dev/null @@ -1,9 +0,0 @@ -+++ -pre = "4.2.1. " -title = "Usage" -weight = 1 -chapter = true -+++ - -This chapter will introduce the use of ElasticJob-Cloud. -Please refer to [Example](https://github.com/apache/shardingsphere-elasticjob/tree/master/examples) for more details. diff --git a/docs/content/user-manual/elasticjob-cloud/usage/dev-guide.cn.md b/docs/content/user-manual/elasticjob-cloud/usage/dev-guide.cn.md deleted file mode 100755 index 465100af7f..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/usage/dev-guide.cn.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -title = "开发指南" -weight = 1 -chapter = true -+++ - -## 作业开发 - -ElasticJob-Lite 和 ElasticJob-Cloud 提供统一作业接口,开发者仅需对业务作业进行一次开发,之后可根据不同的配置以及部署至不同环境。 - -作业开发详情请参见 [ElasticJob-Lite 使用手册](/cn/user-manual/elasticjob-lite/usage/)。 - -## 作业启动 - -需定义 `main` 方法并调用 `JobBootstrap.execute()`,例子如下: - -```java -public class MyJobDemo { - - public static void main(final String[] args) { - JobBootstrap.execute(new MyJob()); - } -} -``` diff --git a/docs/content/user-manual/elasticjob-cloud/usage/dev-guide.en.md b/docs/content/user-manual/elasticjob-cloud/usage/dev-guide.en.md deleted file mode 100755 index e47c0d6fd2..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/usage/dev-guide.en.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -title = "Dev Guide" -weight = 1 -chapter = true -+++ - -## Job development - -ElasticJob-Lite and ElasticJob-Cloud provide a unified job interface, developers only need to develop business jobs once, and then they can deploy to different environments according to different configurations. - -For details of job development, please refer to [ElasticJob-Lite user manual](/en/user-manual/elasticjob-lite/usage/). - -## Job start - -You need to define the `main` method and call it `JobBootstrap.execute()`, for example: - -```java -public class MyJobDemo { - - public static void main(final String[] args) { - JobBootstrap.execute(new MyJob()); - } -} -``` diff --git a/docs/content/user-manual/elasticjob-cloud/usage/local-executor.cn.md b/docs/content/user-manual/elasticjob-cloud/usage/local-executor.cn.md deleted file mode 100755 index c4148fce9c..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/usage/local-executor.cn.md +++ /dev/null @@ -1,21 +0,0 @@ -+++ -title = "本地运行模式" -weight = 2 -chapter = true -+++ - -在开发 ElasticJob-Cloud 作业时,开发人员可以脱离 Mesos 环境,在本地运行和调试作业。 -可以利用本地运行模式充分的调试业务功能以及单元测试,完成之后再部署至 Mesos 集群。 - -本地运行作业无需安装 Mesos 环境。 - -```java -// 创建作业配置 -JobConfiguration jobConfig = JobConfiguration.newBuilder("myJob", 3).cron("0/5 * * * * ?").build(); - -// 配置当前运行的作业的分片项 -int shardingItem = 0; - -// 创建本地执行器 -new LocalTaskExecutor(new MyJob(), jobConfig, shardingItem).execute(); -``` diff --git a/docs/content/user-manual/elasticjob-cloud/usage/local-executor.en.md b/docs/content/user-manual/elasticjob-cloud/usage/local-executor.en.md deleted file mode 100755 index cd3a97fd8c..0000000000 --- a/docs/content/user-manual/elasticjob-cloud/usage/local-executor.en.md +++ /dev/null @@ -1,21 +0,0 @@ -+++ -title = "Local Executor" -weight = 2 -chapter = true -+++ - -When developing ElasticJob-Cloud jobs, developers can leave the Mesos environment to run and debug jobs locally. -The local operating mode can be used to fully debug business functions and unit tests, and then deploy to the Mesos cluster after completion. - -There is no need to install the Mesos environment to run jobs locally. - -```java -// Create job configuration -JobConfiguration jobConfig = JobConfiguration.newBuilder("myJob", 3).cron("0/5 * * * * ?").build(); - -// Configure the fragmentation item of the currently running job -int shardingItem = 0; - -// Create a local executor -new LocalTaskExecutor(new MyJob(), jobConfig, shardingItem).execute(); -``` diff --git a/docs/content/user-manual/elasticjob-lite/_index.cn.md b/docs/content/user-manual/elasticjob-lite/_index.cn.md deleted file mode 100644 index 7e9b483209..0000000000 --- a/docs/content/user-manual/elasticjob-lite/_index.cn.md +++ /dev/null @@ -1,23 +0,0 @@ -+++ -pre = "4.1. " -title = "ElasticJob-Lite" -weight = 1 -chapter = true -+++ - -## 简介 - -ElasticJob-Lite 定位为轻量级无中心化解决方案,使用 jar 的形式提供分布式任务的协调服务。 - -![ElasticJob-Lite Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) - -## 对比 - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| --------- | ----------------- | ------------------ | -| 无中心化 | `是` | 否 | -| 资源分配 | `不支持` | 支持 | -| 作业模式 | `常驻` | 常驻 + 瞬时 | -| 部署依赖 | `ZooKeeper` | ZooKeeper + Mesos | - -ElasticJob-Lite 的优势在于无中心化设计且外部依赖少,适用于资源分配稳定的业务系统。 diff --git a/docs/content/user-manual/elasticjob-lite/_index.en.md b/docs/content/user-manual/elasticjob-lite/_index.en.md deleted file mode 100644 index 64614aa63e..0000000000 --- a/docs/content/user-manual/elasticjob-lite/_index.en.md +++ /dev/null @@ -1,24 +0,0 @@ -+++ -pre = "4.1. " -title = "ElasticJob-Lite" -weight = 1 -chapter = true -+++ - -## Introduction - -ElasticJob-Lite is a lightweight, decentralized solution that provides distributed task sharding services. - -![ElasticJob-Lite Architecture](https://shardingsphere.apache.org/elasticjob/current/img/architecture/elasticjob_lite.png) - -## Comparison - -| | *ElasticJob-Lite* | *ElasticJob-Cloud* | -| ----------------- | ----------------- | ------------------ | -| Decentralization | `Yes` | No | -| Resource Assign | `No` | Yes | -| Job Execution | `Daemon` | Daemon + Transient | -| Deploy Dependency | `ZooKeeper` | ZooKeeper + Mesos | - -The advantages of ElasticJob-Lite are no centralized design and less external dependence, -which is suitable for business application with stable resource allocation. diff --git a/docs/content/user-manual/elasticjob-lite/configuration/_index.en.md b/docs/content/user-manual/elasticjob-lite/configuration/_index.en.md deleted file mode 100644 index 860631f4b5..0000000000 --- a/docs/content/user-manual/elasticjob-lite/configuration/_index.en.md +++ /dev/null @@ -1,136 +0,0 @@ -+++ -pre = "4.1.2 " -title = "Configuration" -weight = 2 -chapter = true -+++ - -Through which developers can quickly and clearly understand the functions provided by ElasticJob-Lite. - -This chapter is a configuration manual for ElasticJob-Lite, which can also be referred to as a dictionary if necessary. - -ElasticJob-Lite has provided 3 kinds of configuration methods for different situations. - -## Registry Center Configuration - -### Configuration - -| Name | Data Type | Default Value | Description | -| ----------------------------- |:------------- |:------------- |:-------------------------------------------------------- | -| serverLists | String | | ZooKeeper server IP list | -| namespace | String | | ZooKeeper namespace | -| baseSleepTimeMilliseconds | int | 1000 | The initial value of milliseconds for the retry interval | -| maxSleepTimeMilliseconds | String | 3000 | The maximum value of milliseconds for the retry interval | -| maxRetries | String | 3 | Maximum number of retries | -| sessionTimeoutMilliseconds | int | 60000 | Session timeout in milliseconds | -| connectionTimeoutMilliseconds | int | 15000 | Connection timeout in milliseconds | -| digest | String | no need | Permission token to connect to ZooKeeper | - -### Core Configuration Description - -**serverLists:** - -Include IP and port, multiple addresses are separated by commas, such as: `host1:2181,host2:2181` - -## Job Configuration - -### Configuration - -| Name | Data Type | Default Value | Description | -| ----------------------------- |:--------------- |:-------------------- |:------------------------------------------------------------------------------------ | -| jobName | String | | Job name | -| shardingTotalCount | int | | Sharding total count | -| cron | String | | CRON expression, control the job trigger time | -| timeZone | String | | time zone of CRON | -| shardingItemParameters | String | | Sharding item parameters | -| jobParameter | String | | Job parameter | -| monitorExecution | boolean | true | Monitor job execution status | -| failover | boolean | false | Enable or disable job failover | -| misfire | boolean | true | Enable or disable the missed task to re-execute | -| maxTimeDiffSeconds | int | -1(no check) | The maximum value for time difference between server and registry center in seconds | -| reconcileIntervalMinutes | int | 10 | Service scheduling interval in minutes for repairing job server inconsistent state | -| jobShardingStrategyType | String | AVG_ALLOCATION | Job sharding strategy type | -| jobExecutorServiceHandlerType | String | CPU | Job thread pool handler type | -| jobErrorHandlerType | String | | Job error handler type | -| description | String | | Job description | -| props | Properties | | Job properties | -| disabled | boolean | false | Enable or disable start the job | -| overwrite | boolean | false | Enable or disable local configuration override registry center configuration | - -### Core Configuration Description - -**shardingItemParameters:** - -The sequence numbers and parameters of the Sharding items are separated by equal sign, and multiple key-value pairs are separated by commas. -The Sharding sequence number starts from `0` and can't be greater than or equal to the total number of job fragments. -For example: `0=a,1=b,2=c` - -**jobParameter:** - -With this parameter, user can pass parameters for the business method of job scheduling, which is used to implement the job with parameters. -For example: `Amount of data acquired each time`, `Primary key of the job instance read from the database`, etc. - -**monitorExecution:** - -When the execution time and interval of each job are very short, it is recommended not to monitor the running status of the job to improve efficiency. -There is no need to monitor because it is a transient state. User can add data accumulation monitoring by self. And there is no guarantee that the data will be selected repeatedly, idempotency should be achieved in the job. -If the job execution time and interval time are longer, it is recommended to monitor the job status, and it can guarantee that the data will not be selected repeatedly. - -**maxTimeDiffSeconds:** - -If the time error exceeds the configured seconds, an exception will be thrown when the job starts. - -**reconcileIntervalMinutes:** - -In a distributed system, due to network, clock and other reasons, ZooKeeper may be inconsistent with the actual running job. This inconsistency cannot be completely avoided through positive verification. -It is necessary to start another thread to periodically calibrate the consistency between the registry center and the job status, that is, to maintain the final consistency of ElasticJob. - -Less than `1` means no repair is performed. - -**jobShardingStrategyType:** - -For details, see[Job Sharding Strategy](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/sharding)。 - -**jobExecutorServiceHandlerType:** - -For details, see[Thread Pool Strategy](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/thread-pool)。 - -**jobErrorHandlerType:** - -For details, see[Error Handler Strategy](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler)。 - -**props:** - -For details, see[Job Properties](/en/user-manual/elasticjob-lite/configuration/props)。 - -**disabled:** - -It can be used for deployment, forbid jobs to start, and then start them uniformly after the deployment is completed. - -**overwrite:** - -If the value is `true`, local configuration override registry center configuration every time the job is started. - -## Job Listener Configuration - -### Common Listener Configuration - -Configuration: no - -### Distributed Listener Configuration - -Configuration - -| Name | Data Type | Default Value | Description | -| ------------------------------ |:------------ |:-------------- |:----------------------------------------------------------- | -| started-timeout-milliseconds | long | Long.MAX_VALUE | The timeout in milliseconds before the last job is executed | -| completed-timeout-milliseconds | long | Long.MAX_VALUE | The timeout in milliseconds after the last job is executed | - -## Event Tracing Configuration - -### Configuration - -| Name | Data Type | Default Value | Description | -| ------- |:-------------- |:------------- |:------------------------------------------- | -| type | String | | The type of event tracing storage adapter | -| storage | Generics Type | | The object of event tracing storage adapter | diff --git a/docs/content/user-manual/elasticjob-lite/configuration/spring-namespace.cn.md b/docs/content/user-manual/elasticjob-lite/configuration/spring-namespace.cn.md deleted file mode 100644 index a1cf12cb92..0000000000 --- a/docs/content/user-manual/elasticjob-lite/configuration/spring-namespace.cn.md +++ /dev/null @@ -1,90 +0,0 @@ -+++ -title = "Spring 命名空间" -weight = 3 -chapter = true -+++ - -使用 Spring 命名空间需在 pom.xml 文件中添加 elasticjob-lite-spring 模块的依赖。 - -```xml - - org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-namespace - ${latest.release.version} - -``` - -命名空间:[http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd](http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd) - -## 注册中心配置 - -\ - -可配置属性: - -| 属性名 | 是否必填 | -| ------------------------------- |:------- | -| id | 是 | -| server-lists | 是 | -| namespace | 是 | -| base-sleep-time-milliseconds | 否 | -| max-sleep-time-milliseconds | 否 | -| max-retries | 否 | -| session-timeout-milliseconds | 否 | -| connection-timeout-milliseconds | 否 | -| digest | 否 | - -## 作业配置 - -\ - -可配置属性: - -| 属性名 | 是否必填 | -| --------------------------------- |:-------- | -| id | 是 | -| class | 否 | -| job-ref | 否 | -| registry-center-ref | 是 | -| tracing-ref | 否 | -| cron | 是 | -| timeZone | 否 | -| sharding-total-count | 是 | -| sharding-item-parameters | 否 | -| job-parameter | 否 | -| monitor-execution | 否 | -| failover | 否 | -| misfire | 否 | -| max-time-diff-seconds | 否 | -| reconcile-interval-minutes | 否 | -| job-sharding-strategy-type | 否 | -| job-executor-service-handler-type | 否 | -| job-error-handler-type | 否 | -| job-listener-types | 否 | -| description | 否 | -| props | 否 | -| disabled | 否 | -| overwrite | 否 | - -## 事件追踪配置 - -\ - -可配置属性: - -| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | -| --------------- |:---------- |:------- |:----- |:--------------------- | -| id | String | 是 | | 事件追踪 Bean 主键 | -| data-source-ref | DataSource | 是 | | 事件追踪数据源 Bean 名称 | - -## 快照导出配置 - -\ - -可配置属性: - -| 属性名 | 类型 | 是否必填 | 缺省值 | 描述 | -| ------------------- |:------ |:------ |:------ |:------------------------------------------------------------------------ | -| id | String | 是 | | 监控服务在 Spring 容器中的主键 | -| registry-center-ref | String | 是 | | 注册中心 Bean 的引用,需引用 reg:zookeeper 的声明 | -| dump-port | String | 是 | | 导出作业信息数据端口
使用方法: echo "dump@jobName" \| nc 127.0.0.1 9888 | diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/_index.cn.md b/docs/content/user-manual/elasticjob-lite/usage/job-api/_index.cn.md deleted file mode 100644 index 405f2fd268..0000000000 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/_index.cn.md +++ /dev/null @@ -1,8 +0,0 @@ -+++ -title = "作业 API" -weight = 1 -chapter = true -+++ - -ElasticJob-Lite 支持原生 Java、Spring Boot Starter 和 Spring 自定义命名空间 3 种使用方式。 -本章节将详细介绍他们的使用方式。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.cn.md b/docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.cn.md deleted file mode 100644 index 3eb44e2943..0000000000 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.cn.md +++ /dev/null @@ -1,48 +0,0 @@ -+++ -title = "表结构说明" -weight = 4 -chapter = true -+++ - -事件追踪的 event_trace_rdb_url 属性对应库自动创建 JOB_EXECUTION_LOG 和 JOB_STATUS_TRACE_LOG 两张表以及若干索引。 - -## JOB_EXECUTION_LOG 字段含义 - -| 字段名称 | 字段类型 | 是否必填 | 描述 | -| ---------------- |:------------- |:-------- |:----------------------------------------------------- | -| id | VARCHAR(40) | 是 | 主键 | -| job_name | VARCHAR(100) | 是 | 作业名称 | -| task_id | VARCHAR(1000) | 是 | 任务名称,每次作业运行生成新任务 | -| hostname | VARCHAR(255) | 是 | 主机名称 | -| ip | VARCHAR(50) | 是 | 主机IP | -| sharding_item | INT | 是 | 分片项 | -| execution_source | VARCHAR(20) | 是 | 作业执行来源。可选值为NORMAL_TRIGGER, MISFIRE, FAILOVER | -| failure_cause | VARCHAR(2000) | 否 | 执行失败原因 | -| is_success | BIT | 是 | 是否执行成功 | -| start_time | TIMESTAMP | 是 | 作业开始执行时间 | -| complete_time | TIMESTAMP | 否 | 作业结束执行时间 | - -JOB_EXECUTION_LOG 记录每次作业的执行历史。 -分为两个步骤: - -1. 作业开始执行时向数据库插入数据,除 failure_cause 和 complete_time 外的其他字段均不为空。 -1. 作业完成执行时向数据库更新数据,更新 is_success, complete_time 和 failure_cause(如果作业执行失败)。 - -## JOB_STATUS_TRACE_LOG 字段含义 - -| 字段名称 | 字段类型 | 是否必填 | 描述 | -| ---------------- |:--------------|:---------|:------------------------------------------------------------------------------------------------------------- | -| id | VARCHAR(40) | 是 | 主键 | -| job_name | VARCHAR(100) | 是 | 作业名称 | -| original_task_id | VARCHAR(1000) | 是 | 原任务名称 | -| task_id | VARCHAR(1000) | 是 | 任务名称 | -| slave_id | VARCHAR(1000) | 是 | 执行作业服务器的名称,Lite版本为服务器的IP地址,Cloud版本为Mesos执行机主键 | -| source | VARCHAR(50) | 是 | 任务执行源,可选值为CLOUD_SCHEDULER, CLOUD_EXECUTOR, LITE_EXECUTOR | -| execution_type | VARCHAR(20) | 是 | 任务执行类型,可选值为NORMAL_TRIGGER, MISFIRE, FAILOVER | -| sharding_item | VARCHAR(255) | 是 | 分片项集合,多个分片项以逗号分隔 | -| state | VARCHAR(20) | 是 | 任务执行状态,可选值为TASK_STAGING, TASK_RUNNING, TASK_FINISHED, TASK_KILLED, TASK_LOST, TASK_FAILED, TASK_ERROR | -| message | VARCHAR(2000) | 是 | 相关信息 | -| creation_time | TIMESTAMP | 是 | 记录创建时间 | - -JOB_STATUS_TRACE_LOG 记录作业状态变更痕迹表。 -可通过每次作业运行的 task_id 查询作业状态变化的生命周期和运行轨迹。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.en.md b/docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.en.md deleted file mode 100644 index 9ebd3d2cef..0000000000 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/table-structure.en.md +++ /dev/null @@ -1,48 +0,0 @@ -+++ -title = "Table Structure" -weight = 4 -chapter = true -+++ - -The database which is the value of the event tracing property `event_trace_rdb_url` will automatically creates two tables `JOB_EXECUTION_LOG` and `JOB_STATUS_TRACE_LOG` and several indexes. - -## JOB_EXECUTION_LOG Columns - -| Column name | Column type | Required | Describe | -| ---------------- |:------------- |:--------- |:--------------------------------------------------------------------------------------- | -| id | VARCHAR(40) | Yes | Primary key | -| job_name | VARCHAR(100) | Yes | Job name | -| task_id | VARCHAR(1000) | Yes | Task name, create new tasks every time the job runs. | -| hostname | VARCHAR(255) | Yes | Hostname | -| ip | VARCHAR(50) | Yes | IP | -| sharding_item | INT | Yes | Sharding item | -| execution_source | VARCHAR(20) | Yes | Source of job execution. The value options are `NORMAL_TRIGGER`, `MISFIRE`, `FAILOVER`. | -| failure_cause | VARCHAR(2000) | No | The reason for execution failure | -| is_success | BIT | Yes | Execute successfully or not | -| start_time | TIMESTAMP | Yes | Job start time | -| complete_time | TIMESTAMP | No | Job end time | - -`JOB_EXECUTION_LOG` records the execution history of each job. -There are two steps: - -1. When the job is executed, program will create one record in the `JOB_EXECUTION_LOG`, and all fields except `failure_cause` and `complete_time` are not empty. -1. When the job completes execution, program will update the record, update the columns of `is_success`, `complete_time` and `failure_cause`(if the job execution fails). - -## JOB_STATUS_TRACE_LOG Columns - -| Column name | Column type | Required | Describe | -| ---------------- |:--------------|:----------|:------------------------------------------------------------------------------------------------------------------------------------------------------- | -| id | VARCHAR(40) | Yes | Primary key | -| job_name | VARCHAR(100) | Yes | Job name | -| original_task_id | VARCHAR(1000) | Yes | Original task name | -| task_id | VARCHAR(1000) | Yes | Task name | -| slave_id | VARCHAR(1000) | Yes | Server's name of executing the job. The valve is server's IP for `ElasticJob-Lite`, is `Mesos`'s primary key for `ElasticJob-Cloud`. | -| source | VARCHAR(50) | Yes | Source of job execution, the value options are `CLOUD_SCHEDULER`, `CLOUD_EXECUTOR`, `LITE_EXECUTOR`. | -| execution_type | VARCHAR(20) | Yes | Type of job execution, the value options are `NORMAL_TRIGGER`, `MISFIRE`, `FAILOVER`. | -| sharding_item | VARCHAR(255) | Yes | Collection of sharding item, multiple sharding items are separated by commas. | -| state | VARCHAR(20) | Yes | State of job execution, the value options are `TASK_STAGING`, `TASK_RUNNING`, `TASK_FINISHED`, `TASK_KILLED`, `TASK_LOST`, `TASK_FAILED`, `TASK_ERROR`. | -| message | VARCHAR(2000) | Yes | Message | -| creation_time | TIMESTAMP | Yes | Create time | - -`JOB_STATUS_TRACE_LOG` record the job status changes. -Through the `task_id` of each job, user can query the life cycle and running track of the job status change. diff --git a/docs/content/user-manual/elasticjob-lite/operation/_index.cn.md b/docs/content/user-manual/operation/_index.cn.md similarity index 59% rename from docs/content/user-manual/elasticjob-lite/operation/_index.cn.md rename to docs/content/user-manual/operation/_index.cn.md index 6de6cf20f9..79c41580ee 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/_index.cn.md +++ b/docs/content/user-manual/operation/_index.cn.md @@ -5,4 +5,4 @@ weight = 3 chapter = true +++ -本章节是 ElasticJob-Lite 的运维参考手册。 +本章节是 ElasticJob 的运维参考手册。 diff --git a/docs/content/user-manual/elasticjob-lite/operation/_index.en.md b/docs/content/user-manual/operation/_index.en.md similarity index 57% rename from docs/content/user-manual/elasticjob-lite/operation/_index.en.md rename to docs/content/user-manual/operation/_index.en.md index d09c7a9c95..b0ec888141 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/_index.en.md +++ b/docs/content/user-manual/operation/_index.en.md @@ -5,4 +5,4 @@ weight = 3 chapter = true +++ -This chapter is an operation manual for ElasticJob-Lite. +This chapter is an operation manual for ElasticJob. diff --git a/docs/content/user-manual/elasticjob-lite/operation/deploy-guide.cn.md b/docs/content/user-manual/operation/deploy-guide.cn.md similarity index 63% rename from docs/content/user-manual/elasticjob-lite/operation/deploy-guide.cn.md rename to docs/content/user-manual/operation/deploy-guide.cn.md index 71d02619e8..1cf38420d8 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/deploy-guide.cn.md +++ b/docs/content/user-manual/operation/deploy-guide.cn.md @@ -6,14 +6,14 @@ chapter = true ## 应用部署 -1. 启动 ElasticJob-Lite 指定注册中心的 ZooKeeper。 -1. 运行包含 ElasticJob-Lite 和业务代码的 jar 文件。不限于 jar 或 war 的启动方式。 +1. 启动 ElasticJob 指定注册中心的 ZooKeeper。 +1. 运行包含 ElasticJob 和业务代码的 jar 文件。不限于 jar 或 war 的启动方式。 1. 当作业服务器配置多网卡时,可通过设置系统变量 `elasticjob.preferred.network.interface` 指定网卡地址或 `elasticjob.preferred.network.ip` 指定IP。 ElasticJob 默认获取网卡列表中第一个非回环可用 IPV4 地址。 ## 运维平台和 RESTFul API 部署(可选) -1. 解压缩 `elasticjob-lite-console-${version}.tar.gz` 并执行 `bin\start.sh`。 +1. 解压缩 `elasticjob-console-${version}.tar.gz` 并执行 `bin\start.sh`。 1. 打开浏览器访问 `http://localhost:8899/` 即可访问控制台。8899 为默认端口号,可通过启动脚本输入 `-p` 自定义端口号。 1. 访问 RESTFul API 方法同控制台。 -1. `elasticjob-lite-console-${version}.tar.gz` 可通过 `mvn install` 编译获取。 +1. `elasticjob-console-${version}.tar.gz` 可通过 `mvn install` 编译获取。 diff --git a/docs/content/user-manual/elasticjob-lite/operation/deploy-guide.en.md b/docs/content/user-manual/operation/deploy-guide.en.md similarity index 69% rename from docs/content/user-manual/elasticjob-lite/operation/deploy-guide.en.md rename to docs/content/user-manual/operation/deploy-guide.en.md index 06ae59c56c..1f5bd717f5 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/deploy-guide.en.md +++ b/docs/content/user-manual/operation/deploy-guide.en.md @@ -6,15 +6,15 @@ chapter = true ## Application deployment -1. Start the ZooKeeper of the ElasticJob-Lite designated registry. -1. Run the jar file containing ElasticJob-Lite and business code. It is not limited to the startup mode of jar or war. +1. Start the ZooKeeper of the ElasticJob designated registry. +1. Run the jar file containing ElasticJob and business code. It is not limited to the startup mode of jar or war. 1. When the job server is configured with multiple network cards, the network card address can be specified by setting the system variable `elasticjob.preferred.network.interface` or specify network addresses by setting the system variable `elasticjob.preferred.network.ip`. ElasticJob obtains the first non-loopback available IPV4 address in the network card list by default. ## Operation and maintenance platform and RESTFul API deployment (optional) -1. Unzip `elasticjob-lite-console-${version}.tar.gz` and execute `bin\start.sh`. +1. Unzip `elasticjob-console-${version}.tar.gz` and execute `bin\start.sh`. 1. Open the browser and visit `http://localhost:8899/` to access the console. 8899 is the default port number. You can customize the port number by entering `-p` through the startup script. 1. The method of accessing RESTFul API is the same as the console. -1. `elasticjob-lite-console-${version}.tar.gz` can be obtained by compiling `mvn install`. +1. `elasticjob-console-${version}.tar.gz` can be obtained by compiling `mvn install`. diff --git a/docs/content/user-manual/elasticjob-lite/operation/dump.cn.md b/docs/content/user-manual/operation/dump.cn.md similarity index 79% rename from docs/content/user-manual/elasticjob-lite/operation/dump.cn.md rename to docs/content/user-manual/operation/dump.cn.md index 90fc454ed4..75c2c1515d 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/dump.cn.md +++ b/docs/content/user-manual/operation/dump.cn.md @@ -4,15 +4,15 @@ weight = 2 chapter = true +++ -使用 ElasticJob-Lite 过程中可能会碰到一些分布式问题,导致作业运行不稳定。 +使用 ElasticJob 过程中可能会碰到一些分布式问题,导致作业运行不稳定。 由于无法在生产环境调试,通过 dump 命令可以把作业内部相关信息导出,方便开发者调试分析; 另外为了不泄露隐私,已将相关信息中的 IP 地址以 ip1, ip2... 的形式过滤,可以在互联网上公开传输环境信息,便于进一步完善 ElasticJob。 ## 开启监听端口 -使用 Java 开启导出端口配置请参见[Java API 使用指南](/cn/user-manual/elasticjob-lite/usage/job-api/java-api)。 -使用 Spring 开启导出端口配置请参见[Spring 使用指南](/cn/user-manual/elasticjob-lite/usage/job-api/spring-namespace)。 +使用 Java 开启导出端口配置请参见[Java API 使用指南](/cn/user-manual/elasticjob/usage/job-api/java-api)。 +使用 Spring 开启导出端口配置请参见[Spring 使用指南](/cn/user-manual/elasticjob/usage/job-api/spring-namespace)。 ## 执行导出命令 diff --git a/docs/content/user-manual/elasticjob-lite/operation/dump.en.md b/docs/content/user-manual/operation/dump.en.md similarity index 87% rename from docs/content/user-manual/elasticjob-lite/operation/dump.en.md rename to docs/content/user-manual/operation/dump.en.md index f1c921ed86..23458b90ff 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/dump.en.md +++ b/docs/content/user-manual/operation/dump.en.md @@ -12,8 +12,8 @@ For security reason, the information dumped had already mask sensitive informati ## Open Listener Port -Using Java API please refer to [Java API usage](/en/user-manual/elasticjob-lite/usage/job-api/java-api) for more details. -Using Spring please refer to [Spring usage](/en/user-manual/elasticjob-lite/usage/job-api/spring-namespace) for more details. +Using Java API please refer to [Java API usage](/en/user-manual/elasticjob/usage/job-api/java-api) for more details. +Using Spring please refer to [Spring usage](/en/user-manual/elasticjob/usage/job-api/spring-namespace) for more details. ## Execute Dump diff --git a/docs/content/user-manual/elasticjob-lite/operation/execution-monitor.cn.md b/docs/content/user-manual/operation/execution-monitor.cn.md similarity index 66% rename from docs/content/user-manual/elasticjob-lite/operation/execution-monitor.cn.md rename to docs/content/user-manual/operation/execution-monitor.cn.md index ad965c376d..ef4947b5ce 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/execution-monitor.cn.md +++ b/docs/content/user-manual/operation/execution-monitor.cn.md @@ -4,7 +4,7 @@ weight = 3 chapter = true +++ -通过监听 ElasticJob-Lite 的 ZooKeeper 注册中心的几个关键节点即可完成作业运行状态监控功能。 +通过监听 ElasticJob 的 ZooKeeper 注册中心的几个关键节点即可完成作业运行状态监控功能。 ## 监听作业服务器存活 diff --git a/docs/content/user-manual/elasticjob-lite/operation/execution-monitor.en.md b/docs/content/user-manual/operation/execution-monitor.en.md similarity index 80% rename from docs/content/user-manual/elasticjob-lite/operation/execution-monitor.en.md rename to docs/content/user-manual/operation/execution-monitor.en.md index 2476372892..7a3a7e25b9 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/execution-monitor.en.md +++ b/docs/content/user-manual/operation/execution-monitor.en.md @@ -4,7 +4,7 @@ weight = 3 chapter = true +++ -By monitoring several key nodes in the zookeeper registry of ElasticJob-Lite, the job running status monitoring function can be completed. +By monitoring several key nodes in the zookeeper registry of ElasticJob, the job running status monitoring function can be completed. ## Monitoring job server alive diff --git a/docs/content/user-manual/elasticjob-lite/operation/web-console.cn.md b/docs/content/user-manual/operation/web-console.cn.md similarity index 84% rename from docs/content/user-manual/elasticjob-lite/operation/web-console.cn.md rename to docs/content/user-manual/operation/web-console.cn.md index 619a51e109..7c61838167 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/web-console.cn.md +++ b/docs/content/user-manual/operation/web-console.cn.md @@ -4,7 +4,7 @@ weight = 4 chapter = true +++ -解压缩 `elasticjob-lite-console-${version}.tar.gz` 并执行 `bin\start.sh`。 +解压缩 `elasticjob-console-${version}.tar.gz` 并执行 `bin\start.sh`。 打开浏览器访问 `http://localhost:8088/` 即可访问控制台。 8088 为默认端口号,可通过启动脚本输入 `-p` 自定义端口号。 @@ -21,11 +21,11 @@ auth.guest_username=guest auth.guest_password=guest ``` -## Casdoor登录 +## Casdoor 登录 -控制台集成了[Casdoor](https://casdoor.org/)单点登录,用户可以选择Casdoor进行登录等一些列操作。 +控制台集成了[Casdoor](https://casdoor.org/)单点登录,用户可以选择 Casdoor 进行登录等一些列操作。 -步骤一: 部署casdoor +步骤一: 部署 casdoor Casdoor的源代码托管在 GitHub: https://github.com/casdoor/casdoor 启动模式有开发模式和生产模式,此处以开发模式为例,[更多详细](https://casdoor.org/docs/basic/server-installation) @@ -79,7 +79,7 @@ yarn start ## 设计理念 -运维平台和 ElasticJob-Lite 并无直接关系,是通过读取作业注册中心数据展现作业状态,或更新注册中心数据修改全局配置。 +运维平台和 ElasticJob 并无直接关系,是通过读取作业注册中心数据展现作业状态,或更新注册中心数据修改全局配置。 控制台只能控制作业本身是否运行,但不能控制作业进程的启动,因为控制台和作业本身服务器是完全分离的,控制台并不能控制作业服务器。 @@ -88,5 +88,4 @@ yarn start * 添加作业 作业在首次运行时将自动添加。 -ElasticJob-Lite 以 jar 方式启动,并无作业分发功能。 -如需完全通过运维平台发布作业,请使用 ElasticJob-Cloud。 +ElasticJob 以 jar 方式启动,并无作业分发功能。 diff --git a/docs/content/user-manual/elasticjob-lite/operation/web-console.en.md b/docs/content/user-manual/operation/web-console.en.md similarity index 85% rename from docs/content/user-manual/elasticjob-lite/operation/web-console.en.md rename to docs/content/user-manual/operation/web-console.en.md index c4c71d9049..5ff8c890a9 100644 --- a/docs/content/user-manual/elasticjob-lite/operation/web-console.en.md +++ b/docs/content/user-manual/operation/web-console.en.md @@ -4,7 +4,7 @@ weight = 4 chapter = true +++ -Unzip `elasticjob-lite-console-${version}.tar.gz` and execute `bin\start.sh`. +Unzip `elasticjob-console-${version}.tar.gz` and execute `bin\start.sh`. Open the browser and visit `http://localhost:8899/` to access the console. 8899 is the default port number. You can customize the port number by entering `-p` through the startup script. @@ -77,7 +77,7 @@ Now we can use it ## Design concept -The operation and maintenance platform has no direct relationship with ElasticJob-Lite. It displays the job status by reading the job registration center data, or updating the registration center data to modify the global configuration. +The operation and maintenance platform has no direct relationship with ElasticJob. It displays the job status by reading the job registration center data, or updating the registration center data to modify the global configuration. The console can only control whether the job itself is running, but it cannot control the start of the job process, because the console and the job server are completely separated, and the console cannot control the job server. @@ -86,5 +86,4 @@ The console can only control whether the job itself is running, but it cannot co * Add assignment The job will be automatically added the first time it runs. -ElasticJob-Lite is started as a jar and has no job distribution function. -To publish jobs entirely through the operation and maintenance platform, please use ElasticJob-Cloud. +ElasticJob is started as a jar and has no job distribution function. diff --git a/docs/content/user-manual/elasticjob-lite/usage/_index.cn.md b/docs/content/user-manual/usage/_index.cn.md similarity index 79% rename from docs/content/user-manual/elasticjob-lite/usage/_index.cn.md rename to docs/content/user-manual/usage/_index.cn.md index 6e2dd56a0c..67ddaad086 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/_index.cn.md +++ b/docs/content/user-manual/usage/_index.cn.md @@ -5,5 +5,5 @@ weight = 1 chapter = true +++ -本章节将介绍 ElasticJob-Lite 相关使用。 +本章节将介绍 ElasticJob 相关使用。 更多使用细节请参见[使用示例](https://github.com/apache/shardingsphere-elasticjob/tree/master/examples)。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/_index.en.md b/docs/content/user-manual/usage/_index.en.md similarity index 77% rename from docs/content/user-manual/elasticjob-lite/usage/_index.en.md rename to docs/content/user-manual/usage/_index.en.md index 0b97789bb6..f760092529 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/_index.en.md +++ b/docs/content/user-manual/usage/_index.en.md @@ -5,5 +5,5 @@ weight = 1 chapter = true +++ -This chapter will introduce the use of ElasticJob-Lite. +This chapter will introduce the use of ElasticJob. Please refer to [Example](https://github.com/apache/shardingsphere-elasticjob/tree/master/examples) for more details. diff --git a/docs/content/user-manual/usage/job-api/_index.cn.md b/docs/content/user-manual/usage/job-api/_index.cn.md new file mode 100644 index 0000000000..3c57f2ad3f --- /dev/null +++ b/docs/content/user-manual/usage/job-api/_index.cn.md @@ -0,0 +1,8 @@ ++++ +title = "作业 API" +weight = 1 +chapter = true ++++ + +ElasticJob 支持原生 Java、Spring Boot Starter 和 Spring 自定义命名空间 3 种使用方式。 +本章节将详细介绍他们的使用方式。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/_index.en.md b/docs/content/user-manual/usage/job-api/_index.en.md similarity index 54% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/_index.en.md rename to docs/content/user-manual/usage/job-api/_index.en.md index 2731af7ba5..21870cfa88 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/_index.en.md +++ b/docs/content/user-manual/usage/job-api/_index.en.md @@ -4,5 +4,5 @@ weight = 1 chapter = true +++ -ElasticJob-Lite can use for native Java, Spring Boot Starter and Spring namespace. +ElasticJob can use for native Java, Spring Boot Starter and Spring namespace. This chapter will introduce how to use them. diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.cn.md b/docs/content/user-manual/usage/job-api/java-api.cn.md similarity index 86% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.cn.md rename to docs/content/user-manual/usage/job-api/java-api.cn.md index 4e6455fbd3..87f6ebd9f2 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.cn.md +++ b/docs/content/user-manual/usage/job-api/java-api.cn.md @@ -6,7 +6,7 @@ chapter = true ## 作业配置 -ElasticJob-Lite 采用构建器模式创建作业配置对象。 +ElasticJob 采用构建器模式创建作业配置对象。 代码示例如下: ```java @@ -15,7 +15,7 @@ ElasticJob-Lite 采用构建器模式创建作业配置对象。 ## 作业启动 -ElasticJob-Lite 调度器分为定时调度和一次性调度两种类型。 +ElasticJob 调度器分为定时调度和一次性调度两种类型。 每种调度器启动时均需要注册中心配置、作业对象(或作业类型)以及作业配置这 3 个参数。 ### 定时调度 @@ -71,11 +71,11 @@ public class JobDemo { ## 配置作业导出端口 -使用 ElasticJob-Lite 过程中可能会碰到一些分布式问题,导致作业运行不稳定。 +使用 ElasticJob 过程中可能会碰到一些分布式问题,导致作业运行不稳定。 由于无法在生产环境调试,通过 dump 命令可以把作业内部相关信息导出,方便开发者调试分析; -导出命令的使用请参见[运维指南](/cn/user-manual/elasticjob-lite/operation/dump)。 +导出命令的使用请参见[运维指南](/cn/user-manual/elasticjob/operation/dump)。 以下示例用于展示如何通过 SnapshotService 开启用于导出命令的监听端口。 @@ -95,16 +95,16 @@ public class JobMain { ## 配置错误处理策略 -使用 ElasticJob-Lite 过程中当作业发生异常后,可采用以下错误处理策略。 +使用 ElasticJob 过程中当作业发生异常后,可采用以下错误处理策略。 -| *错误处理策略名称* | *说明* | *是否内置* | *是否默认*| *是否需要额外配置* | -| ----------------------- | --------------------------------- | ------- | --------| ------------- | -| 记录日志策略 | 记录作业异常日志,但不中断作业执行 | 是 | 是 | | -| 抛出异常策略 | 抛出系统异常并中断作业执行 | 是 | | | -| 忽略异常策略 | 忽略系统异常且不中断作业执行 | 是 | | | -| 邮件通知策略 | 发送邮件消息通知,但不中断作业执行 | | | 是 | -| 企业微信通知策略 | 发送企业微信消息通知,但不中断作业执行 | | | 是 | -| 钉钉通知策略 | 发送钉钉消息通知,但不中断作业执行 | | | 是 | +| *错误处理策略名称* | *说明* | *是否内置* | *是否默认* | *是否需要额外配置* | +|------------|---------------------|--------|--------|------------| +| 记录日志策略 | 记录作业异常日志,但不中断作业执行 | 是 | 是 | | +| 抛出异常策略 | 抛出系统异常并中断作业执行 | 是 | | | +| 忽略异常策略 | 忽略系统异常且不中断作业执行 | 是 | | | +| 邮件通知策略 | 发送邮件消息通知,但不中断作业执行 | | | 是 | +| 企业微信通知策略 | 发送企业微信消息通知,但不中断作业执行 | | | 是 | +| 钉钉通知策略 | 发送钉钉消息通知,但不中断作业执行 | | | 是 | ### 记录日志策略 ```java @@ -193,7 +193,7 @@ public class JobDemo { ### 邮件通知策略 -请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#邮件通知策略) 了解更多。 +请参考 [这里](/cn/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#邮件通知策略) 了解更多。 Maven POM: ```xml @@ -247,7 +247,7 @@ public class JobDemo { ### 企业微信通知策略 -请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#企业微信通知策略) 了解更多。 +请参考 [这里](/cn/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#企业微信通知策略) 了解更多。 Maven POM: ```xml @@ -297,7 +297,7 @@ public class JobDemo { ### 钉钉通知策略 -请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#钉钉通知策略) 了解更多。 +请参考 [这里](/cn/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#钉钉通知策略) 了解更多。 Maven POM: ```xml diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.en.md b/docs/content/user-manual/usage/job-api/java-api.en.md similarity index 93% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.en.md rename to docs/content/user-manual/usage/job-api/java-api.en.md index ef02e097af..416863bb06 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.en.md +++ b/docs/content/user-manual/usage/job-api/java-api.en.md @@ -6,7 +6,7 @@ chapter = true ## Job configuration -ElasticJob-Lite uses the builder mode to create job configuration objects. +ElasticJob uses the builder mode to create job configuration objects. The code example is as follows: ```java @@ -15,7 +15,7 @@ The code example is as follows: ## Job start -ElasticJob-Lite scheduler is divided into two types: timed scheduling and one-time scheduling. +ElasticJob scheduler is divided into two types: timed scheduling and one-time scheduling. Each scheduler needs three parameters: registry configuration, job object (or job type), and job configuration when it starts. ### Timed scheduling @@ -75,7 +75,7 @@ Using ElasticJob may meet some distributed problem which is not easy to observe. Because of developer can not debug in production environment, ElasticJob provide `dump` command to export job runtime information for debugging. -Please refer to [Operation Manual](/en/user-manual/elasticjob-lite/operation/dump) for more details. +Please refer to [Operation Manual](/en/user-manual/elasticjob/operation/dump) for more details. The example below is how to configure spring namespace for open listener port to dump. @@ -94,7 +94,7 @@ public class JobMain { ## Configuration error handler strategy -In the process of using ElasticJob-Lite, when the job is abnormal, the following error handling strategies can be used. +In the process of using ElasticJob, when the job is abnormal, the following error handling strategies can be used. | *Error handler strategy name* | *Description* | *Built-in* | *Default*| *Extra config* | | ---------------------------------------- | ------------------------------------------------------------- | ------- | --------| -------------- | @@ -192,7 +192,7 @@ public class JobDemo { ### Email Notification Strategy -Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#email-notification-strategy) for more details. +Please refer to [here](/en/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#email-notification-strategy) for more details. Maven POM: ```xml @@ -246,7 +246,7 @@ public class JobDemo { ### Wechat Enterprise Notification Strategy -Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#wechat-enterprise-notification-strategy) for more details. +Please refer to [here](/en/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#wechat-enterprise-notification-strategy) for more details. Maven POM: ```xml @@ -295,9 +295,10 @@ public class JobDemo { ### Dingtalk Notification Strategy -Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#dingtalk-notification-strategy) for more details. +Please refer to [here](/en/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#dingtalk-notification-strategy) for more details. Maven POM: + ```xml org.apache.shardingsphere.elasticjob @@ -305,6 +306,7 @@ Maven POM: ${latest.release.version} ``` + ```java public class JobDemo { diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/job-interface.cn.md b/docs/content/user-manual/usage/job-api/job-interface.cn.md similarity index 96% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/job-interface.cn.md rename to docs/content/user-manual/usage/job-api/job-interface.cn.md index 4b94866f8e..b0f6a4c3c7 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/job-interface.cn.md +++ b/docs/content/user-manual/usage/job-api/job-interface.cn.md @@ -4,8 +4,6 @@ weight = 1 chapter = true +++ -ElasticJob-Lite 和 ElasticJob-Cloud 提供统一作业接口,开发者仅需对业务作业进行一次开发,之后可根据不同的配置以及部署至不同环境。 - ElasticJob 的作业分类基于 class 和 type 两种类型。 基于 class 的作业需要开发者自行通过实现接口的方式织入业务逻辑; 基于 type 的作业则无需编码,只需要提供相应配置即可。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/job-interface.en.md b/docs/content/user-manual/usage/job-api/job-interface.en.md similarity index 95% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/job-interface.en.md rename to docs/content/user-manual/usage/job-api/job-interface.en.md index 011eea3ce4..0f68061e96 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/job-interface.en.md +++ b/docs/content/user-manual/usage/job-api/job-interface.en.md @@ -4,8 +4,6 @@ weight = 1 chapter = true +++ -ElasticJob-Lite and ElasticJob-Cloud provide a unified job interface, developers need to develop business jobs only once, and then they can be deployed to different environments according to different configurations and deployments. - ElasticJob has two kinds of job types: Class-based job and Type-based job. Class-based jobs require developers to weave business logic by implementing interfaces; Type-based jobs don't need coding, just need to provide the corresponding configuration. diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md b/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md similarity index 73% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md rename to docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md index fde7352292..1ae7a81ef2 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md +++ b/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md @@ -4,7 +4,7 @@ weight = 3 chapter = true +++ -ElasticJob-Lite 提供自定义的 Spring Boot Starter,可以与 Spring Boot 配合使用。 +ElasticJob 提供自定义的 Spring Boot Starter,可以与 Spring Boot 配合使用。 基于 ElasticJob Spring Boot Starter 使用 ElasticJob ,用户无需手动创建 CoordinatorRegistryCenter、JobBootstrap 等实例, 只需实现核心作业逻辑并辅以少量配置,即可利用轻量、无中心化的 ElasticJob 解决分布式调度问题。 @@ -48,7 +48,7 @@ Starter 会根据该配置自动创建 `OneOffJobBootstrap` 或 `ScheduleJobBoot elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-lite-springboot + namespace: elasticjob-engine-springboot jobs: dataflowJob: elasticJobClass: org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob @@ -75,7 +75,7 @@ elasticjob: 通过 `execute()` 方法执行作业。 `OneOffJobBootstrap` bean 的名称通过属性 jobBootstrapBeanName 配置,注入时需要指定依赖的 bean 名称。 -具体配置请参考[配置文档](/cn/user-manual/elasticjob-lite/configuration/spring-boot-starter)。 +具体配置请参考[配置文档](/cn/user-manual/elasticjob/configuration/spring-boot-starter)。 ```yaml elasticjob: @@ -115,16 +115,16 @@ public class OneOffJobController { ## 配置错误处理策略 -使用 ElasticJob-Lite 过程中当作业发生异常后,可采用以下错误处理策略。 +使用 ElasticJob 过程中当作业发生异常后,可采用以下错误处理策略。 -| *错误处理策略名称* | *说明* | *是否内置* | *是否默认*| *是否需要额外配置* | -| ----------------------- | --------------------------------- | ------- | --------| ------------- | -| 记录日志策略 | 记录作业异常日志,但不中断作业执行 | 是 | 是 | | -| 抛出异常策略 | 抛出系统异常并中断作业执行 | 是 | | | -| 忽略异常策略 | 忽略系统异常且不中断作业执行 | 是 | | | -| 邮件通知策略 | 发送邮件消息通知,但不中断作业执行 | | | 是 | -| 企业微信通知策略 | 发送企业微信消息通知,但不中断作业执行 | | | 是 | -| 钉钉通知策略 | 发送钉钉消息通知,但不中断作业执行 | | | 是 | +| *错误处理策略名称* | *说明* | *是否内置* | *是否默认* | *是否需要额外配置* | +|------------|---------------------|--------|--------|------------| +| 记录日志策略 | 记录作业异常日志,但不中断作业执行 | 是 | 是 | | +| 抛出异常策略 | 抛出系统异常并中断作业执行 | 是 | | | +| 忽略异常策略 | 忽略系统异常且不中断作业执行 | 是 | | | +| 邮件通知策略 | 发送邮件消息通知,但不中断作业执行 | | | 是 | +| 企业微信通知策略 | 发送企业微信消息通知,但不中断作业执行 | | | 是 | +| 钉钉通知策略 | 发送钉钉消息通知,但不中断作业执行 | | | 是 | ### 记录日志策略 ```yaml @@ -159,7 +159,7 @@ elasticjob: ### 邮件通知策略 -请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#邮件通知策略) 了解更多。 +请参考 [这里](/cn/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#邮件通知策略) 了解更多。 Maven POM: ```xml @@ -193,7 +193,7 @@ elasticjob: ### 企业微信通知策略 -请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#企业微信通知策略) 了解更多。 +请参考 [这里](/cn/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#企业微信通知策略) 了解更多。 Maven POM: ```xml @@ -220,7 +220,7 @@ elasticjob: ### 钉钉通知策略 -请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#钉钉通知策略) 了解更多。 +请参考 [这里](/cn/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#钉钉通知策略) 了解更多。 Maven POM: ```xml diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md b/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md similarity index 71% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md rename to docs/content/user-manual/usage/job-api/spring-boot-starter.en.md index f106a1e40d..3a54a8c019 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md +++ b/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md @@ -4,7 +4,7 @@ weight = 3 chapter = true +++ -ElasticJob-Lite provides a customized Spring Boot Starter, which can be used in conjunction with Spring Boot. +ElasticJob provides a customized Spring Boot Starter, which can be used in conjunction with Spring Boot. Developers are free from configuring CoordinatorRegistryCenter, JobBootstrap by using ElasticJob Spring Boot Starter. What developers need to solve distributed scheduling problem are job implementations with a little configuration. @@ -49,7 +49,7 @@ Configuration reference: elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-lite-springboot + namespace: elasticjob-engine-springboot jobs: dataflowJob: elasticJobClass: org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob @@ -77,7 +77,7 @@ Developers can inject the `OneOffJobBootstrap` bean into where they plan to invo Trigger the job by invoking `execute()` method manually. The bean name of `OneOffJobBootstrap` is specified by property "jobBootstrapBeanName", -Please refer to [Spring Boot Starter Configuration](/en/user-manual/elasticjob-lite/configuration/spring-boot-starter). +Please refer to [Spring Boot Starter Configuration](/en/user-manual/elasticjob/configuration/spring-boot-starter). ```yaml elasticjob: @@ -116,16 +116,16 @@ public class OneOffJobController { ## Configuration error handler strategy -In the process of using ElasticJob-Lite, when the job is abnormal, the following error handling strategies can be used. +In the process of using ElasticJob, when the job is abnormal, the following error handling strategies can be used. -| *Error handler strategy name* | *Description* | *Built-in* | *Default*| *Extra config* | -| ---------------------------------------- | ------------------------------------------------------------- | ------- | --------| -------------- | -| Log Strategy | Log error and do not interrupt job | Yes | Yes | | -| Throw Strategy | Throw system exception and interrupt job | Yes | | | -| Ignore Strategy | Ignore exception and do not interrupt job | Yes | | | -| Email Notification Strategy | Send email message notification and do not interrupt job | | | Yes | -| Wechat Enterprise Notification Strategy | Send wechat message notification and do not interrupt job | | | Yes | -| Dingtalk Notification Strategy | Send dingtalk message notification and do not interrupt job | | | Yes | +| *Error handler strategy name* | *Description* | *Built-in* | *Default* | *Extra config* | +|-----------------------------------------|-------------------------------------------------------------|------------|-----------|----------------| +| Log Strategy | Log error and do not interrupt job | Yes | Yes | | +| Throw Strategy | Throw system exception and interrupt job | Yes | | | +| Ignore Strategy | Ignore exception and do not interrupt job | Yes | | | +| Email Notification Strategy | Send email message notification and do not interrupt job | | | Yes | +| Wechat Enterprise Notification Strategy | Send wechat message notification and do not interrupt job | | | Yes | +| Dingtalk Notification Strategy | Send dingtalk message notification and do not interrupt job | | | Yes | ### Log Strategy ```yaml @@ -159,7 +159,7 @@ elasticjob: ### Email Notification Strategy -Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#email-notification-strategy) for more details. +Please refer to [here](/en/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#email-notification-strategy) for more details. Maven POM: ```xml @@ -193,7 +193,7 @@ elasticjob: ### Wechat Enterprise Notification Strategy -Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#wechat-enterprise-notification-strategy) for more details. +Please refer to [here](/en/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#wechat-enterprise-notification-strategy) for more details. Maven POM: ```xml @@ -219,7 +219,7 @@ elasticjob: ### Dingtalk Notification Strategy -Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#dingtalk-notification-strategy) for more details. +Please refer to [here](/en/user-manual/elasticjob/configuration/built-in-strategy/error-handler/#dingtalk-notification-strategy) for more details. Maven POM: ```xml diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-namespace.cn.md b/docs/content/user-manual/usage/job-api/spring-namespace.cn.md similarity index 80% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/spring-namespace.cn.md rename to docs/content/user-manual/usage/job-api/spring-namespace.cn.md index 09c52e71ac..085df87267 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-namespace.cn.md +++ b/docs/content/user-manual/usage/job-api/spring-namespace.cn.md @@ -4,7 +4,7 @@ weight = 4 chapter = true +++ -ElasticJob-Lite 提供自定义的 Spring 命名空间,可以与 Spring 容器配合使用。 +ElasticJob 提供自定义的 Spring 命名空间,可以与 Spring 容器配合使用。 开发者能够便捷的在作业中通过依赖注入使用 Spring 容器管理的数据源等对象,并使用占位符从属性文件中取值。 ## 作业配置 @@ -51,8 +51,9 @@ ElasticJob-Lite 提供自定义的 Spring 命名空间,可以与 Spring 容器 通过 `execute()` 方法执行作业。 ```xml - - + + + ``` ```java public final class SpringMain { @@ -66,11 +67,11 @@ public final class SpringMain { ## 配置作业导出端口 -使用 ElasticJob-Lite 过程中可能会碰到一些分布式问题,导致作业运行不稳定。 +使用 ElasticJob 过程中可能会碰到一些分布式问题,导致作业运行不稳定。 由于无法在生产环境调试,通过 dump 命令可以把作业内部相关信息导出,方便开发者调试分析; -导出命令的使用请参见[运维指南](/cn/user-manual/elasticjob-lite/operation/dump)。 +导出命令的使用请参见[运维指南](/cn/user-manual/elasticjob/operation/dump)。 以下示例用于展示如何通过 Spring 命名空间开启用于导出命令的监听端口。 @@ -95,16 +96,16 @@ public final class SpringMain { ## 配置错误处理策略 -使用 ElasticJob-Lite 过程中当作业发生异常后,可采用以下错误处理策略。 +使用 ElasticJob 过程中当作业发生异常后,可采用以下错误处理策略。 -| *错误处理策略名称* | *说明* | *是否内置* | *是否默认*| *是否需要额外配置* | -| ----------------------- | --------------------------------- | ------- | --------| ------------- | -| 记录日志策略 | 记录作业异常日志,但不中断作业执行 | 是 | 是 | | -| 抛出异常策略 | 抛出系统异常并中断作业执行 | 是 | | | -| 忽略异常策略 | 忽略系统异常且不中断作业执行 | 是 | | | -| 邮件通知策略 | 发送邮件消息通知,但不中断作业执行 | | | 是 | -| 企业微信通知策略 | 发送企业微信消息通知,但不中断作业执行 | | | 是 | -| 钉钉通知策略 | 发送钉钉消息通知,但不中断作业执行 | | | 是 | +| *错误处理策略名称* | *说明* | *是否内置* | *是否默认* | *是否需要额外配置* | +|------------|---------------------|--------|--------|------------| +| 记录日志策略 | 记录作业异常日志,但不中断作业执行 | 是 | 是 | | +| 抛出异常策略 | 抛出系统异常并中断作业执行 | 是 | | | +| 忽略异常策略 | 忽略系统异常且不中断作业执行 | 是 | | | +| 邮件通知策略 | 发送邮件消息通知,但不中断作业执行 | | | 是 | +| 企业微信通知策略 | 发送企业微信消息通知,但不中断作业执行 | | | 是 | +| 钉钉通知策略 | 发送钉钉消息通知,但不中断作业执行 | | | 是 | 以下示例用于展示如何通过 Spring 命名空间配置错误处理策略。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-namespace.en.md b/docs/content/user-manual/usage/job-api/spring-namespace.en.md similarity index 94% rename from docs/content/user-manual/elasticjob-lite/usage/job-api/spring-namespace.en.md rename to docs/content/user-manual/usage/job-api/spring-namespace.en.md index 9b147c3e39..0f4cb7a37e 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-namespace.en.md +++ b/docs/content/user-manual/usage/job-api/spring-namespace.en.md @@ -4,7 +4,7 @@ weight = 4 chapter = true +++ -ElasticJob-Lite provides a custom Spring namespace, which can be used with the Spring. +ElasticJob provides a custom Spring namespace, which can be used with the Spring. Through the way of DI (Dependency Injection), developers can easily use data sources and other objects that managed by the Spring container in their jobs, and use placeholders to get values ​​from property files. ## Job Configuration @@ -52,8 +52,9 @@ Developers can inject the `OneOffJobBootstrap` bean into where they plan to invo Trigger the job by invoking `execute()` method manually. ```xml - - + + + ``` ```java public final class SpringMain { @@ -71,7 +72,7 @@ Using ElasticJob may meet some distributed problem which is not easy to observe. Because of developer can not debug in production environment, ElasticJob provide `dump` command to export job runtime information for debugging. -Please refer to [Operation Manual](/en/user-manual/elasticjob-lite/operation/dump) for more details. +Please refer to [Operation Manual](/en/user-manual/elasticjob/operation/dump) for more details. The example below is how to configure SnapshotService for open listener port to dump. @@ -95,7 +96,7 @@ The example below is how to configure SnapshotService for open listener port to ## Configuration error handler strategy -In the process of using ElasticJob-Lite, when the job is abnormal, the following error handling strategies can be used. +In the process of using ElasticJob, when the job is abnormal, the following error handling strategies can be used. | *Error handler strategy name* | *Description* | *Built-in* | *Default*| *Extra config* | | ---------------------------------------- | ------------------------------------------------------------- | ------- | --------| -------------- | diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/_index.cn.md b/docs/content/user-manual/usage/job-listener/_index.cn.md similarity index 76% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/_index.cn.md rename to docs/content/user-manual/usage/job-listener/_index.cn.md index 3ed22b2cfe..e927be2c37 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-listener/_index.cn.md +++ b/docs/content/user-manual/usage/job-listener/_index.cn.md @@ -4,7 +4,7 @@ weight = 2 chapter = true +++ -ElasticJob-Lite 提供作业监听器,用于在任务执行前和执行后执行监听的方法。 +ElasticJob 提供作业监听器,用于在任务执行前和执行后执行监听的方法。 监听器分为每台作业节点均执行的常规监听器和分布式场景中仅单一节点执行的分布式监听器。 本章节将详细介绍他们的使用方式。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/_index.en.md b/docs/content/user-manual/usage/job-listener/_index.en.md similarity index 76% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/_index.en.md rename to docs/content/user-manual/usage/job-listener/_index.en.md index fa5584caf8..18c13fa4d4 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/job-listener/_index.en.md +++ b/docs/content/user-manual/usage/job-listener/_index.en.md @@ -4,7 +4,7 @@ weight = 2 chapter = true +++ -ElasticJob-Lite provides job listeners, which are used to perform monitoring methods before and after task execution. +ElasticJob provides job listeners, which are used to perform monitoring methods before and after task execution. Listeners are divided into regular listeners executed by each job node and distributed listeners executed by only a single node in a distributed scenario. This chapter will introduce how to use them in detail. diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/java-api.cn.md b/docs/content/user-manual/usage/job-listener/java-api.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/java-api.cn.md rename to docs/content/user-manual/usage/job-listener/java-api.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/java-api.en.md b/docs/content/user-manual/usage/job-listener/java-api.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/java-api.en.md rename to docs/content/user-manual/usage/job-listener/java-api.en.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/listener-interface.cn.md b/docs/content/user-manual/usage/job-listener/listener-interface.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/listener-interface.cn.md rename to docs/content/user-manual/usage/job-listener/listener-interface.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/listener-interface.en.md b/docs/content/user-manual/usage/job-listener/listener-interface.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/listener-interface.en.md rename to docs/content/user-manual/usage/job-listener/listener-interface.en.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/spring-namespace.cn.md b/docs/content/user-manual/usage/job-listener/spring-namespace.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/spring-namespace.cn.md rename to docs/content/user-manual/usage/job-listener/spring-namespace.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-listener/spring-namespace.en.md b/docs/content/user-manual/usage/job-listener/spring-namespace.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/job-listener/spring-namespace.en.md rename to docs/content/user-manual/usage/job-listener/spring-namespace.en.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/operation-api/_index.cn.md b/docs/content/user-manual/usage/operation-api/_index.cn.md similarity index 82% rename from docs/content/user-manual/elasticjob-lite/usage/operation-api/_index.cn.md rename to docs/content/user-manual/usage/operation-api/_index.cn.md index 78d4b44ce4..a3346ae7b9 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/operation-api/_index.cn.md +++ b/docs/content/user-manual/usage/operation-api/_index.cn.md @@ -4,13 +4,13 @@ weight = 4 chapter = true +++ -ElasticJob-Lite 提供了 Java API,可以通过直接对注册中心进行操作的方式控制作业在分布式环境下的生命周期。 +ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的方式控制作业在分布式环境下的生命周期。 该模块目前仍处于孵化状态。 ## 配置类 API -类名称:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI` +类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI` ### 获取作业配置 @@ -37,7 +37,7 @@ ElasticJob-Lite 提供了 Java API,可以通过直接对注册中心进行操 ## 操作类 API -类名称:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobOperateAPI` +类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI` ### 触发作业执行 @@ -85,7 +85,7 @@ ElasticJob-Lite 提供了 Java API,可以通过直接对注册中心进行操 ## 操作分片的 API -类名称:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingOperateAPI` +类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI` ### 禁用作业分片 @@ -105,7 +105,7 @@ ElasticJob-Lite 提供了 Java API,可以通过直接对注册中心进行操 ## 作业统计 API -类名称:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobStatisticsAPI` +类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI` ### 获取作业总数 @@ -139,7 +139,7 @@ ElasticJob-Lite 提供了 Java API,可以通过直接对注册中心进行操 ## 作业服务器状态展示 API -类名称:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ServerStatisticsAPI` +类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI` ### 获取作业服务器总数 @@ -155,7 +155,7 @@ ElasticJob-Lite 提供了 Java API,可以通过直接对注册中心进行操 ## 作业分片状态展示 API -类名称:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingStatisticsAPI` +类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI` ### 获取作业分片信息集合 diff --git a/docs/content/user-manual/elasticjob-lite/usage/operation-api/_index.en.md b/docs/content/user-manual/usage/operation-api/_index.en.md similarity index 83% rename from docs/content/user-manual/elasticjob-lite/usage/operation-api/_index.en.md rename to docs/content/user-manual/usage/operation-api/_index.en.md index e8998464d9..11ade7c643 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/operation-api/_index.en.md +++ b/docs/content/user-manual/usage/operation-api/_index.en.md @@ -4,13 +4,13 @@ weight = 4 chapter = true +++ -ElasticJob-Lite provides a Java API, which can control the life cycle of jobs in a distributed environment by directly operating the registry. +ElasticJob provides a Java API, which can control the life cycle of jobs in a distributed environment by directly operating the registry. The module is still in incubation. ## Configuration API -Class name: `org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI` +Class name: `org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI` ### Get job configuration @@ -37,7 +37,7 @@ Method signature:void removeJobConfiguration(String jobName) ## Operation API -Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobOperateAPI` +Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI` ### Trigger job execution @@ -85,7 +85,7 @@ Method signature:void remove(Optional jobName, Optional server ## Operate sharding API -Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingOperateAPI` +Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI` ### Disable job sharding @@ -105,7 +105,7 @@ Method signature:void enable(String jobName, String item) ## Job statistics API -Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobStatisticsAPI` +Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI` ### Get the total count of jobs @@ -139,7 +139,7 @@ Method signature:Collection getJobsBriefInfo(String ip) ## Job server status display API -Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ServerStatisticsAPI` +Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI` ### Total count of job servers @@ -155,7 +155,7 @@ Method signature:Collection getAllServersBriefInfo() ## Job sharding status display API -Class name:`org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingStatisticsAPI` +Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI` ### Get job sharding information collection diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/_index.cn.md b/docs/content/user-manual/usage/tracing/_index.cn.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/_index.cn.md rename to docs/content/user-manual/usage/tracing/_index.cn.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/_index.en.md b/docs/content/user-manual/usage/tracing/_index.en.md similarity index 100% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/_index.en.md rename to docs/content/user-manual/usage/tracing/_index.en.md diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/java-api.cn.md b/docs/content/user-manual/usage/tracing/java-api.cn.md similarity index 85% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/java-api.cn.md rename to docs/content/user-manual/usage/tracing/java-api.cn.md index ca18a38733..ccbe862c2e 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/java-api.cn.md +++ b/docs/content/user-manual/usage/tracing/java-api.cn.md @@ -4,7 +4,7 @@ weight = 1 chapter = true +++ -ElasticJob-Lite 在配置中提供了 TracingConfiguration,目前支持数据库方式配置。 +ElasticJob 在配置中提供了 TracingConfiguration,目前支持数据库方式配置。 开发者也可以通过 SPI 自行扩展。 ```java diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/java-api.en.md b/docs/content/user-manual/usage/tracing/java-api.en.md similarity index 85% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/java-api.en.md rename to docs/content/user-manual/usage/tracing/java-api.en.md index f46a71df73..c0178b54fe 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/java-api.en.md +++ b/docs/content/user-manual/usage/tracing/java-api.en.md @@ -4,7 +4,7 @@ weight = 1 chapter = true +++ -ElasticJob-Lite currently provides `TracingConfiguration` based on database in the configuration. +ElasticJob currently provides `TracingConfiguration` based on database in the configuration. Developers can also extend it through SPI. ```java diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter.cn.md b/docs/content/user-manual/usage/tracing/spring-boot-starter.cn.md similarity index 84% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter.cn.md rename to docs/content/user-manual/usage/tracing/spring-boot-starter.cn.md index e184fb64d7..4bc5980511 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter.cn.md +++ b/docs/content/user-manual/usage/tracing/spring-boot-starter.cn.md @@ -4,7 +4,7 @@ weight = 2 chapter = true +++ -ElasticJob-Lite 的 Spring Boot Starter 集成了 TracingConfiguration 自动配置, +ElasticJob 的 Spring Boot Starter 集成了 TracingConfiguration 自动配置, 开发者只需注册一个 DataSource 到 Spring 容器中并在配置文件指定事件追踪数据源类型, Starter 就会自动创建一个 TracingConfiguration 实例并注册到 Spring 容器中。 @@ -37,5 +37,5 @@ elasticjob: ## 作业启动 -指定事件追踪数据源类型为 RDB,TracingConfiguration 会自动注册到容器中,如果与 elasticjob-lite-spring-boot-starter 配合使用, +指定事件追踪数据源类型为 RDB,TracingConfiguration 会自动注册到容器中,如果与 elasticjob-engine-spring-boot-starter 配合使用, 开发者无需进行其他额外的操作,作业启动器会自动使用创建的 TracingConfiguration。 diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter.en.md b/docs/content/user-manual/usage/tracing/spring-boot-starter.en.md similarity index 84% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter.en.md rename to docs/content/user-manual/usage/tracing/spring-boot-starter.en.md index 72bc81be20..bb38e471cf 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-boot-starter.en.md +++ b/docs/content/user-manual/usage/tracing/spring-boot-starter.en.md @@ -4,7 +4,7 @@ weight = 2 chapter = true +++ -ElasticJob-Lite Spring Boot Starter has already integrated TracingConfiguration configuration. +ElasticJob Spring Boot Starter has already integrated TracingConfiguration configuration. What developers need to do is register a bean of DataSource into the Spring IoC Container and set the type of data source. Then the Starter will create an instance of TracingConfiguration and register it into the container. @@ -38,5 +38,5 @@ elasticjob: ## Job Start TracingConfiguration will be registered into the IoC container imperceptibly after setting tracing type to RDB. -If elasticjob-lite-spring-boot-starter was imported, developers need to do nothing else. +If elasticjob-engine-spring-boot-starter was imported, developers need to do nothing else. The instances of JobBootstrap will use the TracingConfiguration automatically. diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-namespace.cn.md b/docs/content/user-manual/usage/tracing/spring-namespace.cn.md similarity index 95% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/spring-namespace.cn.md rename to docs/content/user-manual/usage/tracing/spring-namespace.cn.md index e50c07d519..810c05cd57 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-namespace.cn.md +++ b/docs/content/user-manual/usage/tracing/spring-namespace.cn.md @@ -6,12 +6,12 @@ chapter = true ## 引入 Maven 依赖 -引入 elasticjob-lite-spring +引入 elasticjob-engine-spring ```xml org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-namespace + elasticjob-engine-spring-namespace ${elasticjob.latest.version} ``` diff --git a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-namespace.en.md b/docs/content/user-manual/usage/tracing/spring-namespace.en.md similarity index 96% rename from docs/content/user-manual/elasticjob-lite/usage/tracing/spring-namespace.en.md rename to docs/content/user-manual/usage/tracing/spring-namespace.en.md index 7cbb9b496c..e36bd0434c 100644 --- a/docs/content/user-manual/elasticjob-lite/usage/tracing/spring-namespace.en.md +++ b/docs/content/user-manual/usage/tracing/spring-namespace.en.md @@ -9,7 +9,7 @@ chapter = true ```xml org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-namespace + elasticjob-engine-spring-namespace ${elasticjob.latest.version} ``` diff --git a/docs/content/user-manual/usage/tracing/table-structure.cn.md b/docs/content/user-manual/usage/tracing/table-structure.cn.md new file mode 100644 index 0000000000..704df210c6 --- /dev/null +++ b/docs/content/user-manual/usage/tracing/table-structure.cn.md @@ -0,0 +1,47 @@ ++++ +title = "表结构说明" +weight = 4 +chapter = true ++++ + +事件追踪的 event_trace_rdb_url 属性对应库自动创建 JOB_EXECUTION_LOG 和 JOB_STATUS_TRACE_LOG 两张表以及若干索引。 + +## JOB_EXECUTION_LOG 字段含义 + +| 字段名称 | 字段类型 | 是否必填 | 描述 | +|------------------|:--------------|:-----|:---------------------------------------------| +| id | VARCHAR(40) | 是 | 主键 | +| job_name | VARCHAR(100) | 是 | 作业名称 | +| task_id | VARCHAR(1000) | 是 | 任务名称,每次作业运行生成新任务 | +| hostname | VARCHAR(255) | 是 | 主机名称 | +| ip | VARCHAR(50) | 是 | 主机IP | +| sharding_item | INT | 是 | 分片项 | +| execution_source | VARCHAR(20) | 是 | 作业执行来源。可选值为NORMAL_TRIGGER, MISFIRE, FAILOVER | +| failure_cause | VARCHAR(2000) | 否 | 执行失败原因 | +| is_success | BIT | 是 | 是否执行成功 | +| start_time | TIMESTAMP | 是 | 作业开始执行时间 | +| complete_time | TIMESTAMP | 否 | 作业结束执行时间 | + +JOB_EXECUTION_LOG 记录每次作业的执行历史。 +分为两个步骤: + +1. 作业开始执行时向数据库插入数据,除 failure_cause 和 complete_time 外的其他字段均不为空。 +1. 作业完成执行时向数据库更新数据,更新 is_success, complete_time 和 failure_cause(如果作业执行失败)。 + +## JOB_STATUS_TRACE_LOG 字段含义 + +| 字段名称 | 字段类型 | 是否必填 | 描述 | +|------------------|:--------------|:-----|:------------------------------------------------------------------------------------------------------| +| id | VARCHAR(40) | 是 | 主键 | +| job_name | VARCHAR(100) | 是 | 作业名称 | +| original_task_id | VARCHAR(1000) | 是 | 原任务名称 | +| task_id | VARCHAR(1000) | 是 | 任务名称 | +| slave_id | VARCHAR(1000) | 是 | 执行作业服务器的 IP 地址 | +| execution_type | VARCHAR(20) | 是 | 任务执行类型,可选值为NORMAL_TRIGGER, MISFIRE, FAILOVER | +| sharding_item | VARCHAR(255) | 是 | 分片项集合,多个分片项以逗号分隔 | +| state | VARCHAR(20) | 是 | 任务执行状态,可选值为TASK_STAGING, TASK_RUNNING, TASK_FINISHED, TASK_KILLED, TASK_LOST, TASK_FAILED, TASK_ERROR | +| message | VARCHAR(2000) | 是 | 相关信息 | +| creation_time | TIMESTAMP | 是 | 记录创建时间 | + +JOB_STATUS_TRACE_LOG 记录作业状态变更痕迹表。 +可通过每次作业运行的 task_id 查询作业状态变化的生命周期和运行轨迹。 diff --git a/docs/content/user-manual/usage/tracing/table-structure.en.md b/docs/content/user-manual/usage/tracing/table-structure.en.md new file mode 100644 index 0000000000..1da5525279 --- /dev/null +++ b/docs/content/user-manual/usage/tracing/table-structure.en.md @@ -0,0 +1,47 @@ ++++ +title = "Table Structure" +weight = 4 +chapter = true ++++ + +The database which is the value of the event tracing property `event_trace_rdb_url` will automatically create two tables `JOB_EXECUTION_LOG` and `JOB_STATUS_TRACE_LOG` and several indexes. + +## JOB_EXECUTION_LOG Columns + +| Column name | Column type | Required | Describe | +|------------------|:--------------|:---------|:----------------------------------------------------------------------------------------| +| id | VARCHAR(40) | Yes | Primary key | +| job_name | VARCHAR(100) | Yes | Job name | +| task_id | VARCHAR(1000) | Yes | Task name, create new tasks every time the job runs. | +| hostname | VARCHAR(255) | Yes | Hostname | +| ip | VARCHAR(50) | Yes | IP | +| sharding_item | INT | Yes | Sharding item | +| execution_source | VARCHAR(20) | Yes | Source of job execution. The value options are `NORMAL_TRIGGER`, `MISFIRE`, `FAILOVER`. | +| failure_cause | VARCHAR(2000) | No | The reason for execution failure | +| is_success | BIT | Yes | Execute successfully or not | +| start_time | TIMESTAMP | Yes | Job start time | +| complete_time | TIMESTAMP | No | Job end time | + +`JOB_EXECUTION_LOG` records the execution history of each job. +There are two steps: + +1. When the job is executed, program will create one record in the `JOB_EXECUTION_LOG`, and all fields except `failure_cause` and `complete_time` are not empty. +1. When the job completes execution, program will update the record, update the columns of `is_success`, `complete_time` and `failure_cause`(if the job execution fails). + +## JOB_STATUS_TRACE_LOG Columns + +| Column name | Column type | Required | Describe | +|------------------|:--------------|:---------|:--------------------------------------------------------------------------------------------------------------------------------------------------------| +| id | VARCHAR(40) | Yes | Primary key | +| job_name | VARCHAR(100) | Yes | Job name | +| original_task_id | VARCHAR(1000) | Yes | Original task name | +| task_id | VARCHAR(1000) | Yes | Task name | +| slave_id | VARCHAR(1000) | Yes | Server's name of executing the job. The valve is server's IP. | +| execution_type | VARCHAR(20) | Yes | Type of job execution, the value options are `NORMAL_TRIGGER`, `MISFIRE`, `FAILOVER`. | +| sharding_item | VARCHAR(255) | Yes | Collection of sharding item, multiple sharding items are separated by commas. | +| state | VARCHAR(20) | Yes | State of job execution, the value options are `TASK_STAGING`, `TASK_RUNNING`, `TASK_FINISHED`, `TASK_KILLED`, `TASK_LOST`, `TASK_FAILED`, `TASK_ERROR`. | +| message | VARCHAR(2000) | Yes | Message | +| creation_time | TIMESTAMP | Yes | Create time | + +`JOB_STATUS_TRACE_LOG` record the job status changes. +Through the `task_id` of each job, user can query the life cycle and running track of the job status change. diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml deleted file mode 100755 index 37c515c1ca..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-cloud - 3.1.0-SNAPSHOT - - elasticjob-cloud-common - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-api - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-infra-common - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-simple-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-dataflow-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-script-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-http-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-registry-center-zookeeper-curator - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-tracing-rdb - ${project.parent.version} - - - - com.google.code.gson - gson - - - org.quartz-scheduler - quartz - - - org.apache.commons - commons-lang3 - - - org.apache.commons - commons-exec - - - org.slf4j - slf4j-api - - - - org.apache.curator - curator-test - - - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - - - ch.qos.logback - logback-classic - test - - - org.apache.commons - commons-dbcp2 - test - - - com.h2database - h2 - - - diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java deleted file mode 100755 index b61dc99233..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobConfiguration.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.elasticjob.cloud.config; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; - -/** - * Cloud job configuration. - */ -@RequiredArgsConstructor -@Getter -public final class CloudJobConfiguration { - - private final String appName; - - private final double cpuCount; - - private final double memoryMB; - - private final CloudJobExecutionType jobExecutionType; - - private final JobConfiguration jobConfig; -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java deleted file mode 100755 index f7ea0e1f2b..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/CloudJobExecutionType.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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.elasticjob.cloud.config; - -/** - * Cloud job execution type. - */ -public enum CloudJobExecutionType { - - DAEMON, TRANSIENT -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java deleted file mode 100644 index 3465db59c9..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJO.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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.elasticjob.cloud.config.pojo; - -import lombok.Getter; -import lombok.Setter; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; - -import java.util.Properties; - -/** - * Cloud job configuration POJO. - */ -@Getter -@Setter -public final class CloudJobConfigurationPOJO { - - private String appName; - - private double cpuCount; - - private double memoryMB; - - private CloudJobExecutionType jobExecutionType; - - private String jobName; - - private String cron; - - private int shardingTotalCount; - - private String shardingItemParameters; - - private String jobParameter; - - private boolean monitorExecution; - - private boolean failover; - - private boolean misfire; - - private int maxTimeDiffSeconds; - - private int reconcileIntervalMinutes; - - private String jobShardingStrategyType; - - private String jobExecutorServiceHandlerType; - - private String jobErrorHandlerType; - - private String description; - - private Properties props = new Properties(); - - private boolean disabled; - - private boolean overwrite; - - /** - * Convert to cloud job configuration. - * - * @return cloud job configuration - */ - public CloudJobConfiguration toCloudJobConfiguration() { - JobConfiguration jobConfig = JobConfiguration.newBuilder(jobName, shardingTotalCount) - .cron(cron).shardingItemParameters(shardingItemParameters).jobParameter(jobParameter) - .monitorExecution(monitorExecution).failover(failover).misfire(misfire) - .maxTimeDiffSeconds(maxTimeDiffSeconds).reconcileIntervalMinutes(reconcileIntervalMinutes) - .jobShardingStrategyType(jobShardingStrategyType).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType).jobErrorHandlerType(jobErrorHandlerType) - .description(description).disabled(disabled).overwrite(overwrite).build(); - for (Object each : props.keySet()) { - jobConfig.getProps().setProperty(each.toString(), props.get(each.toString()).toString()); - } - return new CloudJobConfiguration(appName, cpuCount, memoryMB, jobExecutionType, jobConfig); - } - - /** - * Convert from cloud job configuration. - * - * @param cloudJobConfig cloud job configuration - * @return cloud job configuration POJO - */ - public static CloudJobConfigurationPOJO fromCloudJobConfiguration(final CloudJobConfiguration cloudJobConfig) { - CloudJobConfigurationPOJO result = new CloudJobConfigurationPOJO(); - result.setAppName(cloudJobConfig.getAppName()); - result.setCpuCount(cloudJobConfig.getCpuCount()); - result.setMemoryMB(cloudJobConfig.getMemoryMB()); - result.setJobExecutionType(cloudJobConfig.getJobExecutionType()); - result.setJobName(cloudJobConfig.getJobConfig().getJobName()); - result.setCron(cloudJobConfig.getJobConfig().getCron()); - result.setShardingTotalCount(cloudJobConfig.getJobConfig().getShardingTotalCount()); - result.setShardingItemParameters(cloudJobConfig.getJobConfig().getShardingItemParameters()); - result.setJobParameter(cloudJobConfig.getJobConfig().getJobParameter()); - result.setMonitorExecution(cloudJobConfig.getJobConfig().isMonitorExecution()); - result.setFailover(cloudJobConfig.getJobConfig().isFailover()); - result.setMisfire(cloudJobConfig.getJobConfig().isMisfire()); - result.setMaxTimeDiffSeconds(cloudJobConfig.getJobConfig().getMaxTimeDiffSeconds()); - result.setReconcileIntervalMinutes(cloudJobConfig.getJobConfig().getReconcileIntervalMinutes()); - result.setJobShardingStrategyType(cloudJobConfig.getJobConfig().getJobShardingStrategyType()); - result.setJobExecutorServiceHandlerType(cloudJobConfig.getJobConfig().getJobExecutorServiceHandlerType()); - result.setJobErrorHandlerType(cloudJobConfig.getJobConfig().getJobErrorHandlerType()); - result.setDescription(cloudJobConfig.getJobConfig().getDescription()); - result.setProps(cloudJobConfig.getJobConfig().getProps()); - result.setDisabled(cloudJobConfig.getJobConfig().isDisabled()); - result.setOverwrite(cloudJobConfig.getJobConfig().isOverwrite()); - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java deleted file mode 100755 index dd285852ca..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/StatisticInterval.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Task running statistics. - */ -@Getter -@RequiredArgsConstructor -public enum StatisticInterval { - - MINUTE("0 * * * * ?"), - - HOUR("0 0 * * * ?"), - - DAY("0 0 0 * * ?"); - - private final String cron; -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java deleted file mode 100755 index 7490279523..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepository.java +++ /dev/null @@ -1,485 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics.rdb; - -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; -import java.util.Optional; - -/** - * Statistic RDB repository. - */ -@Slf4j -public class StatisticRdbRepository { - - private static final String TABLE_TASK_RESULT_STATISTICS = "TASK_RESULT_STATISTICS"; - - private static final String TABLE_TASK_RUNNING_STATISTICS = "TASK_RUNNING_STATISTICS"; - - private static final String TABLE_JOB_RUNNING_STATISTICS = "JOB_RUNNING_STATISTICS"; - - private static final String TABLE_JOB_REGISTER_STATISTICS = "JOB_REGISTER_STATISTICS"; - - private final DataSource dataSource; - - public StatisticRdbRepository(final DataSource dataSource) throws SQLException { - this.dataSource = dataSource; - initTables(); - } - - private void initTables() throws SQLException { - try (Connection conn = dataSource.getConnection()) { - createTaskResultTableIfNeeded(conn); - createTaskRunningTableIfNeeded(conn); - createJobRunningTableIfNeeded(conn); - createJobRegisterTableIfNeeded(conn); - } - } - - private void createTaskResultTableIfNeeded(final Connection conn) throws SQLException { - DatabaseMetaData dbMetaData = conn.getMetaData(); - for (StatisticInterval each : StatisticInterval.values()) { - try (ResultSet resultSet = dbMetaData.getTables(null, null, TABLE_TASK_RESULT_STATISTICS + "_" + each, new String[]{"TABLE"})) { - if (!resultSet.next()) { - createTaskResultTable(conn, each); - } - } - } - } - - private void createTaskResultTable(final Connection conn, final StatisticInterval statisticInterval) throws SQLException { - String dbSchema = "CREATE TABLE `" + TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval + "` (" - + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`success_count` INT," - + "`failed_count` INT," - + "`statistics_time` TIMESTAMP NOT NULL," - + "`creation_time` TIMESTAMP NOT NULL," - + "PRIMARY KEY (`id`));"; - try (PreparedStatement preparedStatement = conn.prepareStatement(dbSchema)) { - preparedStatement.execute(); - } - } - - private void createTaskRunningTableIfNeeded(final Connection conn) throws SQLException { - DatabaseMetaData dbMetaData = conn.getMetaData(); - try (ResultSet resultSet = dbMetaData.getTables(null, null, TABLE_TASK_RUNNING_STATISTICS, new String[]{"TABLE"})) { - if (!resultSet.next()) { - createTaskRunningTable(conn); - } - } - } - - private void createTaskRunningTable(final Connection conn) throws SQLException { - String dbSchema = "CREATE TABLE `" + TABLE_TASK_RUNNING_STATISTICS + "` (" - + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`running_count` INT," - + "`statistics_time` TIMESTAMP NOT NULL," - + "`creation_time` TIMESTAMP NOT NULL," - + "PRIMARY KEY (`id`));"; - try (PreparedStatement preparedStatement = conn.prepareStatement(dbSchema)) { - preparedStatement.execute(); - } - } - - private void createJobRunningTableIfNeeded(final Connection conn) throws SQLException { - DatabaseMetaData dbMetaData = conn.getMetaData(); - try (ResultSet resultSet = dbMetaData.getTables(null, null, TABLE_JOB_RUNNING_STATISTICS, new String[]{"TABLE"})) { - if (!resultSet.next()) { - createJobRunningTable(conn); - } - } - } - - private void createJobRunningTable(final Connection conn) throws SQLException { - String dbSchema = "CREATE TABLE `" + TABLE_JOB_RUNNING_STATISTICS + "` (" - + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`running_count` INT," - + "`statistics_time` TIMESTAMP NOT NULL," - + "`creation_time` TIMESTAMP NOT NULL," - + "PRIMARY KEY (`id`));"; - try (PreparedStatement preparedStatement = conn.prepareStatement(dbSchema)) { - preparedStatement.execute(); - } - } - - private void createJobRegisterTableIfNeeded(final Connection conn) throws SQLException { - DatabaseMetaData dbMetaData = conn.getMetaData(); - try (ResultSet resultSet = dbMetaData.getTables(null, null, TABLE_JOB_REGISTER_STATISTICS, new String[]{"TABLE"})) { - if (!resultSet.next()) { - createJobRegisterTable(conn); - } - } - } - - private void createJobRegisterTable(final Connection conn) throws SQLException { - String dbSchema = "CREATE TABLE `" + TABLE_JOB_REGISTER_STATISTICS + "` (" - + "`id` BIGINT NOT NULL AUTO_INCREMENT, " - + "`registered_count` INT," - + "`statistics_time` TIMESTAMP NOT NULL," - + "`creation_time` TIMESTAMP NOT NULL," - + "PRIMARY KEY (`id`));"; - try (PreparedStatement preparedStatement = conn.prepareStatement(dbSchema)) { - preparedStatement.execute(); - } - } - - /** - * Add task result statistics. - * - * @param taskResultStatistics task result statistics - * @return add success or not - */ - public boolean add(final TaskResultStatistics taskResultStatistics) { - boolean result = false; - String sql = "INSERT INTO `" + TABLE_TASK_RESULT_STATISTICS + "_" + taskResultStatistics.getStatisticInterval() - + "` (`success_count`, `failed_count`, `statistics_time`, `creation_time`) VALUES (?, ?, ?, ?);"; - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql)) { - preparedStatement.setInt(1, taskResultStatistics.getSuccessCount()); - preparedStatement.setInt(2, taskResultStatistics.getFailedCount()); - preparedStatement.setTimestamp(3, new Timestamp(taskResultStatistics.getStatisticsTime().getTime())); - preparedStatement.setTimestamp(4, new Timestamp(taskResultStatistics.getCreationTime().getTime())); - preparedStatement.execute(); - result = true; - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Insert taskResultStatistics to DB error:", ex); - } - return result; - } - - /** - * Add task running statistics. - * - * @param taskRunningStatistics task running statistics - * @return add success or not - */ - public boolean add(final TaskRunningStatistics taskRunningStatistics) { - boolean result = false; - String sql = "INSERT INTO `" + TABLE_TASK_RUNNING_STATISTICS + "` (`running_count`, `statistics_time`, `creation_time`) VALUES (?, ?, ?);"; - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql)) { - preparedStatement.setInt(1, taskRunningStatistics.getRunningCount()); - preparedStatement.setTimestamp(2, new Timestamp(taskRunningStatistics.getStatisticsTime().getTime())); - preparedStatement.setTimestamp(3, new Timestamp(taskRunningStatistics.getCreationTime().getTime())); - preparedStatement.execute(); - result = true; - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Insert taskRunningStatistics to DB error:", ex); - } - return result; - } - - /** - * Add job running statistics. - * - * @param jobRunningStatistics job running statistics - * @return add success or not - */ - public boolean add(final JobRunningStatistics jobRunningStatistics) { - boolean result = false; - String sql = "INSERT INTO `" + TABLE_JOB_RUNNING_STATISTICS + "` (`running_count`, `statistics_time`, `creation_time`) VALUES (?, ?, ?);"; - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql)) { - preparedStatement.setInt(1, jobRunningStatistics.getRunningCount()); - preparedStatement.setTimestamp(2, new Timestamp(jobRunningStatistics.getStatisticsTime().getTime())); - preparedStatement.setTimestamp(3, new Timestamp(jobRunningStatistics.getCreationTime().getTime())); - preparedStatement.execute(); - result = true; - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Insert jobRunningStatistics to DB error:", ex); - } - return result; - } - - /** - * Add job register statistics. - * - * @param jobRegisterStatistics job register statistics - * @return add success or not - */ - public boolean add(final JobRegisterStatistics jobRegisterStatistics) { - boolean result = false; - String sql = "INSERT INTO `" + TABLE_JOB_REGISTER_STATISTICS + "` (`registered_count`, `statistics_time`, `creation_time`) VALUES (?, ?, ?);"; - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql)) { - preparedStatement.setInt(1, jobRegisterStatistics.getRegisteredCount()); - preparedStatement.setTimestamp(2, new Timestamp(jobRegisterStatistics.getStatisticsTime().getTime())); - preparedStatement.setTimestamp(3, new Timestamp(jobRegisterStatistics.getCreationTime().getTime())); - preparedStatement.execute(); - result = true; - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Insert jobRegisterStatistics to DB error:", ex); - } - return result; - } - - /** - * Find task result statistics. - * - * @param from from date to statistics - * @param statisticInterval statistic interval - * @return task result statistics - */ - public List findTaskResultStatistics(final Date from, final StatisticInterval statisticInterval) { - List result = new LinkedList<>(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", - TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval, formatter.format(from)); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - TaskResultStatistics taskResultStatistics = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), - statisticInterval, new Date(resultSet.getTimestamp(4).getTime()), new Date(resultSet.getTimestamp(5).getTime())); - result.add(taskResultStatistics); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch taskResultStatistics from DB error:", ex); - } - return result; - } - - /** - * Get summed task result statistics. - * - * @param from from date to statistics - * @param statisticInterval statistic interval - * @return summed task result statistics - */ - public TaskResultStatistics getSummedTaskResultStatistics(final Date from, final StatisticInterval statisticInterval) { - TaskResultStatistics result = new TaskResultStatistics(0, 0, statisticInterval, new Date()); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT sum(success_count), sum(failed_count) FROM %s WHERE statistics_time >= '%s'", - TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval, formatter.format(from)); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - result = new TaskResultStatistics(resultSet.getInt(1), resultSet.getInt(2), statisticInterval, new Date()); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch summed taskResultStatistics from DB error:", ex); - } - return result; - } - - /** - * Find latest task result statistics. - * - * @param statisticInterval statistic interval - * @return task result statistics - */ - public Optional findLatestTaskResultStatistics(final StatisticInterval statisticInterval) { - TaskResultStatistics result = null; - String sql = String.format("SELECT id, success_count, failed_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", - TABLE_TASK_RESULT_STATISTICS + "_" + statisticInterval); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - result = new TaskResultStatistics(resultSet.getLong(1), resultSet.getInt(2), resultSet.getInt(3), - statisticInterval, new Date(resultSet.getTimestamp(4).getTime()), new Date(resultSet.getTimestamp(5).getTime())); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch latest taskResultStatistics from DB error:", ex); - } - return Optional.ofNullable(result); - } - - /** - * Find task running statistics. - * - * @param from from date to statistics - * @return Task running statistics - */ - public List findTaskRunningStatistics(final Date from) { - List result = new LinkedList<>(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", - TABLE_TASK_RUNNING_STATISTICS, formatter.format(from)); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - TaskRunningStatistics taskRunningStatistics = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), - new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); - result.add(taskRunningStatistics); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch taskRunningStatistics from DB error:", ex); - } - return result; - } - - /** - * Find job running statistics. - * - * @param from from date to statistics - * @return job running statistics - */ - public List findJobRunningStatistics(final Date from) { - List result = new LinkedList<>(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", - TABLE_JOB_RUNNING_STATISTICS, formatter.format(from)); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - JobRunningStatistics jobRunningStatistics = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), - new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); - result.add(jobRunningStatistics); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch jobRunningStatistics from DB error:", ex); - } - return result; - } - - /** - * Find latest task running statistics. - * - * @return latest task running statistics - */ - public Optional findLatestTaskRunningStatistics() { - TaskRunningStatistics result = null; - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", - TABLE_TASK_RUNNING_STATISTICS); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - result = new TaskRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), - new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch latest taskRunningStatistics from DB error:", ex); - } - return Optional.ofNullable(result); - } - - /** - * Find latest job running statistics. - * - * @return job running statistics - */ - public Optional findLatestJobRunningStatistics() { - JobRunningStatistics result = null; - String sql = String.format("SELECT id, running_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", TABLE_JOB_RUNNING_STATISTICS); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - result = new JobRunningStatistics(resultSet.getLong(1), resultSet.getInt(2), - new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch latest jobRunningStatistics from DB error:", ex); - } - return Optional.ofNullable(result); - } - - /** - * Find job register statistics. - * - * @param from from date to statistics - * @return job register statistics - */ - public List findJobRegisterStatistics(final Date from) { - List result = new LinkedList<>(); - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s WHERE statistics_time >= '%s' order by id ASC", - TABLE_JOB_REGISTER_STATISTICS, formatter.format(from)); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - JobRegisterStatistics jobRegisterStatistics = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), - new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); - result.add(jobRegisterStatistics); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch jobRegisterStatistics from DB error:", ex); - } - return result; - } - - /** - * Find latest job register statistics. - * - * @return job register statistics - */ - public Optional findLatestJobRegisterStatistics() { - JobRegisterStatistics result = null; - String sql = String.format("SELECT id, registered_count, statistics_time, creation_time FROM %s order by id DESC LIMIT 1", - TABLE_JOB_REGISTER_STATISTICS); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = conn.prepareStatement(sql); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - result = new JobRegisterStatistics(resultSet.getLong(1), resultSet.getInt(2), - new Date(resultSet.getTimestamp(3).getTime()), new Date(resultSet.getTimestamp(4).getTime())); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch latest jobRegisterStatistics from DB error:", ex); - } - return Optional.ofNullable(result); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobExecutionTypeStatistics.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobExecutionTypeStatistics.java deleted file mode 100755 index fd69ba0771..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobExecutionTypeStatistics.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics.type.job; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Job execution type statistics. - */ -@Getter -@RequiredArgsConstructor -public final class JobExecutionTypeStatistics { - - private final int transientJobCount; - - private final int daemonJobCount; -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRegisterStatistics.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRegisterStatistics.java deleted file mode 100755 index bf62a2ab1a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRegisterStatistics.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics.type.job; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import java.util.Date; - -/** - * Job register statistics. - */ -@Getter -@RequiredArgsConstructor -@AllArgsConstructor -public final class JobRegisterStatistics { - - private long id; - - private final int registeredCount; - - private final Date statisticsTime; - - private Date creationTime = new Date(); -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRunningStatistics.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRunningStatistics.java deleted file mode 100755 index dc74a669e6..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/job/JobRunningStatistics.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics.type.job; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import java.util.Date; - -/** - * Job running statistics. - */ -@Getter -@RequiredArgsConstructor -@AllArgsConstructor -public final class JobRunningStatistics { - - private long id; - - private final int runningCount; - - private final Date statisticsTime; - - private Date creationTime = new Date(); -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskResultStatistics.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskResultStatistics.java deleted file mode 100755 index fb3045eb2f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskResultStatistics.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics.type.task; - -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import java.util.Date; - -/** - * Task result statistics. - */ -@Getter -@AllArgsConstructor -@RequiredArgsConstructor -public final class TaskResultStatistics { - - private long id; - - private final int successCount; - - private final int failedCount; - - private final StatisticInterval statisticInterval; - - private final Date statisticsTime; - - private Date creationTime = new Date(); -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskRunningStatistics.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskRunningStatistics.java deleted file mode 100755 index b90af6cc3f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/statistics/type/task/TaskRunningStatistics.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics.type.task; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import java.util.Date; - -/** - * Task running statistics. - */ -@Getter -@RequiredArgsConstructor -@AllArgsConstructor -public final class TaskRunningStatistics { - - private long id; - - private final int runningCount; - - private final Date statisticsTime; - - private Date creationTime = new Date(); -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java deleted file mode 100644 index 17ace6fca6..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/pojo/CloudJobConfigurationPOJOTest.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * 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.elasticjob.cloud.config.pojo; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class CloudJobConfigurationPOJOTest { - - private static final String YAML = "appName: app\n" - + "cpuCount: 1.0\n" - + "cron: 0/1 * * * * ?\n" - + "description: Job description\n" - + "disabled: false\n" - + "failover: false\n" - + "jobErrorHandlerType: IGNORE\n" - + "jobExecutionType: DAEMON\n" - + "jobExecutorServiceHandlerType: CPU\n" - + "jobName: test_job\n" - + "jobParameter: param\n" - + "jobShardingStrategyType: AVG_ALLOCATION\n" - + "maxTimeDiffSeconds: 0\n" - + "memoryMB: 128.0\n" - + "misfire: false\n" - + "monitorExecution: false\n" - + "overwrite: false\n" - + "props:\n" - + " key: value\n" - + "reconcileIntervalMinutes: 0\n" - + "shardingItemParameters: 0=A,1=B,2=C\n" - + "shardingTotalCount: 3\n"; - - private static final String YAML_WITH_NULL = "appName: app\n" - + "cpuCount: 1.0\n" - + "disabled: false\n" - + "failover: false\n" - + "jobExecutionType: DAEMON\n" - + "jobName: test_job\n" - + "maxTimeDiffSeconds: 0\n" - + "memoryMB: 128.0\n" - + "misfire: false\n" - + "monitorExecution: false\n" - + "overwrite: false\n" - + "reconcileIntervalMinutes: 0\n" - + "shardingTotalCount: 3\n"; - - @Test - void assertToJobConfiguration() { - CloudJobConfigurationPOJO pojo = new CloudJobConfigurationPOJO(); - pojo.setAppName("app"); - pojo.setCpuCount(1d); - pojo.setMemoryMB(128d); - pojo.setJobExecutionType(CloudJobExecutionType.DAEMON); - pojo.setJobName("test_job"); - pojo.setCron("0/1 * * * * ?"); - pojo.setShardingTotalCount(3); - pojo.setShardingItemParameters("0=A,1=B,2=C"); - pojo.setJobParameter("param"); - pojo.setMonitorExecution(true); - pojo.setFailover(true); - pojo.setMisfire(true); - pojo.setJobShardingStrategyType("AVG_ALLOCATION"); - pojo.setJobExecutorServiceHandlerType("CPU"); - pojo.setJobErrorHandlerType("IGNORE"); - pojo.setDescription("Job description"); - pojo.getProps().setProperty("key", "value"); - pojo.setDisabled(true); - pojo.setOverwrite(true); - CloudJobConfiguration actual = pojo.toCloudJobConfiguration(); - assertThat(actual.getAppName(), is("app")); - assertThat(actual.getCpuCount(), is(1d)); - assertThat(actual.getMemoryMB(), is(128d)); - assertThat(actual.getJobExecutionType(), is(CloudJobExecutionType.DAEMON)); - assertThat(actual.getJobConfig().getJobName(), is("test_job")); - assertThat(actual.getJobConfig().getCron(), is("0/1 * * * * ?")); - assertThat(actual.getJobConfig().getShardingTotalCount(), is(3)); - assertThat(actual.getJobConfig().getShardingItemParameters(), is("0=A,1=B,2=C")); - assertThat(actual.getJobConfig().getJobParameter(), is("param")); - assertTrue(actual.getJobConfig().isMonitorExecution()); - assertTrue(actual.getJobConfig().isFailover()); - assertTrue(actual.getJobConfig().isMisfire()); - assertThat(actual.getJobConfig().getJobShardingStrategyType(), is("AVG_ALLOCATION")); - assertThat(actual.getJobConfig().getJobExecutorServiceHandlerType(), is("CPU")); - assertThat(actual.getJobConfig().getJobErrorHandlerType(), is("IGNORE")); - assertThat(actual.getJobConfig().getDescription(), is("Job description")); - assertThat(actual.getJobConfig().getProps().getProperty("key"), is("value")); - assertTrue(actual.getJobConfig().isDisabled()); - assertTrue(actual.getJobConfig().isOverwrite()); - } - - @Test - void assertFromJobConfiguration() { - JobConfiguration jobConfig = JobConfiguration.newBuilder("test_job", 3) - .cron("0/1 * * * * ?") - .shardingItemParameters("0=A,1=B,2=C").jobParameter("param") - .monitorExecution(true).failover(true).misfire(true) - .jobShardingStrategyType("AVG_ALLOCATION").jobExecutorServiceHandlerType("CPU").jobErrorHandlerType("IGNORE") - .description("Job description").setProperty("key", "value") - .disabled(true).overwrite(true).build(); - CloudJobConfiguration cloudJobConfig = new CloudJobConfiguration("app", 1d, 128d, CloudJobExecutionType.DAEMON, jobConfig); - CloudJobConfigurationPOJO actual = CloudJobConfigurationPOJO.fromCloudJobConfiguration(cloudJobConfig); - assertThat(actual.getAppName(), is("app")); - assertThat(actual.getCpuCount(), is(1d)); - assertThat(actual.getMemoryMB(), is(128d)); - assertThat(actual.getJobExecutionType(), is(CloudJobExecutionType.DAEMON)); - assertThat(actual.getJobName(), is("test_job")); - assertThat(actual.getCron(), is("0/1 * * * * ?")); - assertThat(actual.getShardingTotalCount(), is(3)); - assertThat(actual.getShardingItemParameters(), is("0=A,1=B,2=C")); - assertThat(actual.getJobParameter(), is("param")); - assertTrue(actual.isMonitorExecution()); - assertTrue(actual.isFailover()); - assertTrue(actual.isMisfire()); - assertThat(actual.getJobShardingStrategyType(), is("AVG_ALLOCATION")); - assertThat(actual.getJobExecutorServiceHandlerType(), is("CPU")); - assertThat(actual.getJobErrorHandlerType(), is("IGNORE")); - assertThat(actual.getDescription(), is("Job description")); - assertThat(actual.getProps().getProperty("key"), is("value")); - assertTrue(actual.isDisabled()); - assertTrue(actual.isOverwrite()); - } - - @Test - void assertMarshal() { - CloudJobConfigurationPOJO actual = new CloudJobConfigurationPOJO(); - actual.setAppName("app"); - actual.setCpuCount(1d); - actual.setMemoryMB(128d); - actual.setJobExecutionType(CloudJobExecutionType.DAEMON); - actual.setJobName("test_job"); - actual.setCron("0/1 * * * * ?"); - actual.setShardingTotalCount(3); - actual.setShardingItemParameters("0=A,1=B,2=C"); - actual.setJobParameter("param"); - actual.setJobShardingStrategyType("AVG_ALLOCATION"); - actual.setJobExecutorServiceHandlerType("CPU"); - actual.setJobErrorHandlerType("IGNORE"); - actual.setDescription("Job description"); - actual.getProps().setProperty("key", "value"); - assertThat(YamlEngine.marshal(actual), is(YAML)); - } - - @Test - void assertMarshalWithNullValue() { - CloudJobConfigurationPOJO actual = new CloudJobConfigurationPOJO(); - actual.setAppName("app"); - actual.setCpuCount(1d); - actual.setMemoryMB(128d); - actual.setJobExecutionType(CloudJobExecutionType.DAEMON); - actual.setJobName("test_job"); - actual.setShardingTotalCount(3); - assertThat(YamlEngine.marshal(actual), is(YAML_WITH_NULL)); - } - - @Test - void assertUnmarshal() { - CloudJobConfigurationPOJO actual = YamlEngine.unmarshal(YAML, CloudJobConfigurationPOJO.class); - assertThat(actual.getJobName(), is("test_job")); - assertThat(actual.getCron(), is("0/1 * * * * ?")); - assertThat(actual.getShardingTotalCount(), is(3)); - assertThat(actual.getShardingItemParameters(), is("0=A,1=B,2=C")); - assertThat(actual.getJobParameter(), is("param")); - assertFalse(actual.isMonitorExecution()); - assertFalse(actual.isFailover()); - assertFalse(actual.isMisfire()); - assertThat(actual.getJobShardingStrategyType(), is("AVG_ALLOCATION")); - assertThat(actual.getJobExecutorServiceHandlerType(), is("CPU")); - assertThat(actual.getJobErrorHandlerType(), is("IGNORE")); - assertThat(actual.getDescription(), is("Job description")); - assertThat(actual.getProps().getProperty("key"), is("value")); - } - - @Test - void assertUnmarshalWithNullValue() { - CloudJobConfigurationPOJO actual = YamlEngine.unmarshal(YAML_WITH_NULL, CloudJobConfigurationPOJO.class); - assertThat(actual.getAppName(), is("app")); - assertThat(actual.getCpuCount(), is(1d)); - assertThat(actual.getMemoryMB(), is(128d)); - assertThat(actual.getJobExecutionType(), is(CloudJobExecutionType.DAEMON)); - assertThat(actual.getJobName(), is("test_job")); - assertThat(actual.getShardingTotalCount(), is(3)); - assertNull(actual.getShardingItemParameters()); - assertNull(actual.getJobParameter()); - assertFalse(actual.isMonitorExecution()); - assertFalse(actual.isFailover()); - assertFalse(actual.isMisfire()); - assertNull(actual.getJobShardingStrategyType()); - assertNull(actual.getJobExecutorServiceHandlerType()); - assertNull(actual.getJobErrorHandlerType()); - assertNull(actual.getDescription()); - assertTrue(actual.getProps().isEmpty()); - assertFalse(actual.isDisabled()); - assertFalse(actual.isOverwrite()); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java deleted file mode 100755 index 6a03ce09cc..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/rdb/StatisticRdbRepositoryTest.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * 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.elasticjob.cloud.statistics.rdb; - -import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.sql.SQLException; -import java.util.Date; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class StatisticRdbRepositoryTest { - - private StatisticRdbRepository repository; - - @BeforeEach - void setup() throws SQLException { - BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(org.h2.Driver.class.getName()); - dataSource.setUrl("jdbc:h2:mem:"); - dataSource.setUsername("sa"); - dataSource.setPassword(""); - repository = new StatisticRdbRepository(dataSource); - } - - @Test - void assertAddTaskResultStatistics() { - for (StatisticInterval each : StatisticInterval.values()) { - assertTrue(repository.add(new TaskResultStatistics(100, 0, each, new Date()))); - } - } - - @Test - void assertAddTaskRunningStatistics() { - assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); - } - - @Test - void assertAddJobRunningStatistics() { - assertTrue(repository.add(new TaskRunningStatistics(100, new Date()))); - } - - @Test - void assertAddJobRegisterStatistics() { - assertTrue(repository.add(new JobRegisterStatistics(100, new Date()))); - } - - @Test - void assertFindTaskResultStatisticsWhenTableIsEmpty() { - assertThat(repository.findTaskResultStatistics(new Date(), StatisticInterval.MINUTE).size(), is(0)); - assertThat(repository.findTaskResultStatistics(new Date(), StatisticInterval.HOUR).size(), is(0)); - assertThat(repository.findTaskResultStatistics(new Date(), StatisticInterval.DAY).size(), is(0)); - } - - @Test - void assertFindTaskResultStatisticsWithDifferentFromDate() { - Date now = new Date(); - Date yesterday = getYesterday(); - for (StatisticInterval each : StatisticInterval.values()) { - assertTrue(repository.add(new TaskResultStatistics(100, 0, each, yesterday))); - assertTrue(repository.add(new TaskResultStatistics(100, 0, each, now))); - assertThat(repository.findTaskResultStatistics(yesterday, each).size(), is(2)); - assertThat(repository.findTaskResultStatistics(now, each).size(), is(1)); - } - } - - @Test - void assertGetSummedTaskResultStatisticsWhenTableIsEmpty() { - for (StatisticInterval each : StatisticInterval.values()) { - TaskResultStatistics po = repository.getSummedTaskResultStatistics(new Date(), each); - assertThat(po.getSuccessCount(), is(0)); - assertThat(po.getFailedCount(), is(0)); - } - } - - @Test - void assertGetSummedTaskResultStatistics() { - for (StatisticInterval each : StatisticInterval.values()) { - Date date = new Date(); - repository.add(new TaskResultStatistics(100, 2, each, date)); - repository.add(new TaskResultStatistics(200, 5, each, date)); - TaskResultStatistics po = repository.getSummedTaskResultStatistics(date, each); - assertThat(po.getSuccessCount(), is(300)); - assertThat(po.getFailedCount(), is(7)); - } - } - - @Test - void assertFindLatestTaskResultStatisticsWhenTableIsEmpty() { - for (StatisticInterval each : StatisticInterval.values()) { - assertFalse(repository.findLatestTaskResultStatistics(each).isPresent()); - } - } - - @Test - void assertFindLatestTaskResultStatistics() { - for (StatisticInterval each : StatisticInterval.values()) { - repository.add(new TaskResultStatistics(100, 2, each, new Date())); - repository.add(new TaskResultStatistics(200, 5, each, new Date())); - Optional po = repository.findLatestTaskResultStatistics(each); - assertTrue(po.isPresent()); - assertThat(po.get().getSuccessCount(), is(200)); - assertThat(po.get().getFailedCount(), is(5)); - } - } - - @Test - void assertFindTaskRunningStatisticsWhenTableIsEmpty() { - assertThat(repository.findTaskRunningStatistics(new Date()).size(), is(0)); - } - - @Test - void assertFindTaskRunningStatisticsWithDifferentFromDate() { - Date now = new Date(); - Date yesterday = getYesterday(); - assertTrue(repository.add(new TaskRunningStatistics(100, yesterday))); - assertTrue(repository.add(new TaskRunningStatistics(100, now))); - assertThat(repository.findTaskRunningStatistics(yesterday).size(), is(2)); - assertThat(repository.findTaskRunningStatistics(now).size(), is(1)); - } - - @Test - void assertFindLatestTaskRunningStatisticsWhenTableIsEmpty() { - assertFalse(repository.findLatestTaskRunningStatistics().isPresent()); - } - - @Test - void assertFindLatestTaskRunningStatistics() { - repository.add(new TaskRunningStatistics(100, new Date())); - repository.add(new TaskRunningStatistics(200, new Date())); - Optional po = repository.findLatestTaskRunningStatistics(); - assertTrue(po.isPresent()); - assertThat(po.get().getRunningCount(), is(200)); - } - - @Test - void assertFindJobRunningStatisticsWhenTableIsEmpty() { - assertThat(repository.findJobRunningStatistics(new Date()).size(), is(0)); - } - - @Test - void assertFindJobRunningStatisticsWithDifferentFromDate() { - Date now = new Date(); - Date yesterday = getYesterday(); - assertTrue(repository.add(new JobRunningStatistics(100, yesterday))); - assertTrue(repository.add(new JobRunningStatistics(100, now))); - assertThat(repository.findJobRunningStatistics(yesterday).size(), is(2)); - assertThat(repository.findJobRunningStatistics(now).size(), is(1)); - } - - @Test - void assertFindLatestJobRunningStatisticsWhenTableIsEmpty() { - assertFalse(repository.findLatestJobRunningStatistics().isPresent()); - } - - @Test - void assertFindLatestJobRunningStatistics() { - repository.add(new JobRunningStatistics(100, new Date())); - repository.add(new JobRunningStatistics(200, new Date())); - Optional po = repository.findLatestJobRunningStatistics(); - assertTrue(po.isPresent()); - assertThat(po.get().getRunningCount(), is(200)); - } - - @Test - void assertFindJobRegisterStatisticsWhenTableIsEmpty() { - assertThat(repository.findJobRegisterStatistics(new Date()).size(), is(0)); - } - - @Test - void assertFindJobRegisterStatisticsWithDifferentFromDate() { - Date now = new Date(); - Date yesterday = getYesterday(); - assertTrue(repository.add(new JobRegisterStatistics(100, yesterday))); - assertTrue(repository.add(new JobRegisterStatistics(100, now))); - assertThat(repository.findJobRegisterStatistics(yesterday).size(), is(2)); - assertThat(repository.findJobRegisterStatistics(now).size(), is(1)); - } - - @Test - void assertFindLatestJobRegisterStatisticsWhenTableIsEmpty() { - assertFalse(repository.findLatestJobRegisterStatistics().isPresent()); - } - - @Test - void assertFindLatestJobRegisterStatistics() { - repository.add(new JobRegisterStatistics(100, new Date())); - repository.add(new JobRegisterStatistics(200, new Date())); - Optional po = repository.findLatestJobRegisterStatistics(); - assertTrue(po.isPresent()); - assertThat(po.get().getRegisteredCount(), is(200)); - } - - private Date getYesterday() { - return new Date(new Date().getTime() - 24 * 60 * 60 * 1000); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml b/elasticjob-cloud/elasticjob-cloud-executor/pom.xml deleted file mode 100755 index 7111432cd7..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-cloud - 3.1.0-SNAPSHOT - - elasticjob-cloud-executor - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-common - ${project.parent.version} - - - - org.apache.commons - commons-lang3 - - - org.apache.mesos - mesos - - - org.apache.commons - commons-dbcp2 - - - - com.h2database - h2 - - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - - - ch.qos.logback - logback-classic - test - - - diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java deleted file mode 100755 index 824fe2adfa..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/api/JobBootstrap.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.elasticjob.cloud.api; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.mesos.MesosExecutorDriver; -import org.apache.mesos.Protos; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.cloud.executor.prod.TaskExecutor; - -/** - * Job bootstrap. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class JobBootstrap { - - /** - * Execute. - * - * @param elasticJob elastic job - */ - public static void execute(final ElasticJob elasticJob) { - execute(new TaskExecutor(elasticJob)); - } - - /** - * Execute. - * - * @param elasticJobType elastic job type - */ - public static void execute(final String elasticJobType) { - execute(new TaskExecutor(elasticJobType)); - } - - private static void execute(final TaskExecutor taskExecutor) { - MesosExecutorDriver driver = new MesosExecutorDriver(taskExecutor); - System.exit(Protos.Status.DRIVER_STOPPED == driver.run() ? 0 : -1); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutor.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutor.java deleted file mode 100755 index fee6878ce5..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutor.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.local; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.facade.CloudJobFacade; -import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.infra.context.ShardingItemParameters; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; - -import java.util.HashMap; -import java.util.Map; - -/** - * Local task executor. - */ -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public final class LocalTaskExecutor { - - private final ElasticJob elasticJob; - - private final String elasticJobType; - - private final JobConfiguration jobConfiguration; - - private final int shardingItem; - - public LocalTaskExecutor(final ElasticJob elasticJob, final JobConfiguration jobConfiguration, final int shardingItem) { - this(elasticJob, null, jobConfiguration, shardingItem); - } - - public LocalTaskExecutor(final String elasticJobType, final JobConfiguration jobConfiguration, final int shardingItem) { - this(null, elasticJobType, jobConfiguration, shardingItem); - } - - /** - * Execute job. - */ - public void execute() { - createElasticJobExecutor(new CloudJobFacade(getShardingContexts(), jobConfiguration, new JobTracingEventBus())).execute(); - } - - private ElasticJobExecutor createElasticJobExecutor(final JobFacade jobFacade) { - return null == elasticJob ? new ElasticJobExecutor(elasticJobType, jobConfiguration, jobFacade) : new ElasticJobExecutor(elasticJob, jobConfiguration, jobFacade); - } - - private ShardingContexts getShardingContexts() { - Map shardingItemMap = new HashMap<>(1, 1); - shardingItemMap.put(shardingItem, new ShardingItemParameters(jobConfiguration.getShardingItemParameters()).getMap().get(shardingItem)); - String taskId = String.join("@-@", jobConfiguration.getJobName(), shardingItem + "", "READY", "foo_slave_id", "foo_uuid"); - return new ShardingContexts(taskId, jobConfiguration.getJobName(), jobConfiguration.getShardingTotalCount(), jobConfiguration.getJobParameter(), shardingItemMap); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java deleted file mode 100755 index 12d44a2cc5..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskScheduler.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.prod; - -import lombok.RequiredArgsConstructor; -import lombok.Setter; -import org.apache.mesos.ExecutorDriver; -import org.apache.mesos.Protos; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.facade.CloudJobFacade; -import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.quartz.CronScheduleBuilder; -import org.quartz.CronTrigger; -import org.quartz.Job; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobExecutionContext; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.TriggerBuilder; -import org.quartz.impl.StdSchedulerFactory; -import org.quartz.plugins.management.ShutdownHookPlugin; - -import java.util.Properties; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Daemon task scheduler. - */ -@RequiredArgsConstructor -public final class DaemonTaskScheduler { - - private static final String ELASTIC_JOB_DATA_MAP_KEY = "elasticJob"; - - private static final String ELASTIC_JOB_TYPE_DATA_MAP_KEY = "elasticJobType"; - - private static final String JOB_FACADE_DATA_MAP_KEY = "jobFacade"; - - private static final String EXECUTOR_DRIVER_DATA_MAP_KEY = "executorDriver"; - - private static final String TASK_ID_DATA_MAP_KEY = "taskId"; - - private static final ConcurrentHashMap RUNNING_SCHEDULERS = new ConcurrentHashMap<>(1024, 1); - - private final ElasticJob elasticJob; - - private final String elasticJobType; - - private final JobConfiguration jobConfig; - - private final JobFacade jobFacade; - - private final ExecutorDriver executorDriver; - - private final Protos.TaskID taskId; - - /** - * Init the job. - */ - public void init() { - JobDetail jobDetail = JobBuilder.newJob(DaemonJob.class).withIdentity(jobConfig.getJobName()).build(); - jobDetail.getJobDataMap().put(ELASTIC_JOB_DATA_MAP_KEY, elasticJob); - jobDetail.getJobDataMap().put(ELASTIC_JOB_TYPE_DATA_MAP_KEY, elasticJobType); - jobDetail.getJobDataMap().put(JOB_FACADE_DATA_MAP_KEY, jobFacade); - jobDetail.getJobDataMap().put(EXECUTOR_DRIVER_DATA_MAP_KEY, executorDriver); - jobDetail.getJobDataMap().put(TASK_ID_DATA_MAP_KEY, taskId); - try { - scheduleJob(initializeScheduler(), jobDetail, taskId.getValue(), jobConfig.getCron()); - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - } - - private Scheduler initializeScheduler() throws SchedulerException { - StdSchedulerFactory factory = new StdSchedulerFactory(); - factory.initialize(getBaseQuartzProperties()); - return factory.getScheduler(); - } - - private Properties getBaseQuartzProperties() { - Properties result = new Properties(); - result.put("org.quartz.threadPool.class", org.quartz.simpl.SimpleThreadPool.class.getName()); - result.put("org.quartz.threadPool.threadCount", "1"); - result.put("org.quartz.scheduler.instanceName", taskId.getValue()); - if (!jobConfig.isMisfire()) { - result.put("org.quartz.jobStore.misfireThreshold", "1"); - } - result.put("org.quartz.plugin.shutdownhook.class", ShutdownHookPlugin.class.getName()); - result.put("org.quartz.plugin.shutdownhook.cleanShutdown", Boolean.TRUE.toString()); - return result; - } - - private void scheduleJob(final Scheduler scheduler, final JobDetail jobDetail, final String triggerIdentity, final String cron) { - try { - if (!scheduler.checkExists(jobDetail.getKey())) { - scheduler.scheduleJob(jobDetail, createTrigger(triggerIdentity, cron)); - } - scheduler.start(); - RUNNING_SCHEDULERS.putIfAbsent(scheduler.getSchedulerName(), scheduler); - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - } - - private CronTrigger createTrigger(final String triggerIdentity, final String cron) { - return TriggerBuilder.newTrigger().withIdentity(triggerIdentity).withSchedule(CronScheduleBuilder.cronSchedule(cron).withMisfireHandlingInstructionDoNothing()).build(); - } - - /** - * Shutdown scheduling the task. - * - * @param taskID task id - */ - public static void shutdown(final Protos.TaskID taskID) { - Scheduler scheduler = RUNNING_SCHEDULERS.remove(taskID.getValue()); - if (null != scheduler) { - try { - scheduler.shutdown(); - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - } - } - - /** - * Daemon job. - */ - public static final class DaemonJob implements Job { - - @Setter - private ElasticJob elasticJob; - - @Setter - private String elasticJobType; - - @Setter - private CloudJobFacade jobFacade; - - @Setter - private ExecutorDriver executorDriver; - - @Setter - private Protos.TaskID taskId; - - private volatile ElasticJobExecutor jobExecutor; - - @Override - public void execute(final JobExecutionContext context) { - ShardingContexts shardingContexts = jobFacade.getShardingContexts(); - int jobEventSamplingCount = shardingContexts.getJobEventSamplingCount(); - int currentJobEventSamplingCount = shardingContexts.getCurrentJobEventSamplingCount(); - if (jobEventSamplingCount > 0 && ++currentJobEventSamplingCount < jobEventSamplingCount) { - shardingContexts.setCurrentJobEventSamplingCount(currentJobEventSamplingCount); - jobFacade.getShardingContexts().setAllowSendJobEvent(false); - getJobExecutor().execute(); - } else { - jobFacade.getShardingContexts().setAllowSendJobEvent(true); - executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskId).setState(Protos.TaskState.TASK_RUNNING).setMessage("BEGIN").build()); - getJobExecutor().execute(); - executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskId).setState(Protos.TaskState.TASK_RUNNING).setMessage("COMPLETE").build()); - 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-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java deleted file mode 100755 index 7ece00d1e7..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutor.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.prod; - -import com.google.common.base.Strings; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.mesos.Executor; -import org.apache.mesos.ExecutorDriver; -import org.apache.mesos.Protos; -import org.apache.mesos.Protos.TaskInfo; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.facade.CloudJobFacade; -import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.infra.concurrent.ElasticJobExecutorService; -import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; - -import javax.sql.DataSource; -import java.util.Map; -import java.util.concurrent.ExecutorService; - -/** - * Task executor. - */ -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -@Slf4j -public final class TaskExecutor implements Executor { - - private final ElasticJob elasticJob; - - private final String elasticJobType; - - private final ExecutorService executorService = new ElasticJobExecutorService("cloud-task-executor", Runtime.getRuntime().availableProcessors() * 100).createExecutorService(); - - private volatile ElasticJobExecutor jobExecutor; - - private volatile JobTracingEventBus jobTracingEventBus = new JobTracingEventBus(); - - public TaskExecutor(final ElasticJob elasticJob) { - this(elasticJob, null); - } - - public TaskExecutor(final String elasticJobType) { - this(null, elasticJobType); - } - - @Override - public void registered(final ExecutorDriver executorDriver, final Protos.ExecutorInfo executorInfo, final Protos.FrameworkInfo frameworkInfo, final Protos.SlaveInfo slaveInfo) { - if (!executorInfo.getData().isEmpty()) { - Map data = SerializationUtils.deserialize(executorInfo.getData().toByteArray()); - BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(data.get("event_trace_rdb_driver")); - dataSource.setUrl(data.get("event_trace_rdb_url")); - dataSource.setPassword(data.get("event_trace_rdb_password")); - dataSource.setUsername(data.get("event_trace_rdb_username")); - jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration("RDB", dataSource)); - } - } - - @Override - public void reregistered(final ExecutorDriver executorDriver, final Protos.SlaveInfo slaveInfo) { - } - - @Override - public void disconnected(final ExecutorDriver executorDriver) { - } - - @Override - public void launchTask(final ExecutorDriver executorDriver, final Protos.TaskInfo taskInfo) { - executorService.submit(new TaskThread(executorDriver, taskInfo)); - } - - @Override - public void killTask(final ExecutorDriver executorDriver, final Protos.TaskID taskID) { - executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskID).setState(Protos.TaskState.TASK_KILLED).build()); - DaemonTaskScheduler.shutdown(taskID); - } - - @Override - public void frameworkMessage(final ExecutorDriver executorDriver, final byte[] bytes) { - if (null != bytes && "STOP".equals(new String(bytes))) { - log.error("call frameworkMessage executor stopped."); - executorDriver.stop(); - } - } - - @Override - public void shutdown(final ExecutorDriver executorDriver) { - } - - @Override - public void error(final ExecutorDriver executorDriver, final String message) { - log.error("call executor error, message is: {}", message); - } - - @RequiredArgsConstructor - class TaskThread implements Runnable { - - private final ExecutorDriver executorDriver; - - private final TaskInfo taskInfo; - - @Override - public void run() { - Thread.currentThread().setContextClassLoader(TaskThread.class.getClassLoader()); - executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_RUNNING).build()); - Map data = SerializationUtils.deserialize(taskInfo.getData().toByteArray()); - ShardingContexts shardingContexts = (ShardingContexts) data.get("shardingContext"); - JobConfiguration jobConfig = YamlEngine.unmarshal(data.get("jobConfigContext").toString(), JobConfigurationPOJO.class).toJobConfiguration(); - try { - JobFacade jobFacade = new CloudJobFacade(shardingContexts, jobConfig, jobTracingEventBus); - if (isTransient(jobConfig)) { - getJobExecutor(jobFacade).execute(); - executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_FINISHED).build()); - } else { - new DaemonTaskScheduler(elasticJob, elasticJobType, jobConfig, jobFacade, executorDriver, taskInfo.getTaskId()).init(); - } - // CHECKSTYLE:OFF - } catch (final Throwable ex) { - // CHECKSTYLE:ON - log.error("ElasticJob-Cloud Executor error:", ex); - executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_ERROR).setMessage(ExceptionUtils.transform(ex)).build()); - executorDriver.stop(); - throw ex; - } - } - - private boolean isTransient(final JobConfiguration jobConfig) { - return Strings.isNullOrEmpty(jobConfig.getCron()); - } - - private ElasticJobExecutor getJobExecutor(final JobFacade jobFacade) { - if (null == jobExecutor) { - createJobExecutor(jobFacade); - } - return jobExecutor; - } - - private synchronized void createJobExecutor(final JobFacade jobFacade) { - 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-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java deleted file mode 100755 index 022c2518b7..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/facade/CloudJobFacade.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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.elasticjob.cloud.facade; - -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; - -import java.util.Collection; - -/** - * Cloud job facade. - */ -@RequiredArgsConstructor -public final class CloudJobFacade implements JobFacade { - - private final ShardingContexts shardingContexts; - - private final JobConfiguration jobConfig; - - private final JobTracingEventBus jobTracingEventBus; - - @Override - public JobConfiguration loadJobConfiguration(final boolean fromCache) { - JobConfiguration result = JobConfiguration.newBuilder(jobConfig.getJobName(), jobConfig.getShardingTotalCount()) - .cron(jobConfig.getCron()).shardingItemParameters(jobConfig.getShardingItemParameters()).jobParameter(jobConfig.getJobParameter()) - .failover(jobConfig.isFailover()).misfire(jobConfig.isMisfire()).description(jobConfig.getDescription()) - .jobExecutorServiceHandlerType(jobConfig.getJobExecutorServiceHandlerType()) - .jobErrorHandlerType(jobConfig.getJobErrorHandlerType()).build(); - result.getProps().putAll(jobConfig.getProps()); - return result; - } - - @Override - public void checkJobExecutionEnvironment() { - } - - @Override - public void failoverIfNecessary() { - } - - @Override - public void registerJobBegin(final ShardingContexts shardingContexts) { - } - - @Override - public void registerJobCompleted(final ShardingContexts shardingContexts) { - } - - @Override - public ShardingContexts getShardingContexts() { - return shardingContexts; - } - - @Override - public boolean misfireIfRunning(final Collection shardingItems) { - return false; - } - - @Override - public void clearMisfire(final Collection shardingItems) { - } - - @Override - public boolean isExecuteMisfired(final Collection shardingItems) { - return false; - } - - @Override - public boolean isNeedSharding() { - return false; - } - - @Override - public void beforeJobExecuted(final ShardingContexts shardingContexts) { - } - - @Override - public void afterJobExecuted(final ShardingContexts shardingContexts) { - } - - @Override - public void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { - jobTracingEventBus.post(jobExecutionEvent); - } - - @Override - public void postJobStatusTraceEvent(final String taskId, final State state, final String message) { - TaskContext taskContext = TaskContext.from(taskId); - jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), taskContext.getSlaveId(), - Source.CLOUD_EXECUTOR, taskContext.getType().toString(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), state, message)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java deleted file mode 100755 index 6a7a3c1a0e..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/facade/CloudJobFacadeTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.facade; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.facade.CloudJobFacade; -import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -class CloudJobFacadeTest { - - private ShardingContexts shardingContexts; - - @Mock - private JobTracingEventBus jobTracingEventBus; - - private JobFacade jobFacade; - - @BeforeEach - void setUp() { - shardingContexts = getShardingContexts(); - jobFacade = new CloudJobFacade(shardingContexts, getJobConfiguration(), jobTracingEventBus); - } - - private ShardingContexts getShardingContexts() { - Map shardingItemParameters = new HashMap<>(1, 1); - shardingItemParameters.put(0, "A"); - return new ShardingContexts("fake_task_id", "test_job", 3, "", shardingItemParameters); - } - - private JobConfiguration getJobConfiguration() { - return JobConfiguration.newBuilder("test_job", 1).setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, Boolean.FALSE.toString()).build(); - } - - @Test - void assertCheckJobExecutionEnvironment() throws JobExecutionEnvironmentException { - jobFacade.checkJobExecutionEnvironment(); - } - - @Test - void assertFailoverIfNecessary() { - jobFacade.failoverIfNecessary(); - } - - @Test - void assertRegisterJobBegin() { - jobFacade.registerJobBegin(null); - } - - @Test - void assertRegisterJobCompleted() { - jobFacade.registerJobCompleted(null); - } - - @Test - void assertGetShardingContext() { - assertThat(jobFacade.getShardingContexts(), is(shardingContexts)); - } - - @Test - void assertMisfireIfNecessary() { - jobFacade.misfireIfRunning(null); - } - - @Test - void assertClearMisfire() { - jobFacade.clearMisfire(null); - } - - @Test - void assertIsExecuteMisfired() { - assertFalse(jobFacade.isExecuteMisfired(null)); - } - - @Test - void assertIsNeedSharding() { - assertFalse(jobFacade.isNeedSharding()); - } - - @Test - void assertBeforeJobExecuted() { - jobFacade.beforeJobExecuted(null); - } - - @Test - void assertAfterJobExecuted() { - jobFacade.afterJobExecuted(null); - } - - @Test - void assertPostJobExecutionEvent() { - JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); - jobFacade.postJobExecutionEvent(jobExecutionEvent); - verify(jobTracingEventBus).post(jobExecutionEvent); - } - - @Test - void assertPostJobStatusTraceEvent() { - jobFacade.postJobStatusTraceEvent(String.format("%s@-@0@-@%s@-@fake_slave_id@-@0", "test_job", ExecutionType.READY), State.TASK_RUNNING, "message is empty."); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java deleted file mode 100755 index fe352f0c2d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestDataflowJob.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.fixture; - -import lombok.Getter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; - -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; - -@Getter -public final class TestDataflowJob implements DataflowJob { - - private final List output = new LinkedList<>(); - - @Override - public List fetchData(final ShardingContext shardingContext) { - return Arrays.asList("0", "1", "2"); - } - - @Override - public void processData(final ShardingContext shardingContext, final List data) { - output.add(data.get(shardingContext.getShardingItem()) + "-d"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java deleted file mode 100755 index 3ba79a9b83..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/fixture/TestSimpleJob.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.fixture; - -import com.google.common.base.Strings; -import lombok.Getter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; - -import java.util.Collection; -import java.util.LinkedList; - -@Getter -public final class TestSimpleJob implements SimpleJob { - - private final Collection shardingParameters = new LinkedList<>(); - - @Override - public void execute(final ShardingContext shardingContext) { - if (!Strings.isNullOrEmpty(shardingContext.getShardingParameter())) { - shardingParameters.add(shardingContext.getShardingParameter()); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java deleted file mode 100755 index 48df5fbeb9..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.local; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.executor.fixture.TestDataflowJob; -import org.apache.shardingsphere.elasticjob.cloud.executor.fixture.TestSimpleJob; -import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertThrows; - -class LocalTaskExecutorTest { - - @Test - void assertSimpleJob() { - TestSimpleJob simpleJob = new TestSimpleJob(); - new LocalTaskExecutor(simpleJob, JobConfiguration.newBuilder(TestSimpleJob.class.getSimpleName(), 3) - .cron("*/2 * * * * ?").shardingItemParameters("0=A,1=B").build(), 1).execute(); - assertThat(simpleJob.getShardingParameters(), is(Collections.singletonList("B"))); - } - - @Test - void assertDataflowJob() { - TestDataflowJob dataflowJob = new TestDataflowJob(); - new LocalTaskExecutor(dataflowJob, JobConfiguration.newBuilder(TestDataflowJob.class.getSimpleName(), 3) - .cron("*/2 * * * * ?").setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, Boolean.FALSE.toString()).build(), 1).execute(); - assertFalse(dataflowJob.getOutput().isEmpty()); - assertThat(dataflowJob.getOutput(), is(Collections.singletonList("1-d"))); - } - - @Test - void assertScriptJob() { - new LocalTaskExecutor(new TestDataflowJob(), JobConfiguration.newBuilder("TestScriptJob", 3) - .cron("*/2 * * * * ?").setProperty(ScriptJobProperties.SCRIPT_KEY, "echo test").build(), 1).execute(); - } - - @Test - void assertNotExistsJobType() { - assertThrows(JobConfigurationException.class, () -> new LocalTaskExecutor("not exist", JobConfiguration.newBuilder("not exist", 3).cron("*/2 * * * * ?").build(), 1).execute()); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java deleted file mode 100755 index 1aa0258afa..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/DaemonTaskSchedulerTest.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.prod; - -import lombok.SneakyThrows; -import org.apache.mesos.ExecutorDriver; -import org.apache.mesos.Protos.TaskID; -import org.apache.mesos.Protos.TaskState; -import org.apache.mesos.Protos.TaskStatus; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.executor.prod.DaemonTaskScheduler.DaemonJob; -import org.apache.shardingsphere.elasticjob.cloud.facade.CloudJobFacade; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.JobExecutionContext; - -import java.lang.reflect.Field; -import java.util.concurrent.ConcurrentHashMap; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class DaemonTaskSchedulerTest { - - @Mock - private CloudJobFacade jobFacade; - - @Mock - private ExecutorDriver executorDriver; - - @Mock - private JobExecutionContext jobExecutionContext; - - @Mock - private ShardingContexts shardingContexts; - - @Mock - private JobConfiguration jobConfig; - - @Mock - private ElasticJob elasticJob; - - private final TaskID taskId = TaskID.newBuilder().setValue(String.format("%s@-@0@-@%s@-@fake_slave_id@-@0", "test_job", ExecutionType.READY)).build(); - - private DaemonJob daemonJob; - - @BeforeEach - void setUp() { - daemonJob = new DaemonJob(); - daemonJob.setJobFacade(jobFacade); - daemonJob.setElasticJobType("SCRIPT"); - daemonJob.setExecutorDriver(executorDriver); - daemonJob.setTaskId(taskId); - } - - @Test - void assertJobRun() { - when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); - when(jobFacade.loadJobConfiguration(true)).thenReturn(createJobConfiguration()); - daemonJob.execute(jobExecutionContext); - verify(shardingContexts).setAllowSendJobEvent(true); - verify(executorDriver).sendStatusUpdate(TaskStatus.newBuilder().setTaskId(taskId).setState(TaskState.TASK_RUNNING).setMessage("BEGIN").build()); - verify(executorDriver).sendStatusUpdate(TaskStatus.newBuilder().setTaskId(taskId).setState(TaskState.TASK_RUNNING).setMessage("COMPLETE").build()); - verify(shardingContexts).setCurrentJobEventSamplingCount(0); - } - - @Test - void assertJobRunWithEventSampling() { - when(shardingContexts.getJobEventSamplingCount()).thenReturn(2); - when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); - when(jobFacade.loadJobConfiguration(true)).thenReturn(createJobConfiguration()); - daemonJob.execute(jobExecutionContext); - verify(shardingContexts).setCurrentJobEventSamplingCount(1); - verify(shardingContexts).setAllowSendJobEvent(false); - when(shardingContexts.getCurrentJobEventSamplingCount()).thenReturn(1); - daemonJob.execute(jobExecutionContext); - verify(shardingContexts).setAllowSendJobEvent(true); - verify(executorDriver).sendStatusUpdate(TaskStatus.newBuilder().setTaskId(taskId).setState(TaskState.TASK_RUNNING).setMessage("BEGIN").build()); - verify(executorDriver).sendStatusUpdate(TaskStatus.newBuilder().setTaskId(taskId).setState(TaskState.TASK_RUNNING).setMessage("COMPLETE").build()); - verify(shardingContexts).setCurrentJobEventSamplingCount(0); - } - - private JobConfiguration createJobConfiguration() { - return JobConfiguration.newBuilder("test_script_job", 3).cron("0/1 * * * * ?").jobErrorHandlerType("IGNORE").setProperty(ScriptJobProperties.SCRIPT_KEY, "echo test").build(); - } - - @Test - @SneakyThrows - void assertInit() { - DaemonTaskScheduler scheduler = createScheduler(); - scheduler.init(); - Field field = DaemonTaskScheduler.class.getDeclaredField("RUNNING_SCHEDULERS"); - field.setAccessible(true); - assertTrue(((ConcurrentHashMap) field.get(scheduler)).containsKey(taskId.getValue())); - DaemonTaskScheduler.shutdown(taskId); - } - - @Test - @SneakyThrows - void assertShutdown() { - DaemonTaskScheduler scheduler = createScheduler(); - scheduler.init(); - DaemonTaskScheduler.shutdown(taskId); - Field field = DaemonTaskScheduler.class.getDeclaredField("RUNNING_SCHEDULERS"); - field.setAccessible(true); - assertFalse(((ConcurrentHashMap) field.get(scheduler)).containsKey(taskId.getValue())); - assertTrue(((ConcurrentHashMap) field.get(scheduler)).isEmpty()); - } - - private DaemonTaskScheduler createScheduler() { - when(jobConfig.getJobName()).thenReturn(taskId.getValue()); - when(jobConfig.getCron()).thenReturn("0/1 * * * * ?"); - return new DaemonTaskScheduler(elasticJob, "transient", jobConfig, jobFacade, executorDriver, taskId); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java deleted file mode 100755 index 411b29eaee..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorTest.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.prod; - -import com.google.protobuf.ByteString; -import lombok.SneakyThrows; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.mesos.ExecutorDriver; -import org.apache.mesos.Protos; -import org.apache.mesos.Protos.ExecutorInfo; -import org.apache.mesos.Protos.FrameworkInfo; -import org.apache.mesos.Protos.SlaveInfo; -import org.apache.mesos.Protos.TaskID; -import org.apache.mesos.Protos.TaskInfo; -import org.apache.shardingsphere.elasticjob.cloud.executor.fixture.TestSimpleJob; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.lang.reflect.Field; -import java.util.HashMap; -import java.util.concurrent.ExecutorService; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -class TaskExecutorTest { - - @Mock - private ExecutorDriver executorDriver; - - @Mock - private ExecutorService executorService; - - private ExecutorInfo executorInfo; - - private final SlaveInfo slaveInfo = SlaveInfo.getDefaultInstance(); - - private final FrameworkInfo frameworkInfo = FrameworkInfo.getDefaultInstance(); - - private TaskExecutor taskExecutor; - - @BeforeEach - void setUp() { - taskExecutor = new TaskExecutor(new TestSimpleJob()); - setExecutorService(); - executorInfo = ExecutorInfo.getDefaultInstance(); - } - - @SneakyThrows - private void setExecutorService() { - Field field = TaskExecutor.class.getDeclaredField("executorService"); - field.setAccessible(true); - field.set(taskExecutor, executorService); - } - - @Test - void assertKillTask() { - TaskID taskID = Protos.TaskID.newBuilder().setValue("task_id").build(); - taskExecutor.killTask(executorDriver, taskID); - verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskID).setState(Protos.TaskState.TASK_KILLED).build()); - } - - @Test - void assertRegisteredWithoutData() { - // CHECKSTYLE:OFF - HashMap data = new HashMap<>(4, 1); - // CHECKSTYLE:ON - data.put("event_trace_rdb_driver", "org.h2.Driver"); - data.put("event_trace_rdb_url", "jdbc:h2:mem:test_executor"); - data.put("event_trace_rdb_username", "sa"); - data.put("event_trace_rdb_password", ""); - ExecutorInfo executorInfo = ExecutorInfo.newBuilder().setExecutorId(Protos.ExecutorID.newBuilder().setValue("test_executor")).setCommand(Protos.CommandInfo.getDefaultInstance()) - .setData(ByteString.copyFrom(SerializationUtils.serialize(data))).build(); - taskExecutor.registered(executorDriver, executorInfo, frameworkInfo, slaveInfo); - } - - @Test - void assertRegisteredWithData() { - taskExecutor.registered(executorDriver, executorInfo, frameworkInfo, slaveInfo); - } - - @Test - void assertLaunchTask() { - taskExecutor.launchTask(executorDriver, TaskInfo.newBuilder().setName("test_job") - .setTaskId(TaskID.newBuilder().setValue("fake_task_id")).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - } - - @Test - void assertReregistered() { - taskExecutor.reregistered(executorDriver, slaveInfo); - } - - @Test - void assertDisconnected() { - taskExecutor.disconnected(executorDriver); - } - - @Test - void assertFrameworkMessage() { - taskExecutor.frameworkMessage(executorDriver, null); - } - - @Test - void assertShutdown() { - taskExecutor.shutdown(executorDriver); - } - - @Test - void assertError() { - taskExecutor.error(executorDriver, ""); - } - - @Test - @SneakyThrows - void assertConstructor() { - TestSimpleJob testSimpleJob = new TestSimpleJob(); - taskExecutor = new TaskExecutor(testSimpleJob); - Field fieldElasticJob = TaskExecutor.class.getDeclaredField("elasticJob"); - fieldElasticJob.setAccessible(true); - Field fieldElasticJobType = TaskExecutor.class.getDeclaredField("elasticJobType"); - fieldElasticJobType.setAccessible(true); - assertThat(fieldElasticJob.get(taskExecutor), is(testSimpleJob)); - assertNull(fieldElasticJobType.get(taskExecutor)); - taskExecutor = new TaskExecutor("simpleJob"); - assertThat(fieldElasticJobType.get(taskExecutor), is("simpleJob")); - assertNull(fieldElasticJob.get(taskExecutor)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java deleted file mode 100755 index ddbcf156a9..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/prod/TaskExecutorThreadTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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.elasticjob.cloud.executor.prod; - -import com.google.protobuf.ByteString; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.mesos.ExecutorDriver; -import org.apache.mesos.Protos; -import org.apache.mesos.Protos.TaskID; -import org.apache.mesos.Protos.TaskInfo; -import org.apache.mesos.Protos.TaskState; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.executor.fixture.TestSimpleJob; -import org.apache.shardingsphere.elasticjob.cloud.executor.prod.TaskExecutor.TaskThread; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collections; -import java.util.LinkedHashMap; - -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -class TaskExecutorThreadTest { - - @Mock - private ExecutorDriver executorDriver; - - private final String taskId = String.format("%s@-@0@-@%s@-@fake_slave_id@-@0", "test_job", ExecutionType.READY); - - @Test - void assertLaunchTaskWithDaemonTaskAndJavaSimpleJob() { - TaskInfo taskInfo = buildJavaTransientTaskInfo(); - TaskThread taskThread = new TaskExecutor(new TestSimpleJob()).new TaskThread(executorDriver, taskInfo); - taskThread.run(); - verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(TaskState.TASK_RUNNING).build()); - verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(TaskState.TASK_FINISHED).build()); - } - - @Test - void assertLaunchTaskWithDaemonTaskAndJavaScriptJob() { - TaskInfo taskInfo = buildSpringScriptTransientTaskInfo(); - TaskThread taskThread = new TaskExecutor(new TestSimpleJob()).new TaskThread(executorDriver, taskInfo); - taskThread.run(); - verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(TaskState.TASK_RUNNING).build()); - verify(executorDriver).sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(TaskState.TASK_FINISHED).build()); - } - - private TaskInfo buildJavaTransientTaskInfo() { - return buildTaskInfo(buildJobConfigurationYaml()).build(); - } - - private TaskInfo buildSpringScriptTransientTaskInfo() { - return buildTaskInfo(buildJobConfigurationYaml()).build(); - } - - private TaskInfo.Builder buildTaskInfo(final String jobConfigurationYaml) { - return TaskInfo.newBuilder().setData(ByteString.copyFrom(serialize(jobConfigurationYaml))) - .setName("test_job").setTaskId(TaskID.newBuilder().setValue(taskId)).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")); - } - - private byte[] serialize(final String jobConfigurationYaml) { - // CHECKSTYLE:OFF - LinkedHashMap result = new LinkedHashMap<>(2, 1); - // CHECKSTYLE:ON - ShardingContexts shardingContexts = new ShardingContexts(taskId, "test_job", 1, "", Collections.singletonMap(1, "a")); - result.put("shardingContext", shardingContexts); - result.put("jobConfigContext", jobConfigurationYaml); - return SerializationUtils.serialize(result); - } - - private String buildJobConfigurationYaml() { - return YamlEngine.marshal(JobConfigurationPOJO.fromJobConfiguration(JobConfiguration.newBuilder("test_job", 1).setProperty(ScriptJobProperties.SCRIPT_KEY, "echo test").build())); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/resources/logback-test.xml b/elasticjob-cloud/elasticjob-cloud-executor/src/test/resources/logback-test.xml deleted file mode 100755 index 2e8f87ae03..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/resources/logback-test.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - ${log.context.name} - - - - ERROR - - - ${log.pattern} - - - - - - - - - diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml deleted file mode 100755 index 7dc994fc36..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-cloud - 3.1.0-SNAPSHOT - - elasticjob-cloud-scheduler - ${project.artifactId} - - - 5.2.7.RELEASE - - - - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-common - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-restful - ${project.parent.version} - - - org.apache.httpcomponents - httpclient - - - org.apache.httpcomponents - httpcore - - - - org.apache.commons - commons-lang3 - - - commons-codec - commons-codec - - - org.apache.mesos - mesos - - - com.netflix.fenzo - fenzo-core - - - org.apache.commons - commons-dbcp2 - - - org.slf4j - slf4j-api - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-classic - - - org.apache.curator - curator-test - - - com.h2database - h2 - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - conf/elasticjob-cloud-scheduler.properties - logback.xml - - - - - - diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/ConsoleBootstrap.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/ConsoleBootstrap.java deleted file mode 100644 index 3c089652a3..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/ConsoleBootstrap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.elasticjob.cloud.console; - -import org.apache.shardingsphere.elasticjob.cloud.console.config.advice.ConsoleExceptionHandler; -import org.apache.shardingsphere.elasticjob.cloud.console.controller.CloudAppController; -import org.apache.shardingsphere.elasticjob.cloud.console.controller.CloudJobController; -import org.apache.shardingsphere.elasticjob.cloud.console.controller.CloudOperationController; -import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationFilter; -import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.RestfulServerConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.ReconcileService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; -import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; -import org.apache.shardingsphere.elasticjob.restful.RestfulService; - -/** - * Console bootstrap for Cloud. - */ -public class ConsoleBootstrap { - - private final RestfulService restfulService; - - public ConsoleBootstrap(final CoordinatorRegistryCenter regCenter, final RestfulServerConfiguration config, final ProducerManager producerManager, final ReconcileService reconcileService) { - CloudJobController.init(regCenter, producerManager); - CloudAppController.init(regCenter, producerManager); - CloudOperationController.init(regCenter, reconcileService); - NettyRestfulServiceConfiguration restfulServiceConfiguration = new NettyRestfulServiceConfiguration(config.getPort()); - restfulServiceConfiguration.addControllerInstances(new CloudJobController(), new CloudAppController(), new CloudOperationController()); - restfulServiceConfiguration.addExceptionHandler(Exception.class, new ConsoleExceptionHandler()); - restfulServiceConfiguration.addFilterInstances(new AuthenticationFilter(new AuthenticationService())); - restfulService = new NettyRestfulService(restfulServiceConfiguration); - } - - /** - * Startup RESTful server. - */ - public void start() { - restfulService.startup(); - } - - /** - * Stop RESTful server. - */ - public void stop() { - restfulService.shutdown(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/advice/ConsoleExceptionHandler.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/advice/ConsoleExceptionHandler.java deleted file mode 100644 index 6055c311c8..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/advice/ConsoleExceptionHandler.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.elasticjob.cloud.console.config.advice; - -import io.netty.handler.codec.http.HttpResponseStatus; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.restful.handler.ExceptionHandleResult; -import org.apache.shardingsphere.elasticjob.restful.handler.ExceptionHandler; - -/** - * A default exception handler for restful service. - **/ -@Slf4j -public final class ConsoleExceptionHandler implements ExceptionHandler { - - @Override - public ExceptionHandleResult handleException(final Exception ex) { - return ExceptionHandleResult.builder() - .statusCode(HttpResponseStatus.INTERNAL_SERVER_ERROR.code()) - .result(ex.getLocalizedMessage()) - .build(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/serializer/JsonResponseBodySerializer.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/serializer/JsonResponseBodySerializer.java deleted file mode 100644 index 4f44a29847..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/config/serializer/JsonResponseBodySerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.elasticjob.cloud.console.config.serializer; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import io.netty.handler.codec.http.HttpHeaderValues; -import org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer; - -import java.nio.charset.StandardCharsets; - -/** - * Json response body serializer. Serialize object to json byte except String. - */ -public final class JsonResponseBodySerializer implements ResponseBodySerializer { - - private final Gson gson = new GsonBuilder().serializeNulls().create(); - - @Override - public String mimeType() { - return HttpHeaderValues.APPLICATION_JSON.toString(); - } - - @Override - public byte[] serialize(final Object responseBody) { - if (responseBody instanceof String) { - return ((String) responseBody).getBytes(StandardCharsets.UTF_8); - } - return gson.toJson(responseBody).getBytes(StandardCharsets.UTF_8); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppController.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppController.java deleted file mode 100755 index af32b51c48..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppController.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller; - -import com.google.gson.JsonParseException; -import org.apache.mesos.Protos.ExecutorID; -import org.apache.mesos.Protos.SlaveID; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.exception.AppConfigurationException; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService.ExecutorStateInfo; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.DisableAppService; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.restful.Http; -import org.apache.shardingsphere.elasticjob.restful.RestfulController; -import org.apache.shardingsphere.elasticjob.restful.annotation.ContextPath; -import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; -import org.apache.shardingsphere.elasticjob.restful.annotation.Param; -import org.apache.shardingsphere.elasticjob.restful.annotation.ParamSource; -import org.apache.shardingsphere.elasticjob.restful.annotation.RequestBody; - -import java.util.Collection; -import java.util.Optional; - -/** - * Cloud app controller. - */ -@ContextPath("/api/app") -public final class CloudAppController implements RestfulController { - - private static CoordinatorRegistryCenter regCenter; - - private static ProducerManager producerManager; - - private final CloudAppConfigurationService appConfigService; - - private final CloudJobConfigurationService jobConfigService; - - private final DisableAppService disableAppService; - - private final MesosStateService mesosStateService; - - public CloudAppController() { - appConfigService = new CloudAppConfigurationService(regCenter); - jobConfigService = new CloudJobConfigurationService(regCenter); - mesosStateService = new MesosStateService(regCenter); - disableAppService = new DisableAppService(regCenter); - } - - /** - * Init. - * - * @param producerManager producer manager - * @param regCenter registry center - */ - public static void init(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager) { - CloudAppController.regCenter = regCenter; - CloudAppController.producerManager = producerManager; - } - - /** - * Register app config. - * - * @param appConfig cloud app config - * @return true for operation finished. - */ - @Mapping(method = Http.POST) - public boolean register(@RequestBody final CloudAppConfigurationPOJO appConfig) { - Optional appConfigFromZk = appConfigService.load(appConfig.getAppName()); - if (appConfigFromZk.isPresent()) { - throw new AppConfigurationException("app '%s' already existed.", appConfig.getAppName()); - } - appConfigService.add(appConfig); - return true; - } - - /** - * Update app config. - * - * @param appConfig cloud app config - * @return true for operation finished. - */ - @Mapping(method = Http.PUT) - public boolean update(@RequestBody final CloudAppConfigurationPOJO appConfig) { - appConfigService.update(appConfig); - return true; - } - - /** - * Query app config. - * - * @param appName app name - * @return cloud app config - */ - @Mapping(method = Http.GET, path = "/{appName}") - public CloudAppConfigurationPOJO detail(@Param(name = "appName", source = ParamSource.PATH) final String appName) { - Optional appConfig = appConfigService.load(appName); - return appConfig.orElse(null); - } - - /** - * Find all registered app configs. - * - * @return collection of registered app configs - */ - @Mapping(method = Http.GET, path = "/list") - public Collection findAllApps() { - return appConfigService.loadAll(); - } - - /** - * Query the app is disabled or not. - * - * @param appName app name - * @return true is disabled, otherwise not - */ - @Mapping(method = Http.GET, path = "/{appName}/disable") - public boolean isDisabled(@Param(name = "appName", source = ParamSource.PATH) final String appName) { - return disableAppService.isDisabled(appName); - } - - /** - * Disable app config. - * - * @param appName app name - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/{appName}/disable") - public boolean disable(@Param(name = "appName", source = ParamSource.PATH) final String appName) { - if (appConfigService.load(appName).isPresent()) { - disableAppService.add(appName); - for (CloudJobConfigurationPOJO each : jobConfigService.loadAll()) { - if (appName.equals(each.getAppName())) { - producerManager.unschedule(each.getJobName()); - } - } - } - return true; - } - - /** - * Enable app. - * - * @param appName app name - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/{appName}/enable") - public boolean enable(@Param(name = "appName", source = ParamSource.PATH) final String appName) { - if (appConfigService.load(appName).isPresent()) { - disableAppService.remove(appName); - for (CloudJobConfigurationPOJO each : jobConfigService.loadAll()) { - if (appName.equals(each.getAppName())) { - producerManager.reschedule(each.getJobName()); - } - } - } - return true; - } - - /** - * Deregister app. - * - * @param appName app name - * @return true for operation finished. - */ - @Mapping(method = Http.DELETE, path = "/{appName}") - public boolean deregister(@Param(name = "appName", source = ParamSource.PATH) final String appName) { - if (appConfigService.load(appName).isPresent()) { - removeAppAndJobConfigurations(appName); - stopExecutors(appName); - } - return true; - } - - private void removeAppAndJobConfigurations(final String appName) { - for (CloudJobConfigurationPOJO each : jobConfigService.loadAll()) { - if (appName.equals(each.getAppName())) { - producerManager.deregister(each.getJobName()); - } - } - disableAppService.remove(appName); - appConfigService.remove(appName); - } - - private void stopExecutors(final String appName) { - try { - Collection executorBriefInfo = mesosStateService.executors(appName); - for (ExecutorStateInfo each : executorBriefInfo) { - producerManager.sendFrameworkMessage(ExecutorID.newBuilder().setValue(each.getId()).build(), - SlaveID.newBuilder().setValue(each.getSlaveId()).build(), "STOP".getBytes()); - } - } catch (final JsonParseException ex) { - throw new JobSystemException(ex); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobController.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobController.java deleted file mode 100755 index 69065f1eec..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobController.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.console.controller.search.JobEventRdbSearch; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.FacadeService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverTaskInfo; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobExecutionTypeStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.restful.Http; -import org.apache.shardingsphere.elasticjob.restful.wrapper.QueryParameterMap; -import org.apache.shardingsphere.elasticjob.restful.annotation.ParamSource; -import org.apache.shardingsphere.elasticjob.restful.RestfulController; -import org.apache.shardingsphere.elasticjob.restful.annotation.ContextPath; -import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; -import org.apache.shardingsphere.elasticjob.restful.annotation.Param; -import org.apache.shardingsphere.elasticjob.restful.annotation.RequestBody; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; - -import javax.sql.DataSource; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.Set; - -/** - * Cloud job restful api. - */ -@Slf4j -@ContextPath("/api/job") -public final class CloudJobController implements RestfulController { - - private static CoordinatorRegistryCenter regCenter; - - private static JobEventRdbSearch jobEventRdbSearch; - - private static ProducerManager producerManager; - - private final CloudJobConfigurationService configService; - - private final FacadeService facadeService; - - private final StatisticManager statisticManager; - - public CloudJobController() { - Preconditions.checkNotNull(regCenter); - configService = new CloudJobConfigurationService(regCenter); - facadeService = new FacadeService(regCenter); - statisticManager = StatisticManager.getInstance(regCenter, null); - } - - /** - * Init. - * @param regCenter registry center - * @param producerManager producer manager - */ - public static void init(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager) { - CloudJobController.regCenter = regCenter; - CloudJobController.producerManager = producerManager; - Optional> tracingConfiguration = BootstrapEnvironment.getINSTANCE().getTracingConfiguration(); - jobEventRdbSearch = tracingConfiguration.map(tracingConfiguration1 -> new JobEventRdbSearch((DataSource) tracingConfiguration1.getTracingStorageConfiguration().getStorage())).orElse(null); - } - - /** - * Register cloud job. - * - * @param cloudJobConfig cloud job configuration - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/register") - public boolean register(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig) { - producerManager.register(cloudJobConfig); - return true; - } - - /** - * Update cloud job. - * - * @param cloudJobConfig cloud job configuration - * @return true for operation finished. - */ - @Mapping(method = Http.PUT, path = "/update") - public boolean update(@RequestBody final CloudJobConfigurationPOJO cloudJobConfig) { - producerManager.update(cloudJobConfig); - return true; - } - - /** - * Deregister cloud job. - * - * @param jobName job name - * @return true for operation finished. - */ - @Mapping(method = Http.DELETE, path = "/{jobName}/deregister") - public boolean deregister(@Param(name = "jobName", source = ParamSource.PATH) final String jobName) { - producerManager.deregister(jobName); - return true; - } - - /** - * Check whether the cloud job is disabled or not. - * - * @param jobName job name - * @return true is disabled, otherwise not - */ - @Mapping(method = Http.GET, path = "/{jobName}/disable") - public boolean isDisabled(@Param(name = "jobName", source = ParamSource.PATH) final String jobName) { - return facadeService.isJobDisabled(jobName); - } - - /** - * Enable cloud job. - * - * @param jobName job name - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/{jobName}/enable") - public boolean enable(@Param(name = "jobName", source = ParamSource.PATH) final String jobName) { - Optional configOptional = configService.load(jobName); - if (configOptional.isPresent()) { - facadeService.enableJob(jobName); - producerManager.reschedule(jobName); - } - return true; - } - - /** - * Disable cloud job. - * - * @param jobName job name - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/{jobName}/disable") - public boolean disable(@Param(name = "jobName", source = ParamSource.PATH) final String jobName) { - if (configService.load(jobName).isPresent()) { - facadeService.disableJob(jobName); - producerManager.unschedule(jobName); - } - return true; - } - - /** - * Trigger job once. - * - * @param jobName job name - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/trigger") - public boolean trigger(@RequestBody final String jobName) { - Optional config = configService.load(jobName); - if (config.isPresent() && CloudJobExecutionType.DAEMON == config.get().getJobExecutionType()) { - throw new JobSystemException("Daemon job '%s' cannot support trigger.", jobName); - } - facadeService.addTransient(jobName); - return true; - } - - /** - * Query job detail. - * - * @param jobName job name - * @return the job detail - */ - @Mapping(method = Http.GET, path = "/jobs/{jobName}") - public CloudJobConfigurationPOJO detail(@Param(name = "jobName", source = ParamSource.PATH) final String jobName) { - Optional cloudJobConfig = configService.load(jobName); - return cloudJobConfig.orElse(null); - } - - /** - * Find all jobs. - * @return all jobs - */ - @Mapping(method = Http.GET, path = "/jobs") - public Collection findAllJobs() { - return configService.loadAll(); - } - - /** - * Find all running tasks. - * @return all running tasks - */ - @Mapping(method = Http.GET, path = "/tasks/running") - public Collection findAllRunningTasks() { - List result = new LinkedList<>(); - for (Set each : facadeService.getAllRunningTasks().values()) { - result.addAll(each); - } - return result; - } - - /** - * Find all ready tasks. - * @return collection of all ready tasks - */ - @Mapping(method = Http.GET, path = "/tasks/ready") - public Collection> findAllReadyTasks() { - Map readyTasks = facadeService.getAllReadyTasks(); - List> result = new ArrayList<>(readyTasks.size()); - for (Entry each : readyTasks.entrySet()) { - Map oneTask = new HashMap<>(2, 1); - oneTask.put("jobName", each.getKey()); - oneTask.put("times", String.valueOf(each.getValue())); - result.add(oneTask); - } - return result; - } - - /** - * Find all failover tasks. - * @return collection of all the failover tasks - */ - @Mapping(method = Http.GET, path = "/tasks/failover") - public Collection findAllFailoverTasks() { - List result = new LinkedList<>(); - for (Collection each : facadeService.getAllFailoverTasks().values()) { - result.addAll(each); - } - return result; - } - - /** - * Find job execution events. - * @param requestParams request params - * @return job execution event - * @throws ParseException parse exception - */ - @Mapping(method = Http.GET, path = "/events/executions") - public JobEventRdbSearch.Result findJobExecutionEvents(final QueryParameterMap requestParams) throws ParseException { - if (!isRdbConfigured()) { - return new JobEventRdbSearch.Result<>(0, Collections.emptyList()); - } - return jobEventRdbSearch.findJobExecutionEvents(buildCondition(requestParams.toSingleValueMap(), new String[]{"jobName", "taskId", "ip", "isSuccess"})); - } - - /** - * Find job status trace events. - * @param requestParams request params - * @return job status trace event - * @throws ParseException parse exception - */ - @Mapping(method = Http.GET, path = "/events/statusTraces") - public JobEventRdbSearch.Result findJobStatusTraceEvents(final QueryParameterMap requestParams) throws ParseException { - if (!isRdbConfigured()) { - return new JobEventRdbSearch.Result<>(0, Collections.emptyList()); - } - return jobEventRdbSearch.findJobStatusTraceEvents(buildCondition(requestParams.toSingleValueMap(), new String[]{"jobName", "taskId", "slaveId", "source", "executionType", "state"})); - } - - private boolean isRdbConfigured() { - return null != jobEventRdbSearch; - } - - private JobEventRdbSearch.Condition buildCondition(final Map requestParams, final String[] params) throws ParseException { - int perPage = 10; - int page = 1; - if (!Strings.isNullOrEmpty(requestParams.get("per_page"))) { - perPage = Integer.parseInt(requestParams.get("per_page")); - } - if (!Strings.isNullOrEmpty(requestParams.get("page"))) { - page = Integer.parseInt(requestParams.get("page")); - } - String sort = requestParams.get("sort"); - String order = requestParams.get("order"); - Date startTime = null; - Date endTime = null; - Map fields = getQueryParameters(requestParams, params); - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - if (!Strings.isNullOrEmpty(requestParams.get("startTime"))) { - startTime = simpleDateFormat.parse(requestParams.get("startTime")); - } - if (!Strings.isNullOrEmpty(requestParams.get("endTime"))) { - endTime = simpleDateFormat.parse(requestParams.get("endTime")); - } - return new JobEventRdbSearch.Condition(perPage, page, sort, order, startTime, endTime, fields); - } - - private Map getQueryParameters(final Map requestParams, final String[] params) { - final Map result = new HashMap<>(); - for (String each : params) { - if (!Strings.isNullOrEmpty(requestParams.get(each))) { - result.put(each, requestParams.get(each)); - } - } - return result; - } - - /** - * Find task result statistics. - * - * @param since time span - * @return task result statistics - */ - @Mapping(method = Http.GET, path = "/statistics/tasks/results") - public List findTaskResultStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since) { - if ("last24hours".equals(since)) { - return statisticManager.findTaskResultStatisticsDaily(); - } else { - return Collections.emptyList(); - } - } - - /** - * Get task result statistics. - * - * @param period time period - * @return task result statistics - */ - @Mapping(method = Http.GET, path = "/statistics/tasks/results/{period}") - public TaskResultStatistics getTaskResultStatistics(@Param(name = "period", source = ParamSource.PATH, required = false) final String period) { - switch (period) { - case "online": - return statisticManager.getTaskResultStatisticsSinceOnline(); - case "lastWeek": - return statisticManager.getTaskResultStatisticsWeekly(); - case "lastHour": - return statisticManager.findLatestTaskResultStatistics(StatisticInterval.HOUR); - case "lastMinute": - return statisticManager.findLatestTaskResultStatistics(StatisticInterval.MINUTE); - default: - return new TaskResultStatistics(0, 0, StatisticInterval.DAY, new Date()); - } - } - - /** - * Find task running statistics. - * - * @param since time span - * @return task result statistics - */ - @Mapping(method = Http.GET, path = "/statistics/tasks/running") - public List findTaskRunningStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since) { - if ("lastWeek".equals(since)) { - return statisticManager.findTaskRunningStatisticsWeekly(); - } else { - return Collections.emptyList(); - } - } - - /** - * Get job execution type statistics. - * @return job execution statistics - */ - @Mapping(method = Http.GET, path = "/statistics/jobs/executionType") - public JobExecutionTypeStatistics getJobExecutionTypeStatistics() { - return statisticManager.getJobExecutionTypeStatistics(); - } - - /** - * Find job running statistics in the recent week. - * - * @param since time span - * @return collection of job running statistics in the recent week - */ - @Mapping(method = Http.GET, path = "/statistics/jobs/running") - public List findJobRunningStatistics(@Param(name = "since", source = ParamSource.QUERY, required = false) final String since) { - if ("lastWeek".equals(since)) { - return statisticManager.findJobRunningStatisticsWeekly(); - } else { - return Collections.emptyList(); - } - } - - /** - * Find job register statistics. - * @return collection of job register statistics since online - */ - @Mapping(method = Http.GET, path = "/statistics/jobs/register") - public List findJobRegisterStatistics() { - return statisticManager.findJobRegisterStatisticsSinceOnline(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationController.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationController.java deleted file mode 100755 index 54d30e8b23..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationController.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.gson.JsonParseException; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.ReconcileService; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.restful.Http; -import org.apache.shardingsphere.elasticjob.restful.RestfulController; -import org.apache.shardingsphere.elasticjob.restful.annotation.ContextPath; -import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; -import org.apache.shardingsphere.elasticjob.restful.annotation.Param; -import org.apache.shardingsphere.elasticjob.restful.annotation.ParamSource; - -import java.util.Collection; -import java.util.Map; - -/** - * Cloud operation restful api. - */ -@Slf4j -@ContextPath("/api/operate") -public final class CloudOperationController implements RestfulController { - - private static ReconcileService reconcileService; - - private static final long RECONCILE_MILLIS_INTERVAL = 10 * 1000L; - - private static MesosStateService mesosStateService; - - private static long lastReconcileTime; - - /** - * Init. - * - * @param regCenter registry center - * @param reconcileService reconcile service - */ - public static void init(final CoordinatorRegistryCenter regCenter, final ReconcileService reconcileService) { - CloudOperationController.reconcileService = reconcileService; - CloudOperationController.mesosStateService = new MesosStateService(regCenter); - } - - /** - * Explicit reconcile service. - * - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/reconcile/explicit") - public boolean explicitReconcile() { - validReconcileInterval(); - reconcileService.explicitReconcile(); - return true; - } - - /** - * Implicit reconcile service. - * - * @return true for operation finished. - */ - @Mapping(method = Http.POST, path = "/reconcile/implicit") - public boolean implicitReconcile() { - validReconcileInterval(); - reconcileService.implicitReconcile(); - return true; - } - - private void validReconcileInterval() { - if (System.currentTimeMillis() < lastReconcileTime + RECONCILE_MILLIS_INTERVAL) { - throw new RuntimeException("Repeat explicitReconcile"); - } - lastReconcileTime = System.currentTimeMillis(); - } - - /** - * Get sandbox of the cloud job by app name. - * - * @param appName application name - * @return sandbox info - * @throws JsonParseException parse json exception - */ - @Mapping(method = Http.GET, path = "/sandbox") - public Collection> sandbox(@Param(name = "appName", source = ParamSource.QUERY) final String appName) throws JsonParseException { - Preconditions.checkArgument(!Strings.isNullOrEmpty(appName), "Lack param 'appName'"); - return mesosStateService.sandbox(appName); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java deleted file mode 100755 index a3b42e734f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearch.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller.search; - -import com.google.common.base.CaseFormat; -import com.google.common.base.Strings; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.Arrays; -import java.util.Collection; -import java.util.Date; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * Job event RDB search. - */ -@RequiredArgsConstructor -@Slf4j -public final class JobEventRdbSearch { - - private static final String TABLE_JOB_EXECUTION_LOG = "JOB_EXECUTION_LOG"; - - private static final String TABLE_JOB_STATUS_TRACE_LOG = "JOB_STATUS_TRACE_LOG"; - - private static final List FIELDS_JOB_EXECUTION_LOG = - Arrays.asList("id", "hostname", "ip", "task_id", "job_name", "execution_source", "sharding_item", "start_time", "complete_time", "is_success", "failure_cause"); - - private static final List FIELDS_JOB_STATUS_TRACE_LOG = - Arrays.asList("id", "job_name", "original_task_id", "task_id", "slave_id", "source", "execution_type", "sharding_item", "state", "message", "creation_time"); - - private final DataSource dataSource; - - /** - * Find job execution events. - * - * @param condition query condition - * @return job execution events - */ - public Result findJobExecutionEvents(final Condition condition) { - return new Result<>(getEventCount(TABLE_JOB_EXECUTION_LOG, FIELDS_JOB_EXECUTION_LOG, condition), getJobExecutionEvents(condition)); - } - - /** - * Find job status trace events. - * - * @param condition query condition - * @return job status trace events - */ - public Result findJobStatusTraceEvents(final Condition condition) { - return new Result<>(getEventCount(TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition), getJobStatusTraceEvents(condition)); - } - - private List getJobExecutionEvents(final Condition condition) { - List result = new LinkedList<>(); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = createDataPreparedStatement(conn, TABLE_JOB_EXECUTION_LOG, FIELDS_JOB_EXECUTION_LOG, condition); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), - resultSet.getString(5), JobExecutionEvent.ExecutionSource.valueOf(resultSet.getString(6)), Integer.parseInt(resultSet.getString(7)), - new Date(resultSet.getTimestamp(8).getTime()), resultSet.getTimestamp(9) == null ? null : new Date(resultSet.getTimestamp(9).getTime()), - resultSet.getBoolean(10), resultSet.getString(11)); - result.add(jobExecutionEvent); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch JobExecutionEvent from DB error:", ex); - } - return result; - } - - private List getJobStatusTraceEvents(final Condition condition) { - List result = new LinkedList<>(); - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = createDataPreparedStatement(conn, TABLE_JOB_STATUS_TRACE_LOG, FIELDS_JOB_STATUS_TRACE_LOG, condition); - ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), - resultSet.getString(5), JobStatusTraceEvent.Source.valueOf(resultSet.getString(6)), resultSet.getString(7), resultSet.getString(8), - JobStatusTraceEvent.State.valueOf(resultSet.getString(9)), resultSet.getString(10), new Date(resultSet.getTimestamp(11).getTime())); - result.add(jobStatusTraceEvent); - } - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch JobStatusTraceEvent from DB error:", ex); - } - return result; - } - - private int getEventCount(final String tableName, final Collection tableFields, final Condition condition) { - int result = 0; - try ( - Connection conn = dataSource.getConnection(); - PreparedStatement preparedStatement = createCountPreparedStatement(conn, tableName, tableFields, condition); - ResultSet resultSet = preparedStatement.executeQuery()) { - resultSet.next(); - result = resultSet.getInt(1); - } catch (final SQLException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error("Fetch EventCount from DB error:", ex); - } - return result; - } - - private PreparedStatement createDataPreparedStatement(final Connection conn, final String tableName, final Collection tableFields, final Condition condition) throws SQLException { - String sql = buildDataSql(tableName, tableFields, condition); - PreparedStatement result = conn.prepareStatement(sql); - setBindValue(result, tableFields, condition); - return result; - } - - private PreparedStatement createCountPreparedStatement(final Connection conn, final String tableName, final Collection tableFields, final Condition condition) throws SQLException { - String sql = buildCountSql(tableName, tableFields, condition); - PreparedStatement result = conn.prepareStatement(sql); - setBindValue(result, tableFields, condition); - return result; - } - - private String buildDataSql(final String tableName, final Collection tableFields, final Condition condition) { - StringBuilder sqlBuilder = new StringBuilder(); - String selectSql = buildSelect(tableName, tableFields); - String whereSql = buildWhere(tableName, tableFields, condition); - String orderSql = buildOrder(tableFields, condition.getSort(), condition.getOrder()); - String limitSql = buildLimit(condition.getPage(), condition.getPerPage()); - sqlBuilder.append(selectSql).append(whereSql).append(orderSql).append(limitSql); - return sqlBuilder.toString(); - } - - private String buildCountSql(final String tableName, final Collection tableFields, final Condition condition) { - StringBuilder sqlBuilder = new StringBuilder(); - String selectSql = buildSelectCount(tableName); - String whereSql = buildWhere(tableName, tableFields, condition); - sqlBuilder.append(selectSql).append(whereSql); - return sqlBuilder.toString(); - } - - private String buildSelectCount(final String tableName) { - return String.format("SELECT COUNT(1) FROM %s", tableName); - } - - private String buildSelect(final String tableName, final Collection tableFields) { - StringBuilder sqlBuilder = new StringBuilder(); - sqlBuilder.append("SELECT "); - for (String each : tableFields) { - sqlBuilder.append(each).append(","); - } - sqlBuilder.deleteCharAt(sqlBuilder.length() - 1); - sqlBuilder.append(" FROM ").append(tableName); - return sqlBuilder.toString(); - } - - private String buildWhere(final String tableName, final Collection tableFields, final Condition condition) { - StringBuilder sqlBuilder = new StringBuilder(); - sqlBuilder.append(" WHERE 1=1"); - if (null != condition.getFields() && !condition.getFields().isEmpty()) { - for (Map.Entry entry : condition.getFields().entrySet()) { - String lowerUnderscore = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, entry.getKey()); - if (null != entry.getValue() && tableFields.contains(lowerUnderscore)) { - sqlBuilder.append(" AND ").append(lowerUnderscore).append("=?"); - } - } - } - if (null != condition.getStartTime()) { - sqlBuilder.append(" AND ").append(getTableTimeField(tableName)).append(">=?"); - } - if (null != condition.getEndTime()) { - sqlBuilder.append(" AND ").append(getTableTimeField(tableName)).append("<=?"); - } - return sqlBuilder.toString(); - } - - private void setBindValue(final PreparedStatement preparedStatement, final Collection tableFields, final Condition condition) throws SQLException { - int index = 1; - if (null != condition.getFields() && !condition.getFields().isEmpty()) { - for (Map.Entry entry : condition.getFields().entrySet()) { - String lowerUnderscore = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, entry.getKey()); - if (null != entry.getValue() && tableFields.contains(lowerUnderscore)) { - preparedStatement.setString(index++, String.valueOf(entry.getValue())); - } - } - } - if (null != condition.getStartTime()) { - preparedStatement.setTimestamp(index++, new Timestamp(condition.getStartTime().getTime())); - } - if (null != condition.getEndTime()) { - preparedStatement.setTimestamp(index, new Timestamp(condition.getEndTime().getTime())); - } - } - - private String getTableTimeField(final String tableName) { - String result = ""; - if (TABLE_JOB_EXECUTION_LOG.equals(tableName)) { - result = "start_time"; - } else if (TABLE_JOB_STATUS_TRACE_LOG.equals(tableName)) { - result = "creation_time"; - } - return result; - } - - private String buildOrder(final Collection tableFields, final String sortName, final String sortOrder) { - if (Strings.isNullOrEmpty(sortName)) { - return ""; - } - String lowerUnderscore = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, sortName); - if (!tableFields.contains(lowerUnderscore)) { - return ""; - } - StringBuilder sqlBuilder = new StringBuilder(); - sqlBuilder.append(" ORDER BY ").append(lowerUnderscore); - if ("DESC".equals(sortOrder.toUpperCase())) { - sqlBuilder.append(" DESC"); - } else { - sqlBuilder.append(" ASC"); - } - return sqlBuilder.toString(); - } - - private String buildLimit(final int page, final int perPage) { - StringBuilder sqlBuilder = new StringBuilder(); - if (page > 0 && perPage > 0) { - sqlBuilder.append(" LIMIT ").append((page - 1) * perPage).append(",").append(perPage); - } else { - sqlBuilder.append(" LIMIT ").append(Condition.DEFAULT_PAGE_SIZE); - } - return sqlBuilder.toString(); - } - - /** - * Query condition. - */ - @RequiredArgsConstructor - @Getter - public static class Condition { - - private static final int DEFAULT_PAGE_SIZE = 10; - - private final int perPage; - - private final int page; - - private final String sort; - - private final String order; - - private final Date startTime; - - private final Date endTime; - - private final Map fields; - } - - @RequiredArgsConstructor - @Getter - public static class Result { - - private final Integer total; - - private final List rows; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationConstants.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationConstants.java deleted file mode 100644 index e42064b378..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationConstants.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.elasticjob.cloud.console.security; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Authentication constants. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class AuthenticationConstants { - - public static final String LOGIN_URI = "/api/login"; - - public static final String HEADER_NAME = "accessToken"; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationFilter.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationFilter.java deleted file mode 100644 index 60da27fb14..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationFilter.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.elasticjob.cloud.console.security; - -import com.google.common.base.Strings; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import io.netty.buffer.ByteBufUtil; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.FullHttpResponse; -import io.netty.handler.codec.http.HttpHeaderNames; -import io.netty.handler.codec.http.HttpMethod; -import io.netty.handler.codec.http.HttpResponseStatus; -import io.netty.handler.codec.http.HttpUtil; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.restful.Filter; -import org.apache.shardingsphere.elasticjob.restful.Http; -import org.apache.shardingsphere.elasticjob.restful.deserializer.RequestBodyDeserializer; -import org.apache.shardingsphere.elasticjob.restful.deserializer.RequestBodyDeserializerFactory; -import org.apache.shardingsphere.elasticjob.restful.filter.FilterChain; - -import java.util.Collections; -import java.util.Optional; - -/** - * Authentication filter. - */ -@RequiredArgsConstructor -public final class AuthenticationFilter implements Filter { - - private final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); - - private final AuthenticationService authenticationService; - - @Override - public void doFilter(final FullHttpRequest httpRequest, final FullHttpResponse httpResponse, final FilterChain filterChain) { - if (HttpMethod.POST.equals(httpRequest.method()) && AuthenticationConstants.LOGIN_URI.equals(httpRequest.uri())) { - handleLogin(httpRequest, httpResponse); - return; - } - String accessToken = httpRequest.headers().get(AuthenticationConstants.HEADER_NAME); - if (Strings.isNullOrEmpty(accessToken) || !accessToken.equals(authenticationService.getToken())) { - respondWithUnauthorized(httpResponse); - return; - } - filterChain.next(httpRequest); - } - - private void handleLogin(final FullHttpRequest httpRequest, final FullHttpResponse httpResponse) { - byte[] bytes = ByteBufUtil.getBytes(httpRequest.content()); - String mimeType = Optional.ofNullable(HttpUtil.getMimeType(httpRequest)).orElseGet(() -> HttpUtil.getMimeType(Http.DEFAULT_CONTENT_TYPE)).toString(); - RequestBodyDeserializer deserializer = RequestBodyDeserializerFactory.getRequestBodyDeserializer(mimeType); - AuthenticationInfo authenticationInfo = deserializer.deserialize(AuthenticationInfo.class, bytes); - boolean result = authenticationService.check(authenticationInfo); - if (!result) { - respondWithUnauthorized(httpResponse); - return; - } - String token = gson.toJson(Collections.singletonMap(AuthenticationConstants.HEADER_NAME, authenticationService.getToken())); - respond(httpResponse, HttpResponseStatus.OK, token.getBytes()); - } - - private void respondWithUnauthorized(final FullHttpResponse httpResponse) { - String result = gson.toJson(Collections.singletonMap("message", "Unauthorized.")); - respond(httpResponse, HttpResponseStatus.UNAUTHORIZED, result.getBytes()); - } - - private void respond(final FullHttpResponse httpResponse, final HttpResponseStatus status, final byte[] result) { - httpResponse.setStatus(status); - httpResponse.headers().set(HttpHeaderNames.CONTENT_TYPE, Http.DEFAULT_CONTENT_TYPE); - httpResponse.content().writeBytes(result); - HttpUtil.setContentLength(httpResponse, httpResponse.content().readableBytes()); - HttpUtil.setKeepAlive(httpResponse, true); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationInfo.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationInfo.java deleted file mode 100644 index a0d0da813a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationInfo.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.elasticjob.cloud.console.security; - -import lombok.Getter; -import lombok.Setter; - -/** - * Authentication info. - */ -@Getter -@Setter -public final class AuthenticationInfo { - - private String username; - - private String password; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationService.java deleted file mode 100644 index a07cf58960..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/console/security/AuthenticationService.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.elasticjob.cloud.console.security; - -import com.google.common.base.Strings; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import org.apache.commons.codec.binary.Base64; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.AuthConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; - -/** - * User authentication service. - */ -public final class AuthenticationService { - - private final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); - - private final Base64 base64 = new Base64(); - - private final BootstrapEnvironment env = BootstrapEnvironment.getINSTANCE(); - - /** - * Check auth. - * - * @param authenticationInfo authentication info - * @return check success or failure - */ - public boolean check(final AuthenticationInfo authenticationInfo) { - if (null == authenticationInfo || Strings.isNullOrEmpty(authenticationInfo.getUsername()) || Strings.isNullOrEmpty(authenticationInfo.getPassword())) { - return false; - } - AuthConfiguration userAuthConfiguration = env.getUserAuthConfiguration(); - return userAuthConfiguration.getAuthUsername().equals(authenticationInfo.getUsername()) && userAuthConfiguration.getAuthPassword().equals(authenticationInfo.getPassword()); - } - - /** - * Get user authentication token. - * - * @return authentication token - */ - public String getToken() { - return base64.encodeToString(gson.toJson(env.getUserAuthConfiguration()).getBytes()); - } -} 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 deleted file mode 100755 index 57a722883f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/Bootstrap.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.curator.framework.CuratorFramework; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.HANode; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.SchedulerElectionCandidate; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperElectionService; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; - -import java.util.concurrent.CountDownLatch; - -/** - * Mesos bootstrap. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@Slf4j -public final class Bootstrap { - - /** - * Startup server. - * - * @param args arguments - * @throws InterruptedException thread interrupted exception - */ - // CHECKSTYLE:OFF - public static void main(final String[] args) throws InterruptedException { - // CHECKSTYLE:ON - CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(BootstrapEnvironment.getINSTANCE().getZookeeperConfiguration()); - regCenter.init(); - final ZookeeperElectionService electionService = new ZookeeperElectionService( - BootstrapEnvironment.getINSTANCE().getFrameworkHostPort(), (CuratorFramework) regCenter.getRawClient(), HANode.ELECTION_NODE, new SchedulerElectionCandidate(regCenter)); - electionService.start(); - final CountDownLatch latch = new CountDownLatch(1); - latch.await(); - Runtime.getRuntime().addShutdownHook(new Thread("shutdown-hook") { - - @Override - public void run() { - electionService.stop(); - latch.countDown(); - } - }); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfiguration.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfiguration.java deleted file mode 100755 index 4b587fde04..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfiguration.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app; - -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.ToString; - -/** - * Cloud app configuration. - */ -@AllArgsConstructor -@RequiredArgsConstructor -@Getter -@ToString -public final class CloudAppConfiguration { - - private final String appName; - - private final String appURL; - - private final String bootstrapScript; - - private double cpuCount = 1d; - - private double memoryMB = 128d; - - private boolean appCacheEnable = true; - - private int eventTraceSamplingCount; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListener.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListener.java deleted file mode 100644 index 1e23626834..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListener.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app; - -import com.google.gson.JsonParseException; -import lombok.extern.slf4j.Slf4j; -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener; -import org.apache.mesos.Protos; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.Collection; -import java.util.concurrent.Executors; - -/** - * Cloud app configuration change listener. - */ -@Slf4j -public final class CloudAppConfigurationListener implements CuratorCacheListener { - - private final CoordinatorRegistryCenter regCenter; - - private final ProducerManager producerManager; - - private MesosStateService mesosStateService; - - public CloudAppConfigurationListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager) { - this.regCenter = regCenter; - this.producerManager = producerManager; - mesosStateService = new MesosStateService(regCenter); - } - - @Override - public void event(final Type type, final ChildData oldData, final ChildData data) { - String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); - if (Type.NODE_DELETED == type && isJobAppConfigNode(path)) { - String appName = path.substring(CloudAppConfigurationNode.ROOT.length() + 1); - stopExecutors(appName); - } - } - - private boolean isJobAppConfigNode(final String path) { - return path.startsWith(CloudAppConfigurationNode.ROOT) && path.length() > CloudAppConfigurationNode.ROOT.length(); - } - - /** - * Start the listener service of the cloud job service. - */ - public void start() { - getCache().listenable().addListener(this, Executors.newSingleThreadExecutor()); - } - - /** - * Stop the listener service of the cloud job service. - */ - public void stop() { - getCache().listenable().removeListener(this); - } - - private CuratorCache getCache() { - CuratorCache result = (CuratorCache) regCenter.getRawCache(CloudAppConfigurationNode.ROOT); - if (null != result) { - return result; - } - regCenter.addCacheData(CloudAppConfigurationNode.ROOT); - return (CuratorCache) regCenter.getRawCache(CloudAppConfigurationNode.ROOT); - } - - private void stopExecutors(final String appName) { - try { - Collection executorBriefInfo = mesosStateService.executors(appName); - for (MesosStateService.ExecutorStateInfo each : executorBriefInfo) { - producerManager.sendFrameworkMessage(Protos.ExecutorID.newBuilder().setValue(each.getId()).build(), - Protos.SlaveID.newBuilder().setValue(each.getSlaveId()).build(), "STOP".getBytes()); - } - } catch (final JsonParseException ex) { - throw new JobSystemException(ex); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNode.java deleted file mode 100755 index 292795d53d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNode.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Cloud app configuration node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class CloudAppConfigurationNode { - - public static final String ROOT = "/config/app"; - - private static final String APP_CONFIG = ROOT + "/%s"; - - static String getRootNodePath(final String appName) { - return String.format(APP_CONFIG, appName); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationService.java deleted file mode 100755 index 589df88b65..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationService.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app; - -import com.google.common.base.Strings; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -/** - * Cloud app configuration service. - */ -@RequiredArgsConstructor -public final class CloudAppConfigurationService { - - private final CoordinatorRegistryCenter regCenter; - - /** - * Add cloud app configuration. - * - * @param appConfig cloud app configuration - */ - public void add(final CloudAppConfigurationPOJO appConfig) { - regCenter.persist(CloudAppConfigurationNode.getRootNodePath(appConfig.getAppName()), YamlEngine.marshal(appConfig)); - } - - /** - * Update cloud app configuration. - * - * @param appConfig cloud app configuration - */ - public void update(final CloudAppConfigurationPOJO appConfig) { - regCenter.update(CloudAppConfigurationNode.getRootNodePath(appConfig.getAppName()), YamlEngine.marshal(appConfig)); - } - - /** - * Load app configuration by app name. - * - * @param appName application name - * @return cloud app configuration - */ - public Optional load(final String appName) { - String configContent = regCenter.get(CloudAppConfigurationNode.getRootNodePath(appName)); - return Strings.isNullOrEmpty(configContent) ? Optional.empty() : Optional.of(YamlEngine.unmarshal(configContent, CloudAppConfigurationPOJO.class)); - } - - /** - * Load all registered cloud app configurations. - * - * @return collection of the registered cloud app configuration - */ - public Collection loadAll() { - if (!regCenter.isExisted(CloudAppConfigurationNode.ROOT)) { - return Collections.emptyList(); - } - List appNames = regCenter.getChildrenKeys(CloudAppConfigurationNode.ROOT); - Collection result = new ArrayList<>(appNames.size()); - for (String each : appNames) { - Optional config = load(each); - config.ifPresent(result::add); - } - return result; - } - - /** - * Remove cloud app configuration by app name. - * - * @param appName to be removed application name - */ - public void remove(final String appName) { - regCenter.remove(CloudAppConfigurationNode.getRootNodePath(appName)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java deleted file mode 100755 index 7c5db87946..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJO.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app.pojo; - -import lombok.Getter; -import lombok.Setter; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration; - -/** - * Cloud app configuration POJO. - */ -@Getter -@Setter -public final class CloudAppConfigurationPOJO { - - private String appName; - - private String appURL; - - private String bootstrapScript; - - private double cpuCount = 1d; - - private double memoryMB = 128d; - - private boolean appCacheEnable = true; - - private int eventTraceSamplingCount; - - /** - * Convert to cloud app configuration. - * - * @return cloud app configuration - */ - public CloudAppConfiguration toCloudAppConfiguration() { - return new CloudAppConfiguration(appName, appURL, bootstrapScript, cpuCount, memoryMB, appCacheEnable, eventTraceSamplingCount); - } - - /** - * Convert from cloud app configuration. - * - * @param cloudAppConfig cloud job configuration - * @return cloud app configuration POJO - */ - public static CloudAppConfigurationPOJO fromCloudAppConfiguration(final CloudAppConfiguration cloudAppConfig) { - CloudAppConfigurationPOJO result = new CloudAppConfigurationPOJO(); - result.setAppName(cloudAppConfig.getAppName()); - result.setAppURL(cloudAppConfig.getAppURL()); - result.setBootstrapScript(cloudAppConfig.getBootstrapScript()); - result.setCpuCount(cloudAppConfig.getCpuCount()); - result.setMemoryMB(cloudAppConfig.getMemoryMB()); - result.setAppCacheEnable(cloudAppConfig.isAppCacheEnable()); - result.setEventTraceSamplingCount(cloudAppConfig.getEventTraceSamplingCount()); - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java deleted file mode 100755 index ec422a7f18..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListener.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.job; - -import lombok.extern.slf4j.Slf4j; - -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.Collections; -import java.util.concurrent.Executors; - -/** - * Cloud job configuration change listener. - */ -@Slf4j -public final class CloudJobConfigurationListener implements CuratorCacheListener { - - private final CoordinatorRegistryCenter regCenter; - - private final ProducerManager producerManager; - - private final ReadyService readyService; - - public CloudJobConfigurationListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager) { - this.regCenter = regCenter; - readyService = new ReadyService(regCenter); - this.producerManager = producerManager; - } - - @Override - public void event(final Type type, final ChildData oldData, final ChildData data) { - String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); - if (Type.NODE_CREATED == type && isJobConfigNode(path)) { - CloudJobConfigurationPOJO cloudJobConfig = getCloudJobConfiguration(data); - if (null != cloudJobConfig) { - producerManager.schedule(cloudJobConfig); - } - } else if (Type.NODE_CHANGED == type && isJobConfigNode(path)) { - CloudJobConfigurationPOJO cloudJobConfig = getCloudJobConfiguration(data); - if (null == cloudJobConfig) { - return; - } - if (CloudJobExecutionType.DAEMON == cloudJobConfig.getJobExecutionType()) { - readyService.remove(Collections.singletonList(cloudJobConfig.getJobName())); - } - if (!cloudJobConfig.isMisfire()) { - readyService.setMisfireDisabled(cloudJobConfig.getJobName()); - } - producerManager.reschedule(cloudJobConfig.getJobName()); - } else if (Type.NODE_DELETED == type && isJobConfigNode(path)) { - String jobName = path.substring(CloudJobConfigurationNode.ROOT.length() + 1); - producerManager.unschedule(jobName); - } - } - - private boolean isJobConfigNode(final String path) { - return path.startsWith(CloudJobConfigurationNode.ROOT) && path.length() > CloudJobConfigurationNode.ROOT.length(); - } - - private CloudJobConfigurationPOJO getCloudJobConfiguration(final ChildData data) { - try { - return YamlEngine.unmarshal(new String(data.getData()), CloudJobConfigurationPOJO.class); - // CHECKSTYLE:OFF - } catch (final Exception ex) { - log.warn("Wrong Cloud Job Configuration with:", ex); - // CHECKSTYLE:ON - return null; - } - } - - /** - * Start the listener service of the cloud job service. - */ - public void start() { - getCache().listenable().addListener(this, Executors.newSingleThreadExecutor()); - } - - /** - * Stop the listener service of the cloud job service. - */ - public void stop() { - getCache().listenable().removeListener(this); - } - - private CuratorCache getCache() { - CuratorCache result = (CuratorCache) regCenter.getRawCache(CloudJobConfigurationNode.ROOT); - if (null != result) { - return result; - } - regCenter.addCacheData(CloudJobConfigurationNode.ROOT); - return (CuratorCache) regCenter.getRawCache(CloudJobConfigurationNode.ROOT); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNode.java deleted file mode 100755 index 59f991d3ba..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNode.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.job; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Cloud job configuration node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class CloudJobConfigurationNode { - - public static final String ROOT = "/config/job"; - - private static final String JOB_CONFIG = ROOT + "/%s"; - - static String getRootNodePath(final String jobName) { - return String.format(JOB_CONFIG, jobName); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationService.java deleted file mode 100755 index e2a792d318..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationService.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.job; - -import com.google.common.base.Strings; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -/** - * Cloud job configuration service. - */ -@RequiredArgsConstructor -public final class CloudJobConfigurationService { - - private final CoordinatorRegistryCenter regCenter; - - /** - * Add cloud job configuration. - * - * @param cloudJobConfig cloud job configuration - */ - public void add(final CloudJobConfigurationPOJO cloudJobConfig) { - regCenter.persist( - CloudJobConfigurationNode.getRootNodePath(cloudJobConfig.getJobName()), YamlEngine.marshal(cloudJobConfig)); - } - - /** - * Update cloud job configuration. - * - * @param cloudJobConfig cloud job configuration - */ - public void update(final CloudJobConfigurationPOJO cloudJobConfig) { - regCenter.update( - CloudJobConfigurationNode.getRootNodePath(cloudJobConfig.getJobName()), YamlEngine.marshal(cloudJobConfig)); - } - - /** - * Load all registered cloud job configurations. - * - * @return collection of the registered cloud job configuration - */ - public Collection loadAll() { - if (!regCenter.isExisted(CloudJobConfigurationNode.ROOT)) { - return Collections.emptyList(); - } - List jobNames = regCenter.getChildrenKeys(CloudJobConfigurationNode.ROOT); - Collection result = new ArrayList<>(jobNames.size()); - for (String each : jobNames) { - load(each).ifPresent(result::add); - } - return result; - } - - /** - * Load cloud job configuration by job name. - * - * @param jobName job name - * @return cloud job configuration - */ - public Optional load(final String jobName) { - String configContent = regCenter.get(CloudJobConfigurationNode.getRootNodePath(jobName)); - return Strings.isNullOrEmpty(configContent) ? Optional.empty() : Optional.of(YamlEngine.unmarshal(configContent, CloudJobConfigurationPOJO.class)); - } - - /** - * Remove cloud job configuration. - * - * @param jobName job name - */ - public void remove(final String jobName) { - regCenter.remove(CloudJobConfigurationNode.getRootNodePath(jobName)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContext.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContext.java deleted file mode 100755 index b52183a490..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContext.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.context; - -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import java.util.ArrayList; -import java.util.List; - -/** - * Job running context. - */ -@RequiredArgsConstructor -@Getter -public final class JobContext { - - private final CloudJobConfiguration cloudJobConfig; - - private final List assignedShardingItems; - - private final ExecutionType type; - - /** - * Create job running context from job configuration and execution type. - * - * @param cloudJobConfig cloud job configuration - * @param type execution type - * @return Job running context - */ - public static JobContext from(final CloudJobConfiguration cloudJobConfig, final ExecutionType type) { - int shardingTotalCount = cloudJobConfig.getJobConfig().getShardingTotalCount(); - List shardingItems = new ArrayList<>(shardingTotalCount); - for (int i = 0; i < shardingTotalCount; i++) { - shardingItems.add(i); - } - return new JobContext(cloudJobConfig, shardingItems, type); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java deleted file mode 100644 index 2d5b14bd5d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AuthConfiguration.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.env; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Auth config. - */ -@RequiredArgsConstructor -@Getter -public class AuthConfiguration { - - private final String authUsername; - - private final String authPassword; - -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java deleted file mode 100755 index 81fccc9d55..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironment.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.env; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import javax.sql.DataSource; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Optional; -import java.util.Properties; - -/** - * Bootstrap env. - */ -@Slf4j -public final class BootstrapEnvironment { - - @Getter - private static final BootstrapEnvironment INSTANCE = new BootstrapEnvironment(); - - private static final String PROPERTIES_PATH = "conf/elasticjob-cloud-scheduler.properties"; - - private final Properties properties; - - private BootstrapEnvironment() { - properties = getProperties(); - } - - private Properties getProperties() { - Properties result = new Properties(); - try (InputStream fileInputStream = BootstrapEnvironment.class.getClassLoader().getResourceAsStream(PROPERTIES_PATH)) { - result.load(fileInputStream); - } catch (final IOException ex) { - log.warn("Can not load properties file from path: '{}'.", PROPERTIES_PATH); - } - setPropertiesByEnv(result); - return result; - } - - private void setPropertiesByEnv(final Properties prop) { - for (EnvironmentArgument each : EnvironmentArgument.values()) { - String key = each.getKey(); - String value = System.getenv(key); - if (!Strings.isNullOrEmpty(value)) { - log.info("Load property {} with value {} from ENV.", key, value); - prop.setProperty(each.getKey(), value); - } - } - } - - /** - * Get the host and port of the framework. - * - * @return host and port of the framework - */ - public String getFrameworkHostPort() { - return String.format("%s:%d", getMesosConfiguration().getHostname(), getRestfulServerConfiguration().getPort()); - } - - /** - * Get mesos config. - * - * @return mesos config - */ - public MesosConfiguration getMesosConfiguration() { - return new MesosConfiguration(getValue(EnvironmentArgument.USER), getValue(EnvironmentArgument.MESOS_URL), getValue(EnvironmentArgument.HOSTNAME)); - } - - /** - * Get zookeeper configuration. - * - * @return zookeeper configuration - */ - // TODO Other zkConfig values are configurable - public ZookeeperConfiguration getZookeeperConfiguration() { - ZookeeperConfiguration result = new ZookeeperConfiguration(getValue(EnvironmentArgument.ZOOKEEPER_SERVERS), getValue(EnvironmentArgument.ZOOKEEPER_NAMESPACE)); - String digest = getValue(EnvironmentArgument.ZOOKEEPER_DIGEST); - if (!Strings.isNullOrEmpty(digest)) { - result.setDigest(digest); - } - return result; - } - - /** - * Get restful server config. - * - * @return restful server config - */ - public RestfulServerConfiguration getRestfulServerConfiguration() { - return new RestfulServerConfiguration(Integer.parseInt(getValue(EnvironmentArgument.PORT))); - } - - /** - * Get framework config. - * - * @return the framework config - */ - public FrameworkConfiguration getFrameworkConfiguration() { - return new FrameworkConfiguration(Integer.parseInt(getValue(EnvironmentArgument.JOB_STATE_QUEUE_SIZE)), Integer.parseInt(getValue(EnvironmentArgument.RECONCILE_INTERVAL_MINUTES))); - } - - /** - * Get user auth config. - * - * @return the user auth config. - */ - public AuthConfiguration getUserAuthConfiguration() { - return new AuthConfiguration(getValue(EnvironmentArgument.AUTH_USERNAME), getValue(EnvironmentArgument.AUTH_PASSWORD)); - } - - /** - * Get tracing configuration. - * - * @return tracing configuration - */ - public Optional> getTracingConfiguration() { - String driver = getValue(EnvironmentArgument.EVENT_TRACE_RDB_DRIVER); - String url = getValue(EnvironmentArgument.EVENT_TRACE_RDB_URL); - String username = getValue(EnvironmentArgument.EVENT_TRACE_RDB_USERNAME); - String password = getValue(EnvironmentArgument.EVENT_TRACE_RDB_PASSWORD); - if (!Strings.isNullOrEmpty(driver) && !Strings.isNullOrEmpty(url) && !Strings.isNullOrEmpty(username)) { - BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(driver); - dataSource.setUrl(url); - dataSource.setUsername(username); - dataSource.setPassword(password); - return Optional.of(new TracingConfiguration("RDB", dataSource)); - } - return Optional.empty(); - } - - /** - * Get job event rdb config map. - * - * @return map of the rdb config - */ - // CHECKSTYLE:OFF - public HashMap getJobEventRdbConfigurationMap() { - HashMap result = new HashMap<>(4, 1); - // CHECKSTYLE:ON - result.put(EnvironmentArgument.EVENT_TRACE_RDB_DRIVER.getKey(), getValue(EnvironmentArgument.EVENT_TRACE_RDB_DRIVER)); - result.put(EnvironmentArgument.EVENT_TRACE_RDB_URL.getKey(), getValue(EnvironmentArgument.EVENT_TRACE_RDB_URL)); - result.put(EnvironmentArgument.EVENT_TRACE_RDB_USERNAME.getKey(), getValue(EnvironmentArgument.EVENT_TRACE_RDB_USERNAME)); - result.put(EnvironmentArgument.EVENT_TRACE_RDB_PASSWORD.getKey(), getValue(EnvironmentArgument.EVENT_TRACE_RDB_PASSWORD)); - return result; - } - - /** - * Get the role of the mesos. - * - * @return the role. - */ - public Optional getMesosRole() { - String role = getValue(EnvironmentArgument.MESOS_ROLE); - if (Strings.isNullOrEmpty(role)) { - return Optional.empty(); - } - return Optional.of(role); - } - - private String getValue(final EnvironmentArgument environmentArgument) { - String result = properties.getProperty(environmentArgument.getKey(), environmentArgument.getDefaultValue()); - if (environmentArgument.isRequired()) { - Preconditions.checkState(!Strings.isNullOrEmpty(result), String.format("Property `%s` is required.", environmentArgument.getKey())); - } - return result; - } - - /** - * Env args. - */ - @RequiredArgsConstructor - @Getter - public enum EnvironmentArgument { - - HOSTNAME("hostname", "localhost", true), - - MESOS_URL("mesos_url", "zk://localhost:2181/mesos", true), - - MESOS_ROLE("mesos_role", "", false), - - USER("user", "", false), - - ZOOKEEPER_SERVERS("zk_servers", "localhost:2181", true), - - ZOOKEEPER_NAMESPACE("zk_namespace", "elasticjob-cloud", true), - - ZOOKEEPER_DIGEST("zk_digest", "", false), - - PORT("http_port", "8899", true), - - JOB_STATE_QUEUE_SIZE("job_state_queue_size", "10000", true), - - EVENT_TRACE_RDB_DRIVER("event_trace_rdb_driver", "", false), - - EVENT_TRACE_RDB_URL("event_trace_rdb_url", "", false), - - EVENT_TRACE_RDB_USERNAME("event_trace_rdb_username", "", false), - - EVENT_TRACE_RDB_PASSWORD("event_trace_rdb_password", "", false), - - RECONCILE_INTERVAL_MINUTES("reconcile_interval_minutes", "-1", false), - - AUTH_USERNAME("auth_username", "root", true), - - AUTH_PASSWORD("auth_password", "pwd", true); - - private final String key; - - private final String defaultValue; - - private final boolean required; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/FrameworkConfiguration.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/FrameworkConfiguration.java deleted file mode 100755 index 635feb3914..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/FrameworkConfiguration.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.env; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Mesos framework config. - */ -@RequiredArgsConstructor -@Getter -public final class FrameworkConfiguration { - - private final int jobStateQueueSize; - - private final int reconcileIntervalMinutes; - - /** - * Check whether reconcile service is enabled or not. - * - * @return true is enabled, otherwise not - */ - public boolean isEnabledReconcile() { - return reconcileIntervalMinutes > 0; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/MesosConfiguration.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/MesosConfiguration.java deleted file mode 100755 index 06ce59612d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/MesosConfiguration.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.env; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Mesos config. - */ -@RequiredArgsConstructor -@Getter -public final class MesosConfiguration { - - /** - * Framework name. - */ - public static final String FRAMEWORK_NAME = "ElasticJob-Cloud"; - - /** - * Framework failover timeout in seconds. Default is one week. - */ - public static final double FRAMEWORK_FAILOVER_TIMEOUT_SECONDS = 60 * 60 * 24 * 7D; - - private final String user; - - private final String url; - - private final String hostname; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/RestfulServerConfiguration.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/RestfulServerConfiguration.java deleted file mode 100755 index 2e51f09ae1..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/RestfulServerConfiguration.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.env; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -/** - * Restful config. - */ -@RequiredArgsConstructor -@Getter -public final class RestfulServerConfiguration { - - private final int port; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java deleted file mode 100755 index eef4bf8f28..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/AppConfigurationException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.exception; - -/** - * Application configuration exception. - */ -public final class AppConfigurationException extends RuntimeException { - - private static final long serialVersionUID = -1466479389299512371L; - - public AppConfigurationException(final String errorMessage, final Object... args) { - super(String.format(errorMessage, args)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/HttpClientException.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/HttpClientException.java deleted file mode 100644 index a33c2582a6..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/exception/HttpClientException.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.exception; - -/** - * Http request exception. - */ -public class HttpClientException extends RuntimeException { - - private static final long serialVersionUID = 6769285134744353127L; - - public HttpClientException(final Exception cause) { - super(cause); - } - - public HttpClientException(final String errorMessage, final Object... args) { - super(String.format(errorMessage, args)); - } - - public HttpClientException(final String errorMessage, final Exception cause, final Object... args) { - super(String.format(errorMessage, args), cause); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDService.java deleted file mode 100755 index d63aa55dd4..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDService.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.ha; - -import com.google.common.base.Strings; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.Optional; - -/** - * FrameworkID service. - */ -@RequiredArgsConstructor -public final class FrameworkIDService { - - private final CoordinatorRegistryCenter regCenter; - - /** - * Fetch framework ID. - * - * @return framework ID - */ - public Optional fetch() { - String frameworkId = regCenter.getDirectly(HANode.FRAMEWORK_ID_NODE); - return Strings.isNullOrEmpty(frameworkId) ? Optional.empty() : Optional.of(frameworkId); - } - - /** - * Save framework ID. - * - * @param id framework ID - */ - public void save(final String id) { - if (!regCenter.isExisted(HANode.FRAMEWORK_ID_NODE)) { - regCenter.persist(HANode.FRAMEWORK_ID_NODE, id); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/HANode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/HANode.java deleted file mode 100755 index 789b15b795..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/HANode.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.ha; - -/** - * HA node. - */ -public final class HANode { - - /** - * HA node. - */ - public static final String ROOT = "/ha"; - - /** - * FrameworkID node. - */ - public static final String FRAMEWORK_ID_NODE = ROOT + "/framework_id"; - - /** - * Election node. - */ - public static final String ELECTION_NODE = ROOT + "/election"; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java deleted file mode 100755 index 3055df8e0c..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.ha; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.SchedulerService; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.reg.base.ElectionCandidate; - -/** - * Scheduler election candidate. - */ -public final class SchedulerElectionCandidate implements ElectionCandidate { - - private final CoordinatorRegistryCenter regCenter; - - private SchedulerService schedulerService; - - public SchedulerElectionCandidate(final CoordinatorRegistryCenter regCenter) { - this.regCenter = regCenter; - } - - @Override - public void startLeadership() { - try { - schedulerService = new SchedulerService(regCenter); - schedulerService.start(); - // CHECKSTYLE:OFF - } catch (final Throwable throwable) { - throw new JobSystemException(throwable); - } - } - - @Override - public void stopLeadership() { - schedulerService.stop(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluator.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluator.java deleted file mode 100755 index 960d9b5ae3..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluator.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.base.Preconditions; -import com.google.gson.JsonParseException; -import com.netflix.fenzo.ConstraintEvaluator; -import com.netflix.fenzo.TaskAssignmentResult; -import com.netflix.fenzo.TaskRequest; -import com.netflix.fenzo.TaskTrackerState; -import com.netflix.fenzo.VirtualMachineCurrentState; -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService.ExecutorStateInfo; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; - -/** - * App constrain evaluator. - */ -@Slf4j -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public final class AppConstraintEvaluator implements ConstraintEvaluator { - - private static AppConstraintEvaluator instance; - - private final Set runningApps = new HashSet<>(); - - private final FacadeService facadeService; - - /** - * Init. - * - * @param facadeService Mesos facade service - */ - public static void init(final FacadeService facadeService) { - instance = new AppConstraintEvaluator(facadeService); - } - - static AppConstraintEvaluator getInstance() { - return Preconditions.checkNotNull(instance); - } - - void loadAppRunningState() { - try { - for (ExecutorStateInfo each : facadeService.loadExecutorInfo()) { - runningApps.add(each.getId()); - } - } catch (final JsonParseException e) { - clearAppRunningState(); - } - } - - void clearAppRunningState() { - runningApps.clear(); - } - - @Override - public String getName() { - return "App-Fitness-Calculator"; - } - - @Override - public Result evaluate(final TaskRequest taskRequest, final VirtualMachineCurrentState targetVM, final TaskTrackerState taskTrackerState) { - double assigningCpus = 0.0d; - double assigningMemoryMB = 0.0d; - final String slaveId = targetVM.getAllCurrentOffers().iterator().next().getSlaveId().getValue(); - try { - if (isAppRunningOnSlave(taskRequest.getId(), slaveId)) { - return new Result(true, ""); - } - Set calculatedApps = new HashSet<>(); - List taskRequests = new ArrayList<>(targetVM.getTasksCurrentlyAssigned().size() + 1); - taskRequests.add(taskRequest); - for (TaskAssignmentResult each : targetVM.getTasksCurrentlyAssigned()) { - taskRequests.add(each.getRequest()); - } - for (TaskRequest each : taskRequests) { - assigningCpus += each.getCPUs(); - assigningMemoryMB += each.getMemory(); - if (isAppRunningOnSlave(each.getId(), slaveId)) { - continue; - } - CloudAppConfigurationPOJO assigningAppConfig = getAppConfiguration(each.getId()); - if (!calculatedApps.add(assigningAppConfig.getAppName())) { - continue; - } - assigningCpus += assigningAppConfig.getCpuCount(); - assigningMemoryMB += assigningAppConfig.getMemoryMB(); - } - } catch (final LackConfigException ex) { - log.warn("Lack config, disable {}", getName(), ex); - return new Result(true, ""); - } - if (assigningCpus > targetVM.getCurrAvailableResources().cpuCores()) { - log.debug("Failure {} {} cpus:{}/{}", taskRequest.getId(), slaveId, assigningCpus, targetVM.getCurrAvailableResources().cpuCores()); - return new Result(false, String.format("cpu:%s/%s", assigningCpus, targetVM.getCurrAvailableResources().cpuCores())); - } - if (assigningMemoryMB > targetVM.getCurrAvailableResources().memoryMB()) { - log.debug("Failure {} {} mem:{}/{}", taskRequest.getId(), slaveId, assigningMemoryMB, targetVM.getCurrAvailableResources().memoryMB()); - return new Result(false, String.format("mem:%s/%s", assigningMemoryMB, targetVM.getCurrAvailableResources().memoryMB())); - } - log.debug("Success {} {} cpus:{}/{} mem:{}/{}", taskRequest.getId(), slaveId, assigningCpus, targetVM.getCurrAvailableResources() - .cpuCores(), assigningMemoryMB, targetVM.getCurrAvailableResources().memoryMB()); - return new Result(true, String.format("cpus:%s/%s mem:%s/%s", assigningCpus, targetVM.getCurrAvailableResources() - .cpuCores(), assigningMemoryMB, targetVM.getCurrAvailableResources().memoryMB())); - } - - private boolean isAppRunningOnSlave(final String taskId, final String slaveId) throws LackConfigException { - TaskContext taskContext = TaskContext.from(taskId); - taskContext.setSlaveId(slaveId); - return runningApps.contains(taskContext.getExecutorId(getJobConfiguration(taskContext).getAppName())); - } - - private CloudAppConfigurationPOJO getAppConfiguration(final String taskId) throws LackConfigException { - CloudJobConfiguration cloudJobConfig = getJobConfiguration(TaskContext.from(taskId)); - Optional appConfigOptional = facadeService.loadAppConfig(cloudJobConfig.getAppName()); - if (!appConfigOptional.isPresent()) { - throw new LackConfigException("APP", cloudJobConfig.getAppName()); - } - return appConfigOptional.get(); - } - - private CloudJobConfiguration getJobConfiguration(final TaskContext taskContext) throws LackConfigException { - Optional cloudJobConfig = facadeService.load(taskContext.getMetaInfo().getJobName()); - if (!cloudJobConfig.isPresent()) { - throw new LackConfigException("JOB", taskContext.getMetaInfo().getJobName()); - } - return cloudJobConfig.get().toCloudJobConfiguration(); - } - - private static class LackConfigException extends Exception { - - private static final long serialVersionUID = -3340824363577154813L; - - LackConfigException(final String scope, final String configName) { - super(String.format("Lack %s's config %s", scope, configName)); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeService.java deleted file mode 100755 index e3f4ce5282..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeService.java +++ /dev/null @@ -1,338 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.gson.JsonParseException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService.ExecutorStateInfo; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.DisableAppService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverTaskInfo; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -/** - * Mesos facade service. - */ -@Slf4j -public final class FacadeService { - - private final CloudAppConfigurationService appConfigService; - - private final CloudJobConfigurationService jobConfigService; - - private final ReadyService readyService; - - private final RunningService runningService; - - private final FailoverService failoverService; - - private final DisableAppService disableAppService; - - private final DisableJobService disableJobService; - - private final MesosStateService mesosStateService; - - public FacadeService(final CoordinatorRegistryCenter regCenter) { - appConfigService = new CloudAppConfigurationService(regCenter); - jobConfigService = new CloudJobConfigurationService(regCenter); - readyService = new ReadyService(regCenter); - runningService = new RunningService(regCenter); - failoverService = new FailoverService(regCenter); - disableAppService = new DisableAppService(regCenter); - disableJobService = new DisableJobService(regCenter); - mesosStateService = new MesosStateService(regCenter); - } - - /** - * Start facade service. - */ - public void start() { - log.info("Elastic Job: Start facade service"); - runningService.start(); - } - - /** - * Get eligible job. - * - * @return collection of eligible job context - */ - public Collection getEligibleJobContext() { - Collection failoverJobContexts = failoverService.getAllEligibleJobContexts(); - Collection readyJobContexts = readyService.getAllEligibleJobContexts(failoverJobContexts); - Collection result = new ArrayList<>(failoverJobContexts.size() + readyJobContexts.size()); - result.addAll(failoverJobContexts); - result.addAll(readyJobContexts); - return result; - } - - /** - * Remove launched task from queue. - * - * @param taskContexts task running contexts - */ - public void removeLaunchTasksFromQueue(final List taskContexts) { - List failoverTaskContexts = new ArrayList<>(taskContexts.size()); - Collection readyJobNames = new HashSet<>(taskContexts.size(), 1); - for (TaskContext each : taskContexts) { - switch (each.getType()) { - case FAILOVER: - failoverTaskContexts.add(each); - break; - case READY: - readyJobNames.add(each.getMetaInfo().getJobName()); - break; - default: - break; - } - } - failoverService.remove(failoverTaskContexts.stream().map(TaskContext::getMetaInfo).collect(Collectors.toList())); - readyService.remove(readyJobNames); - } - - /** - * Add task to running queue. - * - * @param taskContext task running context - */ - public void addRunning(final TaskContext taskContext) { - runningService.add(taskContext); - } - - /** - * Update daemon task status. - * - * @param taskContext task running context - * @param isIdle set to idle or not - */ - public void updateDaemonStatus(final TaskContext taskContext, final boolean isIdle) { - runningService.updateIdle(taskContext, isIdle); - } - - /** - * Remove task from running queue. - * - * @param taskContext task running context - */ - public void removeRunning(final TaskContext taskContext) { - runningService.remove(taskContext); - } - - /** - * Record task to failover queue. - * - * @param taskContext task running context - */ - public void recordFailoverTask(final TaskContext taskContext) { - Optional cloudJobConfigOptional = jobConfigService.load(taskContext.getMetaInfo().getJobName()); - if (!cloudJobConfigOptional.isPresent()) { - return; - } - if (isDisable(cloudJobConfigOptional.get())) { - return; - } - CloudJobConfigurationPOJO cloudJobConfig = cloudJobConfigOptional.get(); - if (cloudJobConfig.isFailover() || CloudJobExecutionType.DAEMON == cloudJobConfig.getJobExecutionType()) { - failoverService.add(taskContext); - } - } - - private boolean isDisable(final CloudJobConfigurationPOJO cloudJobConfig) { - return disableAppService.isDisabled(cloudJobConfig.getAppName()) || disableJobService.isDisabled(cloudJobConfig.getJobName()); - } - - /** - * Add transient job to ready queue. - * - * @param jobName job name - */ - public void addTransient(final String jobName) { - readyService.addTransient(jobName); - } - - /** - * Load cloud job config. - * - * @param jobName job name - * @return cloud job config - */ - public Optional load(final String jobName) { - return jobConfigService.load(jobName); - } - - /** - * Load app config by app name. - * - * @param appName app name - * @return cloud app config - */ - public Optional loadAppConfig(final String appName) { - return appConfigService.load(appName); - } - - /** - * Get failover task id by task meta info. - * - * @param metaInfo task meta info - * @return failover task id - */ - public Optional getFailoverTaskId(final MetaInfo metaInfo) { - return failoverService.getTaskId(metaInfo); - } - - /** - * Add daemon job to ready queue. - * - * @param jobName job name - */ - public void addDaemonJobToReadyQueue(final String jobName) { - Optional cloudJobConfig = jobConfigService.load(jobName); - if (!cloudJobConfig.isPresent()) { - return; - } - if (isDisable(cloudJobConfig.get())) { - return; - } - readyService.addDaemon(jobName); - } - - /** - * Determine whether the task is running or not. - * - * @param taskContext task running context - * @return true is running, otherwise not - */ - public boolean isRunning(final TaskContext taskContext) { - return ExecutionType.FAILOVER != taskContext.getType() && !runningService.getRunningTasks(taskContext.getMetaInfo().getJobName()).isEmpty() - || ExecutionType.FAILOVER == taskContext.getType() && runningService.isTaskRunning(taskContext.getMetaInfo()); - } - - /** - * Add mapping of the task primary key and host name. - * - * @param taskId task primary key - * @param hostname host name - */ - public void addMapping(final String taskId, final String hostname) { - runningService.addMapping(taskId, hostname); - } - - /** - * Retrieve hostname and then remove task. - * - * @param taskId task primary key - * @return hostname of the removed task - */ - public String popMapping(final String taskId) { - return runningService.popMapping(taskId); - } - - /** - * Get all ready tasks. - * - * @return ready tasks - */ - public Map getAllReadyTasks() { - return readyService.getAllReadyTasks(); - } - - /** - * Get all running tasks. - * - * @return running tasks - */ - public Map> getAllRunningTasks() { - return runningService.getAllRunningTasks(); - } - - /** - * Get all failover tasks. - * - * @return failover tasks - */ - public Map> getAllFailoverTasks() { - return failoverService.getAllFailoverTasks(); - } - - /** - * Determine whether the job is disable or not. - * - * @param jobName job name - * @return true is disabled, otherwise not - */ - public boolean isJobDisabled(final String jobName) { - Optional jobConfiguration = jobConfigService.load(jobName); - return !jobConfiguration.isPresent() || disableAppService.isDisabled(jobConfiguration.get().getAppName()) || disableJobService.isDisabled(jobName); - } - - /** - * Enable job. - * - * @param jobName job name - */ - public void enableJob(final String jobName) { - disableJobService.remove(jobName); - } - - /** - * Disable job. - * - * @param jobName job name - */ - public void disableJob(final String jobName) { - disableJobService.add(jobName); - } - - /** - * Get all running executor info. - * - * @return collection of executor info - * @throws JsonParseException parse json exception - */ - public Collection loadExecutorInfo() throws JsonParseException { - return mesosStateService.executors(); - } - - /** - * Stop facade service. - */ - public void stop() { - log.info("Elastic Job: Stop facade service"); - // TODO stop scheduler - runningService.clear(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequest.java deleted file mode 100755 index 98d5b5cc91..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import com.netflix.fenzo.ConstraintEvaluator; -import com.netflix.fenzo.TaskRequest; -import com.netflix.fenzo.VMTaskFitnessCalculator; -import lombok.RequiredArgsConstructor; - -import java.util.Collections; -import java.util.List; -import java.util.Map; - -/** - * Job task request. - */ -@RequiredArgsConstructor -public final class JobTaskRequest implements TaskRequest { - - private final TaskContext taskContext; - - private final CloudJobConfiguration cloudJobConfig; - - @Override - public String getId() { - return taskContext.getId(); - } - - @Override - public String taskGroupName() { - return ""; - } - - @Override - public double getCPUs() { - return cloudJobConfig.getCpuCount(); - } - - @Override - public double getMemory() { - return cloudJobConfig.getMemoryMB(); - } - - @Override - public double getNetworkMbps() { - return 0; - } - - @Override - public double getDisk() { - return 10d; - } - - @Override - public int getPorts() { - return 1; - } - - @Override - public Map getScalarRequests() { - return null; - } - - @Override - public List getHardConstraints() { - return Collections.singletonList(AppConstraintEvaluator.getInstance()); - } - - @Override - public List getSoftConstraints() { - return null; - } - - @Override - public void setAssignedResources(final AssignedResources assignedResources) { - } - - @Override - public AssignedResources getAssignedResources() { - return null; - } - - @Override - public Map getCustomNamedResources() { - return Collections.emptyMap(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java deleted file mode 100755 index 9ba46afd84..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasks.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import com.netflix.fenzo.TaskAssignmentResult; -import com.netflix.fenzo.TaskRequest; -import com.netflix.fenzo.VMAssignmentResult; -import lombok.extern.slf4j.Slf4j; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; - -/** - * Launching tasks. - */ -@Slf4j -public final class LaunchingTasks { - - private final Map eligibleJobContextsMap; - - public LaunchingTasks(final Collection eligibleJobContexts) { - eligibleJobContextsMap = new HashMap<>(eligibleJobContexts.size(), 1); - for (JobContext each : eligibleJobContexts) { - eligibleJobContextsMap.put(each.getCloudJobConfig().getJobConfig().getJobName(), each); - } - } - - List getPendingTasks() { - List result = new ArrayList<>(eligibleJobContextsMap.size() * 10); - for (JobContext each : eligibleJobContextsMap.values()) { - result.addAll(createTaskRequests(each)); - } - return result; - } - - private Collection createTaskRequests(final JobContext jobContext) { - Collection result = new ArrayList<>(jobContext.getAssignedShardingItems().size()); - for (int each : jobContext.getAssignedShardingItems()) { - result.add(new JobTaskRequest( - new TaskContext(jobContext.getCloudJobConfig().getJobConfig().getJobName(), Collections.singletonList(each), jobContext.getType()), jobContext.getCloudJobConfig())); - } - return result; - } - - Collection getIntegrityViolationJobs(final Collection vmAssignmentResults) { - Map assignedJobShardingTotalCountMap = getAssignedJobShardingTotalCountMap(vmAssignmentResults); - Collection result = new HashSet<>(assignedJobShardingTotalCountMap.size(), 1); - for (Map.Entry entry : assignedJobShardingTotalCountMap.entrySet()) { - JobContext jobContext = eligibleJobContextsMap.get(entry.getKey()); - if (ExecutionType.FAILOVER != jobContext.getType() && !entry.getValue().equals(jobContext.getCloudJobConfig().getJobConfig().getShardingTotalCount())) { - log.warn("Job {} is not assigned at this time, because resources not enough to run all sharding instances.", entry.getKey()); - result.add(entry.getKey()); - } - } - return result; - } - - private Map getAssignedJobShardingTotalCountMap(final Collection vmAssignmentResults) { - Map result = new HashMap<>(eligibleJobContextsMap.size(), 1); - for (VMAssignmentResult vmAssignmentResult : vmAssignmentResults) { - for (TaskAssignmentResult tasksAssigned : vmAssignmentResult.getTasksAssigned()) { - String jobName = TaskContext.from(tasksAssigned.getTaskId()).getMetaInfo().getJobName(); - if (result.containsKey(jobName)) { - result.put(jobName, result.get(jobName) + 1); - } else { - result.put(jobName, 1); - } - } - } - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueue.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueue.java deleted file mode 100755 index 3f0e63a8ba..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueue.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.netflix.fenzo.VirtualMachineLease; -import com.netflix.fenzo.plugins.VMLeaseObject; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.mesos.Protos; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; - -/** - * Lease queue. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class LeasesQueue { - - private static final LeasesQueue INSTANCE = new LeasesQueue(); - - private final BlockingQueue queue = new LinkedBlockingQueue<>(); - - /** - * Get instance. - * - * @return singleton instance - */ - public static LeasesQueue getInstance() { - return INSTANCE; - } - - /** - * Offer resource to lease queue. - * - * @param offer resource - */ - public void offer(final Protos.Offer offer) { - queue.offer(new VMLeaseObject(offer)); - } - - /** - * Dump all the resources from lease queue. - * - * @return collection of resources - */ - public List drainTo() { - List result = new ArrayList<>(queue.size()); - queue.drainTo(result); - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateService.java deleted file mode 100755 index 32c953adb7..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateService.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; -import lombok.Builder; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.FrameworkIDService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.util.HttpClientUtils; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -/** - * Mesos state service. - */ -@Slf4j -public class MesosStateService { - - private static String stateUrl; - - private final FrameworkIDService frameworkIDService; - - public MesosStateService(final CoordinatorRegistryCenter regCenter) { - frameworkIDService = new FrameworkIDService(regCenter); - } - - /** - * Register master info of Mesos. - * - * @param hostName hostname of master - * @param port port of master - */ - public static synchronized void register(final String hostName, final int port) { - stateUrl = String.format("http://%s:%d/state", hostName, port); - } - - /** - * Deregister master info of Mesos. - */ - public static synchronized void deregister() { - stateUrl = null; - } - - /** - * Get sandbox info. - * - * @param appName app name - * @return sandbox info in json format - * @throws JsonParseException parse json exception - */ - public Collection> sandbox(final String appName) throws JsonParseException { - JsonObject state = fetch(stateUrl); - List> result = new ArrayList<>(); - for (JsonObject each : findExecutors(state.getAsJsonArray("frameworks"), appName)) { - JsonArray slaves = state.get("slaves").getAsJsonArray(); - String slaveHost = null; - for (int i = 0; i < slaves.size(); i++) { - JsonObject slave = slaves.get(i).getAsJsonObject(); - if (each.get("slave_id").getAsString().equals(slave.get("id").getAsString())) { - slaveHost = slave.get("pid").getAsString().split("@")[1]; - } - } - Preconditions.checkNotNull(slaveHost); - JsonObject slaveState = fetch(String.format("http://%s/state", slaveHost)); - String workDir = slaveState.get("flags").getAsJsonObject().get("work_dir").getAsString(); - Collection executorsOnSlave = findExecutors(slaveState.get("frameworks").getAsJsonArray(), appName); - for (JsonObject executorOnSlave : executorsOnSlave) { - Map r = new LinkedHashMap<>(); - r.put("hostname", slaveState.get("hostname").getAsString()); - r.put("path", executorOnSlave.get("directory").getAsString().replace(workDir, "")); - result.add(r); - } - } - return result; - } - - /** - * Get executor by app name. - * - * @param appName app name - * @return executor state info - * @throws JsonParseException parse json exception - */ - public Collection executors(final String appName) throws JsonParseException { - return findExecutors(fetch(stateUrl).get("frameworks").getAsJsonArray(), appName).stream().map(each -> { - try { - return ExecutorStateInfo.builder().id(getExecutorId(each)).slaveId(each.get("slave_id").getAsString()).build(); - } catch (final JsonParseException ex) { - throw new RuntimeException(ex); - } - }).collect(Collectors.toList()); - } - - /** - * Get all executors. - * - * @return collection of executor state info - * @throws JsonParseException parse json exception - */ - public Collection executors() throws JsonParseException { - return executors(null); - } - - private JsonObject fetch(final String url) { - Preconditions.checkState(!Strings.isNullOrEmpty(url)); - return GsonFactory.getJsonParser().parse(HttpClientUtils.httpGet(url).getContent()).getAsJsonObject(); - } - - private Collection findExecutors(final JsonArray frameworks, final String appName) throws JsonParseException { - Optional frameworkIDOptional = frameworkIDService.fetch(); - String frameworkID; - if (frameworkIDOptional.isPresent()) { - frameworkID = frameworkIDOptional.get(); - } else { - return Collections.emptyList(); - } - List result = new LinkedList<>(); - for (int i = 0; i < frameworks.size(); i++) { - JsonObject framework = frameworks.get(i).getAsJsonObject(); - if (!framework.get("id").getAsString().equals(frameworkID)) { - continue; - } - JsonArray executors = framework.get("executors").getAsJsonArray(); - for (int j = 0; j < executors.size(); j++) { - JsonObject executor = executors.get(j).getAsJsonObject(); - if (null == appName || appName.equals(getExecutorId(executor).split("@-@")[0])) { - result.add(executor); - } - } - } - return result; - } - - private String getExecutorId(final JsonObject executor) throws JsonParseException { - return executor.has("id") ? executor.get("id").getAsString() : executor.get("executor_id").getAsString(); - } - - @Builder - @Getter - public static final class ExecutorStateInfo { - - private final String id; - - private final String slaveId; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java deleted file mode 100755 index ce755deab1..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileService.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.util.concurrent.AbstractScheduledService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.mesos.Protos; -import org.apache.mesos.Protos.TaskStatus; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.FrameworkConfiguration; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.ReentrantLock; -import java.util.stream.Collectors; - -/** - * Reconcile service. - */ -@RequiredArgsConstructor -@Slf4j -public class ReconcileService extends AbstractScheduledService { - - private final SchedulerDriver schedulerDriver; - - private final FacadeService facadeService; - - private final ReentrantLock lock = new ReentrantLock(); - - @Override - protected void runOneIteration() { - lock.lock(); - try { - explicitReconcile(); - implicitReconcile(); - } finally { - lock.unlock(); - } - } - - /** - * Explicit reconcile service. - */ - public void explicitReconcile() { - lock.lock(); - try { - Set runningTask = new HashSet<>(); - for (Set each : facadeService.getAllRunningTasks().values()) { - runningTask.addAll(each); - } - if (runningTask.isEmpty()) { - return; - } - log.info("Requesting {} tasks reconciliation with the Mesos master", runningTask.size()); - schedulerDriver.reconcileTasks(runningTask.stream().map(each -> TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(each.getId()).build()) - .setSlaveId(Protos.SlaveID.newBuilder().setValue(each.getSlaveId()).build()) - .setState(Protos.TaskState.TASK_RUNNING).build()).collect(Collectors.toList())); - } finally { - lock.unlock(); - } - } - - /** - * Implicit reconcile service. - */ - public void implicitReconcile() { - lock.lock(); - try { - schedulerDriver.reconcileTasks(Collections.emptyList()); - } finally { - lock.unlock(); - } - } - - @Override - protected Scheduler scheduler() { - FrameworkConfiguration configuration = BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration(); - return Scheduler.newFixedDelaySchedule(configuration.getReconcileIntervalMinutes(), configuration.getReconcileIntervalMinutes(), TimeUnit.MINUTES); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java deleted file mode 100755 index 0b2b346c2d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngine.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.netflix.fenzo.TaskScheduler; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.mesos.Protos; -import org.apache.mesos.Scheduler; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.FrameworkIDService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; - -import java.util.List; - -/** - * Scheduler engine. - */ -@RequiredArgsConstructor -@Slf4j -public final class SchedulerEngine implements Scheduler { - - private final TaskScheduler taskScheduler; - - private final FacadeService facadeService; - - private final JobTracingEventBus jobTracingEventBus; - - private final FrameworkIDService frameworkIDService; - - private final StatisticManager statisticManager; - - @Override - public void registered(final SchedulerDriver schedulerDriver, final Protos.FrameworkID frameworkID, final Protos.MasterInfo masterInfo) { - log.info("call registered"); - frameworkIDService.save(frameworkID.getValue()); - taskScheduler.expireAllLeases(); - MesosStateService.register(masterInfo.getHostname(), masterInfo.getPort()); - } - - @Override - public void reregistered(final SchedulerDriver schedulerDriver, final Protos.MasterInfo masterInfo) { - log.info("call reregistered"); - taskScheduler.expireAllLeases(); - MesosStateService.register(masterInfo.getHostname(), masterInfo.getPort()); - } - - @Override - public void resourceOffers(final SchedulerDriver schedulerDriver, final List offers) { - for (Protos.Offer offer : offers) { - log.trace("Adding offer {} from host {}", offer.getId(), offer.getHostname()); - LeasesQueue.getInstance().offer(offer); - } - } - - @Override - public void offerRescinded(final SchedulerDriver schedulerDriver, final Protos.OfferID offerID) { - log.trace("call offerRescinded: {}", offerID); - taskScheduler.expireLease(offerID.getValue()); - } - - @Override - public void statusUpdate(final SchedulerDriver schedulerDriver, final Protos.TaskStatus taskStatus) { - String taskId = taskStatus.getTaskId().getValue(); - TaskContext taskContext = TaskContext.from(taskId); - String jobName = taskContext.getMetaInfo().getJobName(); - log.trace("call statusUpdate task state is: {}, task id is: {}", taskStatus.getState(), taskId); - jobTracingEventBus.post(new JobStatusTraceEvent(jobName, taskContext.getId(), taskContext.getSlaveId(), JobStatusTraceEvent.Source.CLOUD_SCHEDULER, taskContext.getType().toString(), - String.valueOf(taskContext.getMetaInfo().getShardingItems()), JobStatusTraceEvent.State.valueOf(taskStatus.getState().name()), taskStatus.getMessage())); - switch (taskStatus.getState()) { - case TASK_RUNNING: - if (!facadeService.load(jobName).isPresent()) { - schedulerDriver.killTask(Protos.TaskID.newBuilder().setValue(taskId).build()); - } - if ("BEGIN".equals(taskStatus.getMessage())) { - facadeService.updateDaemonStatus(taskContext, false); - } else if ("COMPLETE".equals(taskStatus.getMessage())) { - facadeService.updateDaemonStatus(taskContext, true); - statisticManager.taskRunSuccessfully(); - } - break; - case TASK_FINISHED: - facadeService.removeRunning(taskContext); - unAssignTask(taskId); - statisticManager.taskRunSuccessfully(); - break; - case TASK_KILLED: - log.warn("task id is: {}, status is: {}, message is: {}, source is: {}", taskId, taskStatus.getState(), taskStatus.getMessage(), taskStatus.getSource()); - facadeService.removeRunning(taskContext); - facadeService.addDaemonJobToReadyQueue(jobName); - unAssignTask(taskId); - break; - case TASK_LOST: - case TASK_DROPPED: - case TASK_GONE: - case TASK_GONE_BY_OPERATOR: - case TASK_FAILED: - case TASK_ERROR: - log.warn("task id is: {}, status is: {}, message is: {}, source is: {}", taskId, taskStatus.getState(), taskStatus.getMessage(), taskStatus.getSource()); - facadeService.removeRunning(taskContext); - facadeService.recordFailoverTask(taskContext); - unAssignTask(taskId); - statisticManager.taskRunFailed(); - break; - case TASK_UNKNOWN: - case TASK_UNREACHABLE: - log.error("task id is: {}, status is: {}, message is: {}, source is: {}", taskId, taskStatus.getState(), taskStatus.getMessage(), taskStatus.getSource()); - statisticManager.taskRunFailed(); - break; - default: - break; - } - } - - private void unAssignTask(final String taskId) { - String hostname = facadeService.popMapping(taskId); - if (null != hostname) { - taskScheduler.getTaskUnAssigner().call(TaskContext.getIdForUnassignedSlave(taskId), hostname); - } - } - - @Override - public void frameworkMessage(final SchedulerDriver schedulerDriver, final Protos.ExecutorID executorID, final Protos.SlaveID slaveID, final byte[] bytes) { - log.trace("call frameworkMessage slaveID: {}, bytes: {}", slaveID, new String(bytes)); - } - - @Override - public void disconnected(final SchedulerDriver schedulerDriver) { - log.warn("call disconnected"); - MesosStateService.deregister(); - } - - @Override - public void slaveLost(final SchedulerDriver schedulerDriver, final Protos.SlaveID slaveID) { - log.warn("call slaveLost slaveID is: {}", slaveID); - taskScheduler.expireAllLeasesByVMId(slaveID.getValue()); - } - - @Override - public void executorLost(final SchedulerDriver schedulerDriver, final Protos.ExecutorID executorID, final Protos.SlaveID slaveID, final int i) { - log.warn("call executorLost slaveID is: {}, executorID is: {}", slaveID, executorID); - } - - @Override - public void error(final SchedulerDriver schedulerDriver, final String message) { - log.error("call error, message is: {}", message); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerService.java deleted file mode 100755 index c12a22bb6e..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerService.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.util.concurrent.Service; -import com.netflix.fenzo.TaskScheduler; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.mesos.MesosSchedulerDriver; -import org.apache.mesos.Protos; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.console.ConsoleBootstrap; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.MesosConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.FrameworkIDService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.CloudAppDisableListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.CloudJobDisableListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; - -import java.util.Optional; - -/** - * Scheduler service. - */ -@Slf4j -@AllArgsConstructor -public final class SchedulerService { - - private static final String WEB_UI_PROTOCOL = "http://"; - - private final BootstrapEnvironment env; - - private final FacadeService facadeService; - - private final SchedulerDriver schedulerDriver; - - private final ProducerManager producerManager; - - private final StatisticManager statisticManager; - - private final CloudJobConfigurationListener cloudJobConfigurationListener; - - private final Service taskLaunchScheduledService; - - private final ConsoleBootstrap consoleBootstrap; - - private final ReconcileService reconcileService; - - private final CloudJobDisableListener cloudJobDisableListener; - - private final CloudAppConfigurationListener cloudAppConfigurationListener; - - private final CloudAppDisableListener cloudAppDisableListener; - - public SchedulerService(final CoordinatorRegistryCenter regCenter) { - env = BootstrapEnvironment.getINSTANCE(); - facadeService = new FacadeService(regCenter); - statisticManager = StatisticManager.getInstance(regCenter, env.getTracingConfiguration().orElse(null)); - TaskScheduler taskScheduler = getTaskScheduler(); - JobTracingEventBus jobTracingEventBus = getJobTracingEventBus(); - schedulerDriver = getSchedulerDriver(taskScheduler, jobTracingEventBus, new FrameworkIDService(regCenter)); - producerManager = new ProducerManager(schedulerDriver, regCenter); - cloudJobConfigurationListener = new CloudJobConfigurationListener(regCenter, producerManager); - cloudJobDisableListener = new CloudJobDisableListener(regCenter, producerManager); - cloudAppConfigurationListener = new CloudAppConfigurationListener(regCenter, producerManager); - cloudAppDisableListener = new CloudAppDisableListener(regCenter, producerManager); - taskLaunchScheduledService = new TaskLaunchScheduledService(schedulerDriver, taskScheduler, facadeService, jobTracingEventBus); - reconcileService = new ReconcileService(schedulerDriver, facadeService); - consoleBootstrap = new ConsoleBootstrap(regCenter, env.getRestfulServerConfiguration(), producerManager, reconcileService); - } - - private SchedulerDriver getSchedulerDriver(final TaskScheduler taskScheduler, final JobTracingEventBus jobTracingEventBus, final FrameworkIDService frameworkIDService) { - Protos.FrameworkInfo.Builder builder = Protos.FrameworkInfo.newBuilder(); - frameworkIDService.fetch().ifPresent(frameworkID -> builder.setId(Protos.FrameworkID.newBuilder().setValue(frameworkID).build())); - Optional role = env.getMesosRole(); - String frameworkName = MesosConfiguration.FRAMEWORK_NAME; - if (role.isPresent()) { - builder.setRole(role.get()); - frameworkName += "-" + role.get(); - } - builder.addCapabilitiesBuilder().setType(Protos.FrameworkInfo.Capability.Type.PARTITION_AWARE); - MesosConfiguration mesosConfig = env.getMesosConfiguration(); - Protos.FrameworkInfo frameworkInfo = builder.setUser(mesosConfig.getUser()).setName(frameworkName) - .setHostname(mesosConfig.getHostname()).setFailoverTimeout(MesosConfiguration.FRAMEWORK_FAILOVER_TIMEOUT_SECONDS) - .setWebuiUrl(WEB_UI_PROTOCOL + env.getFrameworkHostPort()).setCheckpoint(true).build(); - return new MesosSchedulerDriver(new SchedulerEngine(taskScheduler, facadeService, jobTracingEventBus, frameworkIDService, statisticManager), frameworkInfo, mesosConfig.getUrl()); - } - - private TaskScheduler getTaskScheduler() { - return new TaskScheduler.Builder() - .withLeaseOfferExpirySecs(1000000000L) - .withLeaseRejectAction(lease -> { - log.warn("Declining offer on '{}'", lease.hostname()); - schedulerDriver.declineOffer(lease.getOffer().getId()); - }).build(); - } - - private JobTracingEventBus getJobTracingEventBus() { - Optional> tracingConfiguration = env.getTracingConfiguration(); - return tracingConfiguration.map(JobTracingEventBus::new).orElseGet(JobTracingEventBus::new); - } - - /** - * Start as a daemon. - */ - public void start() { - facadeService.start(); - producerManager.startup(); - statisticManager.startup(); - cloudJobConfigurationListener.start(); - cloudAppConfigurationListener.start(); - cloudJobDisableListener.start(); - cloudAppDisableListener.start(); - taskLaunchScheduledService.startAsync(); - consoleBootstrap.start(); - schedulerDriver.start(); - if (env.getFrameworkConfiguration().isEnabledReconcile()) { - reconcileService.startAsync(); - } - } - - /** - * Stop. - */ - public void stop() { - consoleBootstrap.stop(); - taskLaunchScheduledService.stopAsync(); - cloudJobConfigurationListener.stop(); - cloudAppConfigurationListener.stop(); - cloudJobDisableListener.stop(); - cloudAppDisableListener.stop(); - statisticManager.shutdown(); - producerManager.shutdown(); - schedulerDriver.stop(true); - facadeService.stop(); - if (env.getFrameworkConfiguration().isEnabledReconcile()) { - reconcileService.stopAsync(); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionType.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionType.java deleted file mode 100755 index edbca330f3..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionType.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import lombok.NoArgsConstructor; - -import java.util.HashSet; -import java.util.Set; - -/** - * Extraction type. - */ -@NoArgsConstructor -public final class SupportedExtractionType { - - private static final Set EXTRACTION_TYPES = new HashSet<>(9, 1); - - static { - EXTRACTION_TYPES.add(".tar"); - EXTRACTION_TYPES.add(".tar.gz"); - EXTRACTION_TYPES.add(".tar.bz2"); - EXTRACTION_TYPES.add(".tar.xz"); - EXTRACTION_TYPES.add(".gz"); - EXTRACTION_TYPES.add(".tgz"); - EXTRACTION_TYPES.add(".tbz2"); - EXTRACTION_TYPES.add(".txz"); - EXTRACTION_TYPES.add(".zip"); - } - - /** - * Check whether the url is supported to extract or not. - * - * @param appURL app url - * @return true is the url supported, otherwise not - */ - public static boolean isExtraction(final String appURL) { - for (String each : EXTRACTION_TYPES) { - if (appURL.endsWith(each)) { - return true; - } - } - return false; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoData.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoData.java deleted file mode 100755 index b8f2626d90..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoData.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import lombok.RequiredArgsConstructor; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Task info data. - */ -@RequiredArgsConstructor -public final class TaskInfoData { - - private final ShardingContexts shardingContexts; - - private final CloudJobConfiguration cloudJobConfig; - - /** - * Serialize. - * - * @return byte array - */ - public byte[] serialize() { - Map result = new LinkedHashMap<>(2, 1); - result.put("shardingContext", shardingContexts); - result.put("jobConfigContext", YamlEngine.marshal(JobConfigurationPOJO.fromJobConfiguration(cloudJobConfig.getJobConfig()))); - return SerializationUtils.serialize((LinkedHashMap) result); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java deleted file mode 100755 index dc5014cea3..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledService.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.util.concurrent.AbstractScheduledService; -import com.google.protobuf.ByteString; -import com.netflix.fenzo.TaskAssignmentResult; -import com.netflix.fenzo.TaskRequest; -import com.netflix.fenzo.TaskScheduler; -import com.netflix.fenzo.VMAssignmentResult; -import com.netflix.fenzo.VirtualMachineLease; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.exec.CommandLine; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.mesos.Protos; -import org.apache.mesos.Protos.OfferID; -import org.apache.mesos.Protos.TaskInfo; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.ShardingItemParameters; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.concurrent.TimeUnit; - -/** - * Task launch schedule service. - */ -@RequiredArgsConstructor -@Slf4j -public final class TaskLaunchScheduledService extends AbstractScheduledService { - - private final SchedulerDriver schedulerDriver; - - private final TaskScheduler taskScheduler; - - private final FacadeService facadeService; - - private final JobTracingEventBus jobTracingEventBus; - - private final BootstrapEnvironment env = BootstrapEnvironment.getINSTANCE(); - - @Override - protected String serviceName() { - return "task-launch-processor"; - } - - @Override - protected Scheduler scheduler() { - return Scheduler.newFixedDelaySchedule(2, 10, TimeUnit.SECONDS); - } - - @Override - protected void startUp() { - log.info("Elastic Job: Start {}", serviceName()); - AppConstraintEvaluator.init(facadeService); - } - - @Override - protected void shutDown() { - log.info("Elastic Job: Stop {}", serviceName()); - } - - @Override - protected void runOneIteration() { - try { - LaunchingTasks launchingTasks = new LaunchingTasks(facadeService.getEligibleJobContext()); - List taskRequests = launchingTasks.getPendingTasks(); - if (!taskRequests.isEmpty()) { - AppConstraintEvaluator.getInstance().loadAppRunningState(); - } - Collection vmAssignmentResults = taskScheduler.scheduleOnce(taskRequests, LeasesQueue.getInstance().drainTo()).getResultMap().values(); - List taskContextsList = new LinkedList<>(); - Map, List> offerIdTaskInfoMap = new HashMap<>(); - for (VMAssignmentResult each : vmAssignmentResults) { - List leasesUsed = each.getLeasesUsed(); - List taskInfoList = new ArrayList<>(each.getTasksAssigned().size() * 10); - taskInfoList.addAll(getTaskInfoList(launchingTasks.getIntegrityViolationJobs(vmAssignmentResults), each, leasesUsed.get(0).hostname(), leasesUsed.get(0).getOffer())); - for (Protos.TaskInfo taskInfo : taskInfoList) { - taskContextsList.add(TaskContext.from(taskInfo.getTaskId().getValue())); - } - offerIdTaskInfoMap.put(getOfferIDs(leasesUsed), taskInfoList); - } - for (TaskContext each : taskContextsList) { - facadeService.addRunning(each); - jobTracingEventBus.post(createJobStatusTraceEvent(each)); - } - facadeService.removeLaunchTasksFromQueue(taskContextsList); - for (Entry, List> each : offerIdTaskInfoMap.entrySet()) { - schedulerDriver.launchTasks(each.getKey(), each.getValue()); - } - // CHECKSTYLE:OFF - } catch (Throwable throwable) { - // CHECKSTYLE:ON - log.error("Launch task error", throwable); - } finally { - AppConstraintEvaluator.getInstance().clearAppRunningState(); - } - } - - private List getTaskInfoList(final Collection integrityViolationJobs, final VMAssignmentResult vmAssignmentResult, final String hostname, final Protos.Offer offer) { - List result = new ArrayList<>(vmAssignmentResult.getTasksAssigned().size()); - for (TaskAssignmentResult each : vmAssignmentResult.getTasksAssigned()) { - TaskContext taskContext = TaskContext.from(each.getTaskId()); - String jobName = taskContext.getMetaInfo().getJobName(); - if (!integrityViolationJobs.contains(jobName) && !facadeService.isRunning(taskContext) && !facadeService.isJobDisabled(jobName)) { - Protos.TaskInfo taskInfo = getTaskInfo(offer, each); - if (null != taskInfo) { - result.add(taskInfo); - facadeService.addMapping(taskInfo.getTaskId().getValue(), hostname); - taskScheduler.getTaskAssigner().call(each.getRequest(), hostname); - } - } - } - return result; - } - - private Protos.TaskInfo getTaskInfo(final Protos.Offer offer, final TaskAssignmentResult taskAssignmentResult) { - TaskContext taskContext = TaskContext.from(taskAssignmentResult.getTaskId()); - Optional cloudJobConfig = facadeService.load(taskContext.getMetaInfo().getJobName()); - if (!cloudJobConfig.isPresent()) { - return null; - } - Optional appConfig = facadeService.loadAppConfig(cloudJobConfig.get().getAppName()); - if (!appConfig.isPresent()) { - return null; - } - taskContext.setSlaveId(offer.getSlaveId().getValue()); - ShardingContexts shardingContexts = getShardingContexts(taskContext, appConfig.get(), cloudJobConfig.get().toCloudJobConfiguration()); - boolean isCommandExecutor = CloudJobExecutionType.TRANSIENT == cloudJobConfig.get().getJobExecutionType() - && cloudJobConfig.get().getProps().contains(ScriptJobProperties.SCRIPT_KEY); - String script = appConfig.get().getBootstrapScript(); - if (isCommandExecutor) { - script = cloudJobConfig.get().getProps().getProperty(ScriptJobProperties.SCRIPT_KEY); - } - Protos.CommandInfo.URI uri = buildURI(appConfig.get(), isCommandExecutor); - Protos.CommandInfo command = buildCommand(uri, script, shardingContexts, isCommandExecutor); - if (isCommandExecutor) { - return buildCommandExecutorTaskInfo(taskContext, cloudJobConfig.get().toCloudJobConfiguration(), shardingContexts, offer, command); - } else { - return buildCustomizedExecutorTaskInfo(taskContext, appConfig.get(), cloudJobConfig.get().toCloudJobConfiguration(), shardingContexts, offer, command); - } - } - - private ShardingContexts getShardingContexts(final TaskContext taskContext, final CloudAppConfigurationPOJO appConfig, final CloudJobConfiguration cloudJobConfig) { - Map shardingItemParameters = new ShardingItemParameters(cloudJobConfig.getJobConfig().getShardingItemParameters()).getMap(); - Map assignedShardingItemParameters = new HashMap<>(1, 1); - int shardingItem = taskContext.getMetaInfo().getShardingItems().get(0); - assignedShardingItemParameters.put(shardingItem, shardingItemParameters.getOrDefault(shardingItem, "")); - return new ShardingContexts(taskContext.getId(), cloudJobConfig.getJobConfig().getJobName(), cloudJobConfig.getJobConfig().getShardingTotalCount(), - cloudJobConfig.getJobConfig().getJobParameter(), assignedShardingItemParameters, appConfig.getEventTraceSamplingCount()); - } - - private Protos.TaskInfo buildCommandExecutorTaskInfo(final TaskContext taskContext, final CloudJobConfiguration cloudJobConfig, final ShardingContexts shardingContexts, - final Protos.Offer offer, final Protos.CommandInfo command) { - Protos.TaskInfo.Builder result = Protos.TaskInfo.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskContext.getId()).build()) - .setName(taskContext.getTaskName()).setSlaveId(offer.getSlaveId()) - .addResources(buildResource("cpus", cloudJobConfig.getCpuCount(), offer.getResourcesList())) - .addResources(buildResource("mem", cloudJobConfig.getMemoryMB(), offer.getResourcesList())) - .setData(ByteString.copyFrom(new TaskInfoData(shardingContexts, cloudJobConfig).serialize())); - return result.setCommand(command).build(); - } - - private Protos.TaskInfo buildCustomizedExecutorTaskInfo(final TaskContext taskContext, final CloudAppConfigurationPOJO appConfig, final CloudJobConfiguration cloudJobConfig, - final ShardingContexts shardingContexts, final Protos.Offer offer, final Protos.CommandInfo command) { - Protos.TaskInfo.Builder result = Protos.TaskInfo.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskContext.getId()).build()) - .setName(taskContext.getTaskName()).setSlaveId(offer.getSlaveId()) - .addResources(buildResource("cpus", cloudJobConfig.getCpuCount(), offer.getResourcesList())) - .addResources(buildResource("mem", cloudJobConfig.getMemoryMB(), offer.getResourcesList())) - .setData(ByteString.copyFrom(new TaskInfoData(shardingContexts, cloudJobConfig).serialize())); - Protos.ExecutorInfo.Builder executorBuilder = Protos.ExecutorInfo.newBuilder().setExecutorId(Protos.ExecutorID.newBuilder() - .setValue(taskContext.getExecutorId(cloudJobConfig.getAppName()))).setCommand(command) - .addResources(buildResource("cpus", appConfig.getCpuCount(), offer.getResourcesList())) - .addResources(buildResource("mem", appConfig.getMemoryMB(), offer.getResourcesList())); - if (env.getTracingConfiguration().isPresent()) { - executorBuilder.setData(ByteString.copyFrom(SerializationUtils.serialize(env.getJobEventRdbConfigurationMap()))).build(); - } - return result.setExecutor(executorBuilder.build()).build(); - } - - private Protos.CommandInfo.URI buildURI(final CloudAppConfigurationPOJO appConfig, final boolean isCommandExecutor) { - Protos.CommandInfo.URI.Builder result = Protos.CommandInfo.URI.newBuilder().setValue(appConfig.getAppURL()).setCache(appConfig.isAppCacheEnable()); - if (isCommandExecutor && !SupportedExtractionType.isExtraction(appConfig.getAppURL())) { - result.setExecutable(true); - } else { - result.setExtract(true); - } - return result.build(); - } - - private Protos.CommandInfo buildCommand(final Protos.CommandInfo.URI uri, final String script, final ShardingContexts shardingContexts, final boolean isCommandExecutor) { - Protos.CommandInfo.Builder result = Protos.CommandInfo.newBuilder().addUris(uri).setShell(true); - if (isCommandExecutor) { - CommandLine commandLine = CommandLine.parse(script); - commandLine.addArgument(GsonFactory.getGson().toJson(shardingContexts), false); - result.setValue(String.join("-", commandLine.getExecutable(), getArguments(commandLine))); - } else { - result.setValue(script); - } - return result.build(); - } - - private String getArguments(final CommandLine commandLine) { - return String.join(" ", commandLine.getArguments()); - } - - private Protos.Resource buildResource(final String type, final double resourceValue, final List resources) { - return Protos.Resource.newBuilder().mergeFrom( - resources.stream().filter(input -> input.getName().equals(type)).findFirst().get()).setScalar(Protos.Value.Scalar.newBuilder().setValue(resourceValue)).build(); - } - - private JobStatusTraceEvent createJobStatusTraceEvent(final TaskContext taskContext) { - MetaInfo metaInfo = taskContext.getMetaInfo(); - JobStatusTraceEvent result = new JobStatusTraceEvent(metaInfo.getJobName(), taskContext.getId(), taskContext.getSlaveId(), - Source.CLOUD_SCHEDULER, taskContext.getType().toString(), String.valueOf(metaInfo.getShardingItems()), JobStatusTraceEvent.State.TASK_STAGING, ""); - if (ExecutionType.FAILOVER == taskContext.getType()) { - Optional taskContextOptional = facadeService.getFailoverTaskId(metaInfo); - taskContextOptional.ifPresent(result::setOriginalTaskId); - } - return result; - } - - private List getOfferIDs(final List leasesUsed) { - List result = new ArrayList<>(); - for (VirtualMachineLease virtualMachineLease : leasesUsed) { - result.add(virtualMachineLease.getOffer().getId()); - } - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java deleted file mode 100755 index 2643fbb4ea..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.producer; - -import lombok.extern.slf4j.Slf4j; -import org.apache.mesos.Protos; -import org.apache.mesos.Protos.ExecutorID; -import org.apache.mesos.Protos.SlaveID; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.exception.AppConfigurationException; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.DisableAppService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.Collections; -import java.util.Optional; - -/** - * Producer manager. - */ -@Slf4j -public final class ProducerManager { - - private final CloudAppConfigurationService appConfigService; - - private final CloudJobConfigurationService configService; - - private final ReadyService readyService; - - private final RunningService runningService; - - private final DisableAppService disableAppService; - - private final DisableJobService disableJobService; - - private final TransientProducerScheduler transientProducerScheduler; - - private final SchedulerDriver schedulerDriver; - - public ProducerManager(final SchedulerDriver schedulerDriver, final CoordinatorRegistryCenter regCenter) { - this.schedulerDriver = schedulerDriver; - appConfigService = new CloudAppConfigurationService(regCenter); - configService = new CloudJobConfigurationService(regCenter); - readyService = new ReadyService(regCenter); - runningService = new RunningService(regCenter); - disableAppService = new DisableAppService(regCenter); - disableJobService = new DisableJobService(regCenter); - transientProducerScheduler = new TransientProducerScheduler(readyService); - } - - /** - * Start the producer manager. - */ - public void startup() { - log.info("Start producer manager"); - transientProducerScheduler.start(); - for (CloudJobConfigurationPOJO each : configService.loadAll()) { - schedule(each); - } - } - - /** - * Register the job. - * - * @param cloudJobConfig cloud job configuration - */ - public void register(final CloudJobConfigurationPOJO cloudJobConfig) { - if (disableJobService.isDisabled(cloudJobConfig.getJobName())) { - throw new JobConfigurationException("Job '%s' has been disable.", cloudJobConfig.getJobName()); - } - Optional appConfigFromZk = appConfigService.load(cloudJobConfig.getAppName()); - if (!appConfigFromZk.isPresent()) { - throw new AppConfigurationException("Register app '%s' firstly.", cloudJobConfig.getAppName()); - } - Optional jobConfigFromZk = configService.load(cloudJobConfig.getJobName()); - if (jobConfigFromZk.isPresent()) { - throw new JobConfigurationException("Job '%s' already existed.", cloudJobConfig.getJobName()); - } - configService.add(cloudJobConfig); - schedule(cloudJobConfig); - } - - /** - * Update the job. - * - * @param cloudJobConfig cloud job configuration - */ - public void update(final CloudJobConfigurationPOJO cloudJobConfig) { - Optional jobConfigFromZk = configService.load(cloudJobConfig.getJobName()); - if (!jobConfigFromZk.isPresent()) { - throw new JobConfigurationException("Cannot found job '%s', please register first.", cloudJobConfig.getJobName()); - } - configService.update(cloudJobConfig); - reschedule(cloudJobConfig.getJobName()); - } - - /** - * Deregister the job. - * - * @param jobName job name - */ - public void deregister(final String jobName) { - Optional jobConfig = configService.load(jobName); - if (jobConfig.isPresent()) { - disableJobService.remove(jobName); - configService.remove(jobName); - } - unschedule(jobName); - } - - /** - * Schedule the job. - * - * @param cloudJobConfig cloud job configuration - */ - public void schedule(final CloudJobConfigurationPOJO cloudJobConfig) { - if (disableAppService.isDisabled(cloudJobConfig.getAppName()) || disableJobService.isDisabled(cloudJobConfig.getJobName())) { - return; - } - if (CloudJobExecutionType.TRANSIENT == cloudJobConfig.getJobExecutionType()) { - transientProducerScheduler.register(cloudJobConfig); - } else if (CloudJobExecutionType.DAEMON == cloudJobConfig.getJobExecutionType()) { - readyService.addDaemon(cloudJobConfig.getJobName()); - } - } - - /** - * Stop to schedule the job. - * - * @param jobName job name - */ - public void unschedule(final String jobName) { - for (TaskContext each : runningService.getRunningTasks(jobName)) { - schedulerDriver.killTask(Protos.TaskID.newBuilder().setValue(each.getId()).build()); - } - runningService.remove(jobName); - readyService.remove(Collections.singletonList(jobName)); - Optional jobConfig = configService.load(jobName); - jobConfig.ifPresent(transientProducerScheduler::deregister); - } - - /** - * Re-schedule the job. - * - * @param jobName job name - */ - public void reschedule(final String jobName) { - unschedule(jobName); - Optional jobConfig = configService.load(jobName); - jobConfig.ifPresent(this::schedule); - } - - /** - * Send message to executor. - * - * @param executorId the executor of which to receive message - * @param slaveId the slave id of the executor - * @param data message content - */ - public void sendFrameworkMessage(final ExecutorID executorId, final SlaveID slaveId, final byte[] data) { - schedulerDriver.sendFrameworkMessage(executorId, slaveId, data); - } - - /** - * Shutdown the producer manager. - */ - public void shutdown() { - log.info("Stop producer manager"); - transientProducerScheduler.shutdown(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepository.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepository.java deleted file mode 100755 index 3a6330413e..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepository.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.producer; - -import org.quartz.JobKey; - -import java.util.Collections; -import java.util.List; -import java.util.Map.Entry; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * Transient producer repository. - */ -final class TransientProducerRepository { - - private final ConcurrentHashMap> cronTasks = new ConcurrentHashMap<>(256, 1); - - synchronized void put(final JobKey jobKey, final String jobName) { - remove(jobName); - List taskList = cronTasks.get(jobKey); - if (null == taskList) { - taskList = new CopyOnWriteArrayList<>(); - taskList.add(jobName); - cronTasks.put(jobKey, taskList); - return; - } - if (!taskList.contains(jobName)) { - taskList.add(jobName); - } - } - - synchronized void remove(final String jobName) { - for (Entry> each : cronTasks.entrySet()) { - JobKey jobKey = each.getKey(); - List jobNames = each.getValue(); - jobNames.remove(jobName); - if (jobNames.isEmpty()) { - cronTasks.remove(jobKey); - } - } - } - - List get(final JobKey jobKey) { - List result = cronTasks.get(jobKey); - return null == result ? Collections.emptyList() : result; - } - - boolean containsKey(final JobKey jobKey) { - return cronTasks.containsKey(jobKey); - } - - void removeAll() { - cronTasks.clear(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java deleted file mode 100755 index f3943b84b6..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.producer; - -import lombok.Setter; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.quartz.CronScheduleBuilder; -import org.quartz.Job; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobExecutionContext; -import org.quartz.JobKey; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.Trigger; -import org.quartz.TriggerBuilder; -import org.quartz.TriggerKey; -import org.quartz.impl.StdSchedulerFactory; -import org.quartz.plugins.management.ShutdownHookPlugin; -import org.quartz.simpl.SimpleThreadPool; - -import java.util.List; -import java.util.Properties; - -/** - * Transient producer scheduler. - */ -final class TransientProducerScheduler { - - private final TransientProducerRepository repository; - - private final ReadyService readyService; - - private Scheduler scheduler; - - TransientProducerScheduler(final ReadyService readyService) { - repository = new TransientProducerRepository(); - this.readyService = readyService; - } - - void start() { - scheduler = getScheduler(); - try { - scheduler.start(); - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - } - - private Scheduler getScheduler() { - StdSchedulerFactory factory = new StdSchedulerFactory(); - try { - factory.initialize(getQuartzProperties()); - return factory.getScheduler(); - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - } - - private Properties getQuartzProperties() { - Properties result = new Properties(); - result.put("org.quartz.threadPool.class", SimpleThreadPool.class.getName()); - result.put("org.quartz.threadPool.threadCount", Integer.toString(Runtime.getRuntime().availableProcessors() * 2)); - result.put("org.quartz.scheduler.instanceName", "ELASTIC_JOB_CLOUD_TRANSIENT_PRODUCER"); - result.put("org.quartz.plugin.shutdownhook.class", ShutdownHookPlugin.class.getName()); - result.put("org.quartz.plugin.shutdownhook.cleanShutdown", Boolean.TRUE.toString()); - return result; - } - - // TODO Concurrency optimization - synchronized void register(final CloudJobConfigurationPOJO cloudJobConfig) { - String cron = cloudJobConfig.getCron(); - JobKey jobKey = buildJobKey(cron); - repository.put(jobKey, cloudJobConfig.getJobName()); - try { - if (!scheduler.checkExists(jobKey)) { - scheduler.scheduleJob(buildJobDetail(jobKey), buildTrigger(jobKey.getName())); - } - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - } - - private JobDetail buildJobDetail(final JobKey jobKey) { - JobDetail result = JobBuilder.newJob(ProducerJob.class).withIdentity(jobKey).build(); - result.getJobDataMap().put("repository", repository); - result.getJobDataMap().put("readyService", readyService); - return result; - } - - private Trigger buildTrigger(final String cron) { - return TriggerBuilder.newTrigger().withIdentity(cron).withSchedule(CronScheduleBuilder.cronSchedule(cron).withMisfireHandlingInstructionDoNothing()).build(); - } - - synchronized void deregister(final CloudJobConfigurationPOJO cloudJobConfig) { - repository.remove(cloudJobConfig.getJobName()); - String cron = cloudJobConfig.getCron(); - if (!repository.containsKey(buildJobKey(cron))) { - try { - scheduler.unscheduleJob(TriggerKey.triggerKey(cron)); - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - } - } - - private JobKey buildJobKey(final String cron) { - return JobKey.jobKey(cron); - } - - void shutdown() { - try { - if (null != scheduler && !scheduler.isShutdown()) { - scheduler.shutdown(); - } - } catch (final SchedulerException ex) { - throw new JobSystemException(ex); - } - repository.removeAll(); - } - - @Setter - public static final class ProducerJob implements Job { - - private TransientProducerRepository repository; - - private ReadyService readyService; - - @Override - public void execute(final JobExecutionContext context) { - List jobNames = repository.get(context.getJobDetail().getKey()); - for (String each : jobNames) { - readyService.addTransient(each); - } - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/StateNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/StateNode.java deleted file mode 100755 index 00f4d9f0db..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/StateNode.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * State node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class StateNode { - - /** - * Root state node. - */ - public static final String ROOT = "/state"; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListener.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListener.java deleted file mode 100644 index 8f309492e7..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListener.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.app; - -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.Objects; -import java.util.concurrent.Executors; - -/** - * Cloud app disable listener. - */ -public final class CloudAppDisableListener implements CuratorCacheListener { - - private final CoordinatorRegistryCenter regCenter; - - private final ProducerManager producerManager; - - private final CloudJobConfigurationService jobConfigService; - - public CloudAppDisableListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager) { - this.regCenter = regCenter; - this.producerManager = producerManager; - jobConfigService = new CloudJobConfigurationService(regCenter); - } - - @Override - public void event(final Type type, final ChildData oldData, final ChildData data) { - String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); - if (Type.NODE_CREATED == type && isAppDisableNode(path)) { - String appName = path.substring(DisableAppNode.ROOT.length() + 1); - if (Objects.nonNull(appName)) { - disableApp(appName); - } - } else if (Type.NODE_DELETED == type && isAppDisableNode(path)) { - String appName = path.substring(DisableAppNode.ROOT.length() + 1); - if (Objects.nonNull(appName)) { - enableApp(appName); - } - } - } - - private boolean isAppDisableNode(final String path) { - return path.startsWith(DisableAppNode.ROOT) && path.length() > DisableAppNode.ROOT.length(); - } - - /** - * Start the listener service of the cloud job service. - */ - public void start() { - getCache().listenable().addListener(this, Executors.newSingleThreadExecutor()); - } - - /** - * Stop the listener service of the cloud job service. - */ - public void stop() { - getCache().listenable().removeListener(this); - } - - private CuratorCache getCache() { - CuratorCache result = (CuratorCache) regCenter.getRawCache(DisableAppNode.ROOT); - if (null != result) { - return result; - } - regCenter.addCacheData(DisableAppNode.ROOT); - return (CuratorCache) regCenter.getRawCache(DisableAppNode.ROOT); - } - - private void disableApp(final String appName) { - for (CloudJobConfigurationPOJO each : jobConfigService.loadAll()) { - if (appName.equals(each.getAppName())) { - producerManager.unschedule(each.getJobName()); - } - } - } - - private void enableApp(final String appName) { - for (CloudJobConfigurationPOJO each : jobConfigService.loadAll()) { - if (appName.equals(each.getAppName())) { - producerManager.reschedule(each.getJobName()); - } - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNode.java deleted file mode 100755 index 0011f10b45..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNode.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.app; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Disable app node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -final class DisableAppNode { - - static final String ROOT = StateNode.ROOT + "/disable/app"; - - private static final String DISABLE_APP = ROOT + "/%s"; - - static String getDisableAppNodePath(final String appName) { - return String.format(DISABLE_APP, appName); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppService.java deleted file mode 100755 index 9a7febed5a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppService.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.app; - -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -/** - * Disable app service. - */ -@Slf4j -public class DisableAppService { - - private final BootstrapEnvironment env = BootstrapEnvironment.getINSTANCE(); - - private final CoordinatorRegistryCenter regCenter; - - public DisableAppService(final CoordinatorRegistryCenter regCenter) { - this.regCenter = regCenter; - } - - /** - * Add application name to disable queue. - * - * @param appName application name - */ - public void add(final String appName) { - if (regCenter.getNumChildren(DisableAppNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { - log.warn("Cannot add disable app, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); - return; - } - String disableAppNodePath = DisableAppNode.getDisableAppNodePath(appName); - if (!regCenter.isExisted(disableAppNodePath)) { - regCenter.persist(disableAppNodePath, appName); - } - } - - /** - * Remove application name from disable queue. - * - * @param appName application name - */ - public void remove(final String appName) { - regCenter.remove(DisableAppNode.getDisableAppNodePath(appName)); - } - - /** - * Check whether the application name is disabled or not. - * - * @param appName application name - * @return true is in the disable queue, otherwise not - */ - public boolean isDisabled(final String appName) { - return regCenter.isExisted(DisableAppNode.getDisableAppNodePath(appName)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListener.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListener.java deleted file mode 100644 index 52fd04ea95..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListener.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.job; - -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.Objects; -import java.util.concurrent.Executors; - -/** - * Cloud job disable listener. - */ -public final class CloudJobDisableListener implements CuratorCacheListener { - - private final CoordinatorRegistryCenter regCenter; - - private final ProducerManager producerManager; - - public CloudJobDisableListener(final CoordinatorRegistryCenter regCenter, final ProducerManager producerManager) { - this.regCenter = regCenter; - this.producerManager = producerManager; - } - - @Override - public void event(final Type type, final ChildData oldData, final ChildData data) { - String path = Type.NODE_DELETED == type ? oldData.getPath() : data.getPath(); - if (Type.NODE_CREATED == type && isJobDisableNode(path)) { - String jobName = path.substring(DisableJobNode.ROOT.length() + 1); - if (Objects.nonNull(jobName)) { - producerManager.unschedule(jobName); - } - } else if (Type.NODE_DELETED == type && isJobDisableNode(path)) { - String jobName = path.substring(DisableJobNode.ROOT.length() + 1); - if (Objects.nonNull(jobName)) { - producerManager.reschedule(jobName); - } - } - } - - private boolean isJobDisableNode(final String path) { - return path.startsWith(DisableJobNode.ROOT) && path.length() > DisableJobNode.ROOT.length(); - } - - /** - * Start the listener service of the cloud job service. - */ - public void start() { - getCache().listenable().addListener(this, Executors.newSingleThreadExecutor()); - } - - /** - * Stop the listener service of the cloud job service. - */ - public void stop() { - getCache().listenable().removeListener(this); - } - - private CuratorCache getCache() { - CuratorCache result = (CuratorCache) regCenter.getRawCache(DisableJobNode.ROOT); - if (null != result) { - return result; - } - regCenter.addCacheData(DisableJobNode.ROOT); - return (CuratorCache) regCenter.getRawCache(DisableJobNode.ROOT); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNode.java deleted file mode 100755 index 48f4be24b6..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNode.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.job; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Disable job node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -final class DisableJobNode { - - static final String ROOT = StateNode.ROOT + "/disable/job"; - - private static final String DISABLE_JOB = ROOT + "/%s"; - - static String getDisableJobNodePath(final String jobName) { - return String.format(DISABLE_JOB, jobName); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobService.java deleted file mode 100755 index a77c0fda62..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobService.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.job; - -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -/** - * Disable job service. - */ -@Slf4j -public class DisableJobService { - - private final BootstrapEnvironment env = BootstrapEnvironment.getINSTANCE(); - - private final CoordinatorRegistryCenter regCenter; - - public DisableJobService(final CoordinatorRegistryCenter regCenter) { - this.regCenter = regCenter; - } - - /** - * Add job to the disable queue. - * - * @param jobName job name - */ - public void add(final String jobName) { - if (regCenter.getNumChildren(DisableJobNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { - log.warn("Cannot add disable job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); - return; - } - String disableJobNodePath = DisableJobNode.getDisableJobNodePath(jobName); - if (!regCenter.isExisted(disableJobNodePath)) { - regCenter.persist(disableJobNodePath, jobName); - } - } - - /** - * Remove the job from the disable queue. - * - * @param jobName job name - */ - public void remove(final String jobName) { - regCenter.remove(DisableJobNode.getDisableJobNodePath(jobName)); - } - - /** - * Determine whether the job is in the disable queue or not. - * - * @param jobName job name - * @return true is in the disable queue, otherwise not - */ - public boolean isDisabled(final String jobName) { - return regCenter.isExisted(DisableJobNode.getDisableJobNodePath(jobName)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNode.java deleted file mode 100755 index be6813762f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNode.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.failover; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; - -/** - * Failover node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -final class FailoverNode { - - static final String ROOT = StateNode.ROOT + "/failover"; - - private static final String FAILOVER_JOB = ROOT + "/%s"; - - private static final String FAILOVER_TASK = FAILOVER_JOB + "/%s"; - - static String getFailoverJobNodePath(final String jobName) { - return String.format(FAILOVER_JOB, jobName); - } - - static String getFailoverTaskNodePath(final String taskMetaInfo) { - return String.format(FAILOVER_TASK, MetaInfo.from(taskMetaInfo).getJobName(), taskMetaInfo); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverService.java deleted file mode 100755 index 8b5e87dfab..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverService.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.failover; - -import com.google.common.base.Strings; -import com.google.common.hash.HashCode; -import com.google.common.hash.Hashing; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - -/** - * Failover service. - */ -@Slf4j -public final class FailoverService { - - private final BootstrapEnvironment env = BootstrapEnvironment.getINSTANCE(); - - private final CoordinatorRegistryCenter regCenter; - - private final CloudJobConfigurationService configService; - - private final RunningService runningService; - - public FailoverService(final CoordinatorRegistryCenter regCenter) { - this.regCenter = regCenter; - configService = new CloudJobConfigurationService(regCenter); - runningService = new RunningService(regCenter); - } - - /** - * Add task to failover queue. - * - * @param taskContext task running context - */ - public void add(final TaskContext taskContext) { - if (regCenter.getNumChildren(FailoverNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { - log.warn("Cannot add job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); - return; - } - String failoverTaskNodePath = FailoverNode.getFailoverTaskNodePath(taskContext.getMetaInfo().toString()); - if (!regCenter.isExisted(failoverTaskNodePath) && !runningService.isTaskRunning(taskContext.getMetaInfo())) { - // TODO Whether Daemon-type jobs increase storage and fail immediately? - regCenter.persist(failoverTaskNodePath, taskContext.getId()); - } - } - - /** - * Get all eligible job contexts from failover queue. - * - * @return collection of the eligible job contexts - */ - public Collection getAllEligibleJobContexts() { - if (!regCenter.isExisted(FailoverNode.ROOT)) { - return Collections.emptyList(); - } - List jobNames = regCenter.getChildrenKeys(FailoverNode.ROOT); - Collection result = new ArrayList<>(jobNames.size()); - Set assignedTasks = new HashSet<>(jobNames.size() * 10, 1); - for (String each : jobNames) { - List taskIdList = regCenter.getChildrenKeys(FailoverNode.getFailoverJobNodePath(each)); - if (taskIdList.isEmpty()) { - regCenter.remove(FailoverNode.getFailoverJobNodePath(each)); - continue; - } - Optional cloudJobConfig = configService.load(each); - if (!cloudJobConfig.isPresent()) { - regCenter.remove(FailoverNode.getFailoverJobNodePath(each)); - continue; - } - List assignedShardingItems = getAssignedShardingItems(each, taskIdList, assignedTasks); - if (!assignedShardingItems.isEmpty()) { - result.add(new JobContext(cloudJobConfig.get().toCloudJobConfiguration(), assignedShardingItems, ExecutionType.FAILOVER)); - } - } - return result; - } - - private List getAssignedShardingItems(final String jobName, final List taskIdList, final Set assignedTasks) { - List result = new ArrayList<>(taskIdList.size()); - for (String each : taskIdList) { - MetaInfo metaInfo = MetaInfo.from(each); - if (assignedTasks.add(Hashing.sha256().newHasher().putString(jobName, StandardCharsets.UTF_8).putInt(metaInfo.getShardingItems().get(0)).hash()) - && !runningService.isTaskRunning(metaInfo)) { - result.add(metaInfo.getShardingItems().get(0)); - } - } - return result; - } - - /** - * Remove task from the failover queue. - * - * @param metaInfoList collection of task meta infos to be removed - */ - public void remove(final Collection metaInfoList) { - for (MetaInfo each : metaInfoList) { - regCenter.remove(FailoverNode.getFailoverTaskNodePath(each.toString())); - } - } - - /** - * Get task id from failover queue. - * - * @param metaInfo task meta info - * @return failover task id - */ - public Optional getTaskId(final MetaInfo metaInfo) { - String failoverTaskNodePath = FailoverNode.getFailoverTaskNodePath(metaInfo.toString()); - return regCenter.isExisted(failoverTaskNodePath) ? Optional.of(regCenter.get(failoverTaskNodePath)) : Optional.empty(); - } - - /** - * Get all failover tasks. - * - * @return all failover tasks - */ - public Map> getAllFailoverTasks() { - if (!regCenter.isExisted(FailoverNode.ROOT)) { - return Collections.emptyMap(); - } - List jobNames = regCenter.getChildrenKeys(FailoverNode.ROOT); - Map> result = new HashMap<>(jobNames.size(), 1); - for (String each : jobNames) { - Collection failoverTasks = getFailoverTasks(each); - if (!failoverTasks.isEmpty()) { - result.put(each, failoverTasks); - } - } - return result; - } - - /** - * Get failover tasks. - * - * @param jobName job name - * @return collection of failover tasks - */ - private Collection getFailoverTasks(final String jobName) { - List failOverTasks = regCenter.getChildrenKeys(FailoverNode.getFailoverJobNodePath(jobName)); - List result = new ArrayList<>(failOverTasks.size()); - for (String each : failOverTasks) { - String originalTaskId = regCenter.get(FailoverNode.getFailoverTaskNodePath(each)); - if (!Strings.isNullOrEmpty(originalTaskId)) { - result.add(new FailoverTaskInfo(MetaInfo.from(each), originalTaskId)); - } - } - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverTaskInfo.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverTaskInfo.java deleted file mode 100755 index fa13828300..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverTaskInfo.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.failover; - -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; - -/** - * Failover task info. - */ -@RequiredArgsConstructor -@Getter -public final class FailoverTaskInfo { - - private final MetaInfo taskInfo; - - private final String originalTaskId; -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNode.java deleted file mode 100755 index 24a67f54dd..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNode.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.ready; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Ready node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -final class ReadyNode { - - static final String ROOT = StateNode.ROOT + "/ready"; - - private static final String READY_JOB = ROOT + "/%s"; - - static String getReadyJobNodePath(final String jobName) { - return String.format(READY_JOB, jobName); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyService.java deleted file mode 100755 index 13a1ed5410..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyService.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.ready; - -import com.google.common.base.Strings; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.stream.Collectors; - -/** - * Ready service. - */ -@Slf4j -public final class ReadyService { - - private final BootstrapEnvironment env = BootstrapEnvironment.getINSTANCE(); - - private final CoordinatorRegistryCenter regCenter; - - private final CloudJobConfigurationService configService; - - private final RunningService runningService; - - public ReadyService(final CoordinatorRegistryCenter regCenter) { - this.regCenter = regCenter; - configService = new CloudJobConfigurationService(regCenter); - runningService = new RunningService(regCenter); - } - - /** - * Add transient job to ready queue. - * - * @param jobName job name - */ - public void addTransient(final String jobName) { - if (regCenter.getNumChildren(ReadyNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { - log.warn("Cannot add transient job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); - return; - } - Optional cloudJobConfig = configService.load(jobName); - if (!cloudJobConfig.isPresent() || CloudJobExecutionType.TRANSIENT != cloudJobConfig.get().getJobExecutionType()) { - return; - } - String readyJobNode = ReadyNode.getReadyJobNodePath(jobName); - String times = regCenter.getDirectly(readyJobNode); - if (cloudJobConfig.get().isMisfire()) { - regCenter.persist(readyJobNode, Integer.toString(null == times ? 1 : Integer.parseInt(times) + 1)); - } else { - regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); - } - } - - /** - * Add daemon job to ready queue. - * - * @param jobName job name - */ - public void addDaemon(final String jobName) { - if (regCenter.getNumChildren(ReadyNode.ROOT) > env.getFrameworkConfiguration().getJobStateQueueSize()) { - log.warn("Cannot add daemon job, caused by read state queue size is larger than {}.", env.getFrameworkConfiguration().getJobStateQueueSize()); - return; - } - Optional cloudJobConfig = configService.load(jobName); - if (!cloudJobConfig.isPresent() || CloudJobExecutionType.DAEMON != cloudJobConfig.get().getJobExecutionType() || runningService.isJobRunning(jobName)) { - return; - } - regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); - } - - /** - * Set misfire disabled. - * - * @param jobName job name - */ - public void setMisfireDisabled(final String jobName) { - Optional cloudJobConfig = configService.load(jobName); - if (cloudJobConfig.isPresent() && null != regCenter.getDirectly(ReadyNode.getReadyJobNodePath(jobName))) { - regCenter.persist(ReadyNode.getReadyJobNodePath(jobName), "1"); - } - } - - /** - * Get all the eligible job contexts from ready queue. - * - * @param ineligibleJobContexts ineligible job contexts - * @return collection of eligible contexts - */ - public Collection getAllEligibleJobContexts(final Collection ineligibleJobContexts) { - if (!regCenter.isExisted(ReadyNode.ROOT)) { - return Collections.emptyList(); - } - Collection ineligibleJobNames = ineligibleJobContexts.stream().map(input -> input.getCloudJobConfig().getJobConfig().getJobName()).collect(Collectors.toList()); - List jobNames = regCenter.getChildrenKeys(ReadyNode.ROOT); - List result = new ArrayList<>(jobNames.size()); - for (String each : jobNames) { - if (ineligibleJobNames.contains(each)) { - continue; - } - Optional jobConfig = configService.load(each); - if (!jobConfig.isPresent()) { - regCenter.remove(ReadyNode.getReadyJobNodePath(each)); - continue; - } - if (!runningService.isJobRunning(each)) { - result.add(JobContext.from(jobConfig.get().toCloudJobConfiguration(), ExecutionType.READY)); - } - } - return result; - } - - /** - * Remove jobs from ready queue. - * - * @param jobNames collection of jobs to be removed - */ - public void remove(final Collection jobNames) { - for (String each : jobNames) { - String readyJobNode = ReadyNode.getReadyJobNodePath(each); - String timesStr = regCenter.getDirectly(readyJobNode); - int times = null == timesStr ? 0 : Integer.parseInt(timesStr); - if (times <= 1) { - regCenter.remove(readyJobNode); - } else { - regCenter.persist(readyJobNode, Integer.toString(times - 1)); - } - } - } - - /** - * Get all ready tasks. - * - * @return all ready tasks - */ - public Map getAllReadyTasks() { - if (!regCenter.isExisted(ReadyNode.ROOT)) { - return Collections.emptyMap(); - } - List jobNames = regCenter.getChildrenKeys(ReadyNode.ROOT); - Map result = new HashMap<>(jobNames.size(), 1); - for (String each : jobNames) { - String times = regCenter.get(ReadyNode.getReadyJobNodePath(each)); - if (!Strings.isNullOrEmpty(times)) { - result.put(each, Integer.parseInt(times)); - } - } - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNode.java deleted file mode 100755 index bfd18f847f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNode.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.running; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.StateNode; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; - -/** - * Running node. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -final class RunningNode { - - static final String ROOT = StateNode.ROOT + "/running"; - - private static final String RUNNING_JOB = ROOT + "/%s"; - - private static final String RUNNING_TASK = RUNNING_JOB + "/%s"; - - static String getRunningJobNodePath(final String jobName) { - return String.format(RUNNING_JOB, jobName); - } - - static String getRunningTaskNodePath(final String taskMetaInfo) { - return String.format(RUNNING_TASK, MetaInfo.from(taskMetaInfo).getJobName(), taskMetaInfo); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java deleted file mode 100755 index 3a4b870b90..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningService.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.running; - -import com.google.common.collect.Sets; -import lombok.Getter; -import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; - -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArraySet; -import java.util.stream.Collectors; - -/** - * Running service. - */ -@RequiredArgsConstructor -public final class RunningService { - - private static final int TASK_INITIAL_SIZE = 1024; - - // TODO Using JMX to export - @Getter - private static final ConcurrentHashMap> RUNNING_TASKS = new ConcurrentHashMap<>(TASK_INITIAL_SIZE); - - private static final ConcurrentHashMap TASK_HOSTNAME_MAPPER = new ConcurrentHashMap<>(TASK_INITIAL_SIZE); - - private final CoordinatorRegistryCenter regCenter; - - private final CloudJobConfigurationService configurationService; - - public RunningService(final CoordinatorRegistryCenter regCenter) { - this.regCenter = regCenter; - this.configurationService = new CloudJobConfigurationService(regCenter); - } - - /** - * Start running queue service. - */ - public void start() { - clear(); - for (String each : regCenter.getChildrenKeys(RunningNode.ROOT)) { - if (!configurationService.load(each).isPresent()) { - remove(each); - continue; - } - RUNNING_TASKS.put(each, Sets.newCopyOnWriteArraySet(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath(each)).stream() - .map(input -> TaskContext.from(regCenter.get(RunningNode.getRunningTaskNodePath(MetaInfo.from(input).toString())))).collect(Collectors.toList()))); - } - } - - /** - * Add task to running queue. - * - * @param taskContext task running context - */ - public void add(final TaskContext taskContext) { - if (!configurationService.load(taskContext.getMetaInfo().getJobName()).isPresent()) { - return; - } - getRunningTasks(taskContext.getMetaInfo().getJobName()).add(taskContext); - if (!isDaemon(taskContext.getMetaInfo().getJobName())) { - return; - } - String runningTaskNodePath = RunningNode.getRunningTaskNodePath(taskContext.getMetaInfo().toString()); - if (!regCenter.isExisted(runningTaskNodePath)) { - regCenter.persist(runningTaskNodePath, taskContext.getId()); - } - } - - private boolean isDaemon(final String jobName) { - Optional cloudJobConfig = configurationService.load(jobName); - return cloudJobConfig.isPresent() && CloudJobExecutionType.DAEMON == cloudJobConfig.get().getJobExecutionType(); - } - - /** - * Update task to idle state. - * - * @param taskContext task running context - * @param isIdle is idle - */ - public void updateIdle(final TaskContext taskContext, final boolean isIdle) { - synchronized (RUNNING_TASKS) { - Optional taskContextOptional = findTask(taskContext); - if (taskContextOptional.isPresent()) { - taskContextOptional.get().setIdle(isIdle); - } else { - add(taskContext); - } - } - } - - private Optional findTask(final TaskContext taskContext) { - return getRunningTasks(taskContext.getMetaInfo().getJobName()).stream().filter(each -> each.equals(taskContext)).findFirst(); - } - - /** - * Remove job from running queue. - * - * @param jobName job name - */ - public void remove(final String jobName) { - RUNNING_TASKS.remove(jobName); - if (!isDaemonOrAbsent(jobName)) { - return; - } - regCenter.remove(RunningNode.getRunningJobNodePath(jobName)); - } - - /** - * Remove task from running queue. - * - * @param taskContext task running context - */ - public void remove(final TaskContext taskContext) { - getRunningTasks(taskContext.getMetaInfo().getJobName()).remove(taskContext); - if (!isDaemonOrAbsent(taskContext.getMetaInfo().getJobName())) { - return; - } - regCenter.remove(RunningNode.getRunningTaskNodePath(taskContext.getMetaInfo().toString())); - String jobRootNode = RunningNode.getRunningJobNodePath(taskContext.getMetaInfo().getJobName()); - if (regCenter.isExisted(jobRootNode) && regCenter.getChildrenKeys(jobRootNode).isEmpty()) { - regCenter.remove(jobRootNode); - } - } - - private boolean isDaemonOrAbsent(final String jobName) { - Optional cloudJobConfigurationOptional = configurationService.load(jobName); - return !cloudJobConfigurationOptional.isPresent() || CloudJobExecutionType.DAEMON == cloudJobConfigurationOptional.get().getJobExecutionType(); - } - - /** - * Determine whether the job is running or not. - * - * @param jobName job name - * @return true is running, otherwise not - */ - public boolean isJobRunning(final String jobName) { - return !getRunningTasks(jobName).isEmpty(); - } - - /** - * Determine whether the task is running or not. - * - * @param metaInfo task meta info - * @return true is running, otherwise not - */ - public boolean isTaskRunning(final MetaInfo metaInfo) { - for (TaskContext each : getRunningTasks(metaInfo.getJobName())) { - if (each.getMetaInfo().equals(metaInfo)) { - return true; - } - } - return false; - } - - /** - * Get running tasks by job name. - * - * @param jobName job name - * @return collection of the running tasks - */ - public Collection getRunningTasks(final String jobName) { - Set taskContexts = new CopyOnWriteArraySet<>(); - Collection result = RUNNING_TASKS.putIfAbsent(jobName, taskContexts); - return null == result ? taskContexts : result; - } - - /** - * Get all running tasks. - * - * @return collection of all the running tasks - */ - public Map> getAllRunningTasks() { - Map> result = new HashMap<>(RUNNING_TASKS.size(), 1); - result.putAll(RUNNING_TASKS); - return result; - } - - /** - * Get all running daemon tasks. - * - * @return collection of all the running daemon tasks - */ - public Set getAllRunningDaemonTasks() { - List jobKeys = regCenter.getChildrenKeys(RunningNode.ROOT); - for (String each : jobKeys) { - if (!RUNNING_TASKS.containsKey(each)) { - remove(each); - } - } - Set result = Sets.newHashSet(); - for (Map.Entry> each : RUNNING_TASKS.entrySet()) { - if (isDaemonOrAbsent(each.getKey())) { - result.addAll(each.getValue()); - } - } - return result; - } - - /** - * Add mapping of task primary key and hostname. - * - * @param taskId task primary key - * @param hostname host name - */ - public void addMapping(final String taskId, final String hostname) { - TASK_HOSTNAME_MAPPER.putIfAbsent(taskId, hostname); - } - - /** - * Retrieve the hostname and then remove this task from the mapping. - * - * @param taskId task primary key - * @return the host name of the removed task - */ - public String popMapping(final String taskId) { - return TASK_HOSTNAME_MAPPER.remove(taskId); - } - - /** - * Clear the running status. - */ - public void clear() { - RUNNING_TASKS.clear(); - TASK_HOSTNAME_MAPPER.clear(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManager.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManager.java deleted file mode 100755 index 18d7086879..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManager.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics; - -import lombok.AccessLevel; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.JobRunningStatisticJob; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.RegisteredJobStatisticJob; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.TaskResultStatisticJob; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobExecutionTypeStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; - -import javax.sql.DataSource; -import java.sql.SQLException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** - * Statistic manager. - */ -@Slf4j -@RequiredArgsConstructor(access = AccessLevel.PRIVATE) -public final class StatisticManager { - - private static volatile StatisticManager instance; - - private final CoordinatorRegistryCenter registryCenter; - - private final CloudJobConfigurationService configurationService; - - private final TracingConfiguration tracingConfiguration; - - private final StatisticsScheduler scheduler; - - private final Map statisticData; - - private StatisticRdbRepository rdbRepository; - - private StatisticManager(final CoordinatorRegistryCenter registryCenter, final TracingConfiguration tracingConfiguration, - final StatisticsScheduler scheduler, final Map statisticData) { - this.registryCenter = registryCenter; - this.configurationService = new CloudJobConfigurationService(registryCenter); - this.tracingConfiguration = tracingConfiguration; - this.scheduler = scheduler; - this.statisticData = statisticData; - } - - /** - * Get statistic manager. - * - * @param regCenter registry center - * @param tracingConfiguration tracing configuration - * @return statistic manager - */ - public static StatisticManager getInstance(final CoordinatorRegistryCenter regCenter, final TracingConfiguration tracingConfiguration) { - if (null == instance) { - synchronized (StatisticManager.class) { - if (null == instance) { - Map statisticData = new HashMap<>(); - statisticData.put(StatisticInterval.MINUTE, new TaskResultMetaData()); - statisticData.put(StatisticInterval.HOUR, new TaskResultMetaData()); - statisticData.put(StatisticInterval.DAY, new TaskResultMetaData()); - instance = new StatisticManager(regCenter, tracingConfiguration, new StatisticsScheduler(), statisticData); - init(); - } - } - } - return instance; - } - - private static void init() { - if (null != instance.tracingConfiguration) { - try { - instance.rdbRepository = new StatisticRdbRepository((DataSource) instance.tracingConfiguration.getTracingStorageConfiguration().getStorage()); - } catch (final SQLException ex) { - log.error("Init StatisticRdbRepository error:", ex); - } - } - } - - /** - * Startup. - */ - public void startup() { - if (null != rdbRepository) { - scheduler.start(); - scheduler.register(new TaskResultStatisticJob(StatisticInterval.MINUTE, statisticData.get(StatisticInterval.MINUTE), rdbRepository)); - scheduler.register(new TaskResultStatisticJob(StatisticInterval.HOUR, statisticData.get(StatisticInterval.HOUR), rdbRepository)); - scheduler.register(new TaskResultStatisticJob(StatisticInterval.DAY, statisticData.get(StatisticInterval.DAY), rdbRepository)); - scheduler.register(new JobRunningStatisticJob(registryCenter, rdbRepository)); - scheduler.register(new RegisteredJobStatisticJob(configurationService, rdbRepository)); - } - } - - /** - * Shutdown. - */ - public void shutdown() { - scheduler.shutdown(); - } - - /** - * Run task successfully. - */ - public void taskRunSuccessfully() { - statisticData.get(StatisticInterval.MINUTE).incrementAndGetSuccessCount(); - statisticData.get(StatisticInterval.HOUR).incrementAndGetSuccessCount(); - statisticData.get(StatisticInterval.DAY).incrementAndGetSuccessCount(); - } - - /** - * Run task failed. - */ - public void taskRunFailed() { - statisticData.get(StatisticInterval.MINUTE).incrementAndGetFailedCount(); - statisticData.get(StatisticInterval.HOUR).incrementAndGetFailedCount(); - statisticData.get(StatisticInterval.DAY).incrementAndGetFailedCount(); - } - - private boolean isRdbConfigured() { - return null != rdbRepository; - } - - /** - * Get statistic of the recent week. - * @return task result statistic - */ - public TaskResultStatistics getTaskResultStatisticsWeekly() { - if (!isRdbConfigured()) { - return new TaskResultStatistics(0, 0, StatisticInterval.DAY, new Date()); - } - return rdbRepository.getSummedTaskResultStatistics(StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -7), StatisticInterval.DAY); - } - - /** - * Get statistic since online. - * - * @return task result statistic - */ - public TaskResultStatistics getTaskResultStatisticsSinceOnline() { - if (!isRdbConfigured()) { - return new TaskResultStatistics(0, 0, StatisticInterval.DAY, new Date()); - } - return rdbRepository.getSummedTaskResultStatistics(getOnlineDate(), StatisticInterval.DAY); - } - - /** - * Get the latest statistic of the specified interval. - * @param statisticInterval statistic interval - * @return task result statistic - */ - public TaskResultStatistics findLatestTaskResultStatistics(final StatisticInterval statisticInterval) { - if (isRdbConfigured()) { - Optional result = rdbRepository.findLatestTaskResultStatistics(statisticInterval); - if (result.isPresent()) { - return result.get(); - } - } - return new TaskResultStatistics(0, 0, statisticInterval, new Date()); - } - - /** - * Get statistic of the recent day. - * - * @return task result statistic - */ - public List findTaskResultStatisticsDaily() { - if (!isRdbConfigured()) { - return Collections.emptyList(); - } - return rdbRepository.findTaskResultStatistics(StatisticTimeUtils.getStatisticTime(StatisticInterval.HOUR, -24), StatisticInterval.MINUTE); - } - - /** - * Get job execution type statistics. - * - * @return Job execution type statistics data object - */ - public JobExecutionTypeStatistics getJobExecutionTypeStatistics() { - int transientJobCnt = 0; - int daemonJobCnt = 0; - for (CloudJobConfigurationPOJO each : configurationService.loadAll()) { - if (CloudJobExecutionType.TRANSIENT.equals(each.getJobExecutionType())) { - transientJobCnt++; - } else if (CloudJobExecutionType.DAEMON.equals(each.getJobExecutionType())) { - daemonJobCnt++; - } - } - return new JobExecutionTypeStatistics(transientJobCnt, daemonJobCnt); - } - - /** - * Get the collection of task statistics in the most recent week. - * - * @return Collection of running task statistics data objects - */ - public List findTaskRunningStatisticsWeekly() { - if (!isRdbConfigured()) { - return Collections.emptyList(); - } - return rdbRepository.findTaskRunningStatistics(StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -7)); - } - - /** - * Get the collection of job statistics in the most recent week. - * - * @return collection of running task statistics data objects - */ - public List findJobRunningStatisticsWeekly() { - if (!isRdbConfigured()) { - return Collections.emptyList(); - } - return rdbRepository.findJobRunningStatistics(StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -7)); - } - - /** - * Get running task statistics data collection since online. - * - * @return collection of running task statistics data objects - */ - public List findJobRegisterStatisticsSinceOnline() { - if (!isRdbConfigured()) { - return Collections.emptyList(); - } - return rdbRepository.findJobRegisterStatistics(getOnlineDate()); - } - - private Date getOnlineDate() { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - try { - return formatter.parse("2016-12-16"); - } catch (final ParseException ex) { - return null; - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java deleted file mode 100755 index 407594586c..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.StatisticJob; -import org.apache.shardingsphere.elasticjob.infra.exception.JobStatisticException; -import org.quartz.JobDetail; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.impl.StdSchedulerFactory; -import org.quartz.plugins.management.ShutdownHookPlugin; -import org.quartz.simpl.SimpleThreadPool; - -import java.util.Properties; - -/** - * Statistic scheduler. - */ -final class StatisticsScheduler { - - private final StdSchedulerFactory factory; - - private Scheduler scheduler; - - StatisticsScheduler() { - factory = new StdSchedulerFactory(); - try { - factory.initialize(getQuartzProperties()); - } catch (final SchedulerException ex) { - throw new JobStatisticException(ex); - } - } - - private Properties getQuartzProperties() { - Properties result = new Properties(); - result.put("org.quartz.threadPool.class", SimpleThreadPool.class.getName()); - result.put("org.quartz.threadPool.threadCount", Integer.toString(1)); - result.put("org.quartz.scheduler.instanceName", "ELASTIC_JOB_CLOUD_STATISTICS_SCHEDULER"); - result.put("org.quartz.plugin.shutdownhook.class", ShutdownHookPlugin.class.getName()); - result.put("org.quartz.plugin.shutdownhook.cleanShutdown", Boolean.TRUE.toString()); - return result; - } - - /** - * Start. - */ - void start() { - try { - scheduler = factory.getScheduler(); - scheduler.start(); - } catch (final SchedulerException ex) { - throw new JobStatisticException(ex); - } - } - - /** - * Register statistic job. - * - * @param statisticJob statistic job - */ - void register(final StatisticJob statisticJob) { - try { - JobDetail jobDetail = statisticJob.buildJobDetail(); - jobDetail.getJobDataMap().putAll(statisticJob.getDataMap()); - scheduler.scheduleJob(jobDetail, statisticJob.buildTrigger()); - } catch (final SchedulerException ex) { - throw new JobStatisticException(ex); - } - } - - /** - * Shutdown. - */ - void shutdown() { - try { - if (null != scheduler && !scheduler.isShutdown()) { - scheduler.shutdown(); - } - } catch (final SchedulerException ex) { - throw new JobStatisticException(ex); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java deleted file mode 100755 index 8444ae6fd8..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaData.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics; - -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Task result meta data. - */ -public final class TaskResultMetaData { - - private final AtomicInteger successCount; - - private final AtomicInteger failedCount; - - public TaskResultMetaData() { - successCount = new AtomicInteger(0); - failedCount = new AtomicInteger(0); - } - - /** - * Increase and get success count. - * - * @return success count - */ - public int incrementAndGetSuccessCount() { - return successCount.incrementAndGet(); - } - - /** - * Increase and get failed count. - * - * @return failed count - */ - public int incrementAndGetFailedCount() { - return failedCount.incrementAndGet(); - } - - /** - * Get success count. - * - * @return success count - */ - public int getSuccessCount() { - return successCount.get(); - } - - /** - * Get failed count. - * - * @return failed count - */ - public int getFailedCount() { - return failedCount.get(); - } - - /** - * Reset success and failed count. - */ - public void reset() { - successCount.set(0); - failedCount.set(0); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/AbstractStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/AbstractStatisticJob.java deleted file mode 100755 index 6e30d25861..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/AbstractStatisticJob.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; - -/** - * Statistic job. - */ -abstract class AbstractStatisticJob implements StatisticJob { - - String getJobName() { - return this.getClass().getSimpleName(); - } - - String getTriggerName() { - return this.getClass().getSimpleName() + "Trigger"; - } - - List findBlankStatisticTimes(final Date latestStatisticTime, final StatisticInterval statisticInterval) { - List result = new ArrayList<>(); - int previousInterval = -1; - Date previousTime = StatisticTimeUtils.getStatisticTime(statisticInterval, previousInterval); - while (previousTime.after(latestStatisticTime)) { - result.add(previousTime); - previousTime = StatisticTimeUtils.getStatisticTime(statisticInterval, --previousInterval); - } - Collections.sort(result); - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java deleted file mode 100755 index 29f0b0a95d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJob.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.quartz.CronScheduleBuilder; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobExecutionContext; -import org.quartz.Trigger; -import org.quartz.TriggerBuilder; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - -/** - * Running job statistic. - */ -@Setter -@NoArgsConstructor -@Slf4j -public final class JobRunningStatisticJob extends AbstractStatisticJob { - - private static final StatisticInterval EXECUTE_INTERVAL = StatisticInterval.MINUTE; - - private RunningService runningService; - - private StatisticRdbRepository repository; - - public JobRunningStatisticJob(final CoordinatorRegistryCenter registryCenter, final StatisticRdbRepository rdbRepository) { - runningService = new RunningService(registryCenter); - this.repository = rdbRepository; - } - - @Override - public JobDetail buildJobDetail() { - return JobBuilder.newJob(this.getClass()).withIdentity(getJobName()).build(); - } - - @Override - public Trigger buildTrigger() { - return TriggerBuilder.newTrigger() - .withIdentity(getTriggerName()) - .withSchedule(CronScheduleBuilder.cronSchedule(EXECUTE_INTERVAL.getCron()) - .withMisfireHandlingInstructionDoNothing()) - .build(); - } - - @Override - public Map getDataMap() { - Map result = new HashMap<>(2); - result.put("runningService", runningService); - result.put("repository", repository); - return result; - } - - @Override - public void execute(final JobExecutionContext context) { - Map> allRunningTasks = runningService.getAllRunningTasks(); - statisticJob(getJobRunningCount(allRunningTasks)); - statisticTask(getTaskRunningCount(allRunningTasks)); - } - - private void statisticJob(final int runningCount) { - Optional latestOne = repository.findLatestJobRunningStatistics(); - latestOne.ifPresent(this::fillBlankIfNeeded); - JobRunningStatistics jobRunningStatistics = new JobRunningStatistics(runningCount, StatisticTimeUtils.getCurrentStatisticTime(EXECUTE_INTERVAL)); - log.debug("Add jobRunningStatistics, runningCount is:{}", runningCount); - repository.add(jobRunningStatistics); - } - - private void statisticTask(final int runningCount) { - Optional latestOne = repository.findLatestTaskRunningStatistics(); - latestOne.ifPresent(this::fillBlankIfNeeded); - TaskRunningStatistics taskRunningStatistics = new TaskRunningStatistics(runningCount, StatisticTimeUtils.getCurrentStatisticTime(EXECUTE_INTERVAL)); - log.debug("Add taskRunningStatistics, runningCount is:{}", runningCount); - repository.add(taskRunningStatistics); - } - - private int getJobRunningCount(final Map> allRunningTasks) { - int result = 0; - for (Map.Entry> entry : allRunningTasks.entrySet()) { - if (!entry.getValue().isEmpty()) { - result++; - } - } - return result; - } - - private int getTaskRunningCount(final Map> allRunningTasks) { - int result = 0; - for (Map.Entry> entry : allRunningTasks.entrySet()) { - result += entry.getValue().size(); - } - return result; - } - - private void fillBlankIfNeeded(final JobRunningStatistics latestOne) { - List blankDateRange = findBlankStatisticTimes(latestOne.getStatisticsTime(), EXECUTE_INTERVAL); - if (!blankDateRange.isEmpty()) { - log.debug("Fill blank range of jobRunningStatistics, range is:{}", blankDateRange); - } - for (Date each : blankDateRange) { - repository.add(new JobRunningStatistics(latestOne.getRunningCount(), each)); - } - } - - private void fillBlankIfNeeded(final TaskRunningStatistics latestOne) { - List blankDateRange = findBlankStatisticTimes(latestOne.getStatisticsTime(), EXECUTE_INTERVAL); - if (!blankDateRange.isEmpty()) { - log.debug("Fill blank range of taskRunningStatistics, range is:{}", blankDateRange); - } - for (Date each : blankDateRange) { - repository.add(new TaskRunningStatistics(latestOne.getRunningCount(), each)); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java deleted file mode 100755 index 814d883b36..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJob.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import lombok.AllArgsConstructor; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.quartz.CronScheduleBuilder; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobExecutionContext; -import org.quartz.Trigger; -import org.quartz.TriggerBuilder; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** - * Registered job statistic. - */ -@Setter -@NoArgsConstructor -@AllArgsConstructor -@Slf4j -public final class RegisteredJobStatisticJob extends AbstractStatisticJob { - - private CloudJobConfigurationService configurationService; - - private StatisticRdbRepository repository; - - private final StatisticInterval execInterval = StatisticInterval.DAY; - - @Override - public JobDetail buildJobDetail() { - return JobBuilder.newJob(this.getClass()).withIdentity(getJobName()).build(); - } - - @Override - public Trigger buildTrigger() { - return TriggerBuilder.newTrigger() - .withIdentity(getTriggerName()) - .withSchedule(CronScheduleBuilder.cronSchedule(execInterval.getCron()) - .withMisfireHandlingInstructionDoNothing()) - .build(); - } - - @Override - public Map getDataMap() { - Map result = new HashMap<>(2); - result.put("configurationService", configurationService); - result.put("repository", repository); - return result; - } - - @Override - public void execute(final JobExecutionContext context) { - Optional latestOne = repository.findLatestJobRegisterStatistics(); - latestOne.ifPresent(this::fillBlankIfNeeded); - int registeredCount = configurationService.loadAll().size(); - JobRegisterStatistics jobRegisterStatistics = new JobRegisterStatistics(registeredCount, StatisticTimeUtils.getCurrentStatisticTime(execInterval)); - log.debug("Add jobRegisterStatistics, registeredCount is:{}", registeredCount); - repository.add(jobRegisterStatistics); - } - - private void fillBlankIfNeeded(final JobRegisterStatistics latestOne) { - List blankDateRange = findBlankStatisticTimes(latestOne.getStatisticsTime(), execInterval); - if (!blankDateRange.isEmpty()) { - log.debug("Fill blank range of jobRegisterStatistics, range is:{}", blankDateRange); - } - for (Date each : blankDateRange) { - repository.add(new JobRegisterStatistics(latestOne.getRegisteredCount(), each)); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/StatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/StatisticJob.java deleted file mode 100755 index afaa8d5b5c..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/StatisticJob.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import java.util.Map; - -import org.quartz.Job; -import org.quartz.JobDetail; -import org.quartz.Trigger; - -/** - * Statistic job. - */ -public interface StatisticJob extends Job { - - /** - * Build JobDetail. - * - * @return JobDetail - */ - JobDetail buildJobDetail(); - - /** - * Build Trigger. - * - * @return Trigger - */ - Trigger buildTrigger(); - - /** - * Get data map. - * - * @return property map, key is property name, value is property instance - */ - Map getDataMap(); -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java deleted file mode 100755 index 65422fb6c8..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJob.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import lombok.AllArgsConstructor; -import lombok.NoArgsConstructor; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.TaskResultMetaData; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.quartz.CronScheduleBuilder; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobExecutionContext; -import org.quartz.Trigger; -import org.quartz.TriggerBuilder; - -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; - -/** - * Task result statistic. - */ -@Setter -@NoArgsConstructor -@AllArgsConstructor -@Slf4j -public final class TaskResultStatisticJob extends AbstractStatisticJob { - - private StatisticInterval statisticInterval; - - private TaskResultMetaData sharedData; - - private StatisticRdbRepository repository; - - @Override - public JobDetail buildJobDetail() { - JobDetail result = JobBuilder.newJob(this.getClass()).withIdentity(getJobName() + "_" + statisticInterval).build(); - result.getJobDataMap().put("statisticUnit", statisticInterval); - return result; - } - - @Override - public Trigger buildTrigger() { - return TriggerBuilder.newTrigger() - .withIdentity(getTriggerName() + "_" + statisticInterval) - .withSchedule(CronScheduleBuilder.cronSchedule(statisticInterval.getCron()) - .withMisfireHandlingInstructionDoNothing()) - .build(); - } - - @Override - public Map getDataMap() { - Map result = new HashMap<>(3); - result.put("statisticInterval", statisticInterval); - result.put("sharedData", sharedData); - result.put("repository", repository); - return result; - } - - @Override - public void execute(final JobExecutionContext context) { - Optional latestOne = repository.findLatestTaskResultStatistics(statisticInterval); - latestOne.ifPresent(this::fillBlankIfNeeded); - TaskResultStatistics taskResultStatistics = new TaskResultStatistics( - sharedData.getSuccessCount(), sharedData.getFailedCount(), statisticInterval, - StatisticTimeUtils.getCurrentStatisticTime(statisticInterval)); - log.debug("Add taskResultStatistics, statisticInterval is:{}, successCount is:{}, failedCount is:{}", - statisticInterval, sharedData.getSuccessCount(), sharedData.getFailedCount()); - repository.add(taskResultStatistics); - sharedData.reset(); - } - - private void fillBlankIfNeeded(final TaskResultStatistics latestOne) { - List blankDateRange = findBlankStatisticTimes(latestOne.getStatisticsTime(), statisticInterval); - if (!blankDateRange.isEmpty()) { - log.debug("Fill blank range of taskResultStatistics, range is:{}", blankDateRange); - } - for (Date each : blankDateRange) { - repository.add(new TaskResultStatistics(latestOne.getSuccessCount(), latestOne.getFailedCount(), statisticInterval, each)); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtils.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtils.java deleted file mode 100755 index 030eafaa17..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtils.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.util; - -import java.util.Calendar; -import java.util.Date; - -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * Statistic time utility. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class StatisticTimeUtils { - - /** - * Get the statistical time with the interval unit. - * - * @param interval interval - * @return Date - */ - public static Date getCurrentStatisticTime(final StatisticInterval interval) { - return getStatisticTime(interval, 0); - } - - /** - * Get the statistical time with the interval unit. - * - * @param interval interval - * @param offset offset - * @return Date - */ - public static Date getStatisticTime(final StatisticInterval interval, final int offset) { - Calendar calendar = Calendar.getInstance(); - calendar.set(Calendar.MILLISECOND, 0); - calendar.set(Calendar.SECOND, 0); - switch (interval) { - case DAY: - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.HOUR_OF_DAY, 0); - calendar.add(Calendar.DATE, offset); - break; - case HOUR: - calendar.set(Calendar.MINUTE, 0); - calendar.add(Calendar.HOUR_OF_DAY, offset); - break; - case MINUTE: - default: - calendar.add(Calendar.MINUTE, offset); - break; - } - return calendar.getTime(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/HttpClientUtils.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/HttpClientUtils.java deleted file mode 100644 index d48c824314..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/HttpClientUtils.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.util; - -import lombok.AccessLevel; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.exception.HttpClientException; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.Iterator; -import java.util.List; - -/** - * Http client utils. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class HttpClientUtils { - - /** - * Http get request. - * - * @param url url - * @return http result - */ - public static HttpResult httpGet(final String url) { - return httpGet(url, null, null, 3000L); - } - - /** - * Http get request. - * - * @param url url - * @param paramValues param values - * @param encoding encoding - * @param readTimeoutMilliseconds read timeout milliseconds - * @return http result - */ - public static HttpResult httpGet(final String url, final List paramValues, final String encoding, final long readTimeoutMilliseconds) { - HttpURLConnection connection = null; - try { - String encodedContent = encodingParams(paramValues, encoding); - String urlWithParam = url + (null == encodedContent ? "" : ("?" + encodedContent)); - connection = (HttpURLConnection) new URL(urlWithParam).openConnection(); - connection.setRequestMethod("GET"); - connection.setConnectTimeout((int) readTimeoutMilliseconds); - connection.setReadTimeout((int) readTimeoutMilliseconds); - connection.connect(); - String response; - if (HttpURLConnection.HTTP_OK == connection.getResponseCode()) { - response = IOUtils.toString(connection.getInputStream(), encoding); - } else { - response = IOUtils.toString(connection.getErrorStream(), encoding); - } - return new HttpResult(connection.getResponseCode(), response); - } catch (final IOException ex) { - throw new HttpClientException(ex); - } finally { - if (null != connection) { - connection.disconnect(); - } - } - } - - private static String encodingParams(final List paramValues, final String encoding) throws UnsupportedEncodingException { - if (null == paramValues || 0 == paramValues.size()) { - return null; - } - StringBuilder stringBuilder = new StringBuilder(); - for (Iterator iter = paramValues.iterator(); iter.hasNext();) { - stringBuilder.append(iter.next()).append("="); - stringBuilder.append(URLEncoder.encode(iter.next(), encoding)); - if (iter.hasNext()) { - stringBuilder.append("&"); - } - } - return stringBuilder.toString(); - } - - /** - * Http post request. - * - * @param url url - * @return http result - */ - public static HttpResult httpPost(final String url) { - return httpPost(url, null, null, 3000L); - } - - /** - * Http post request. - * - * @param url url - * @param paramValues param values - * @param encoding encoding - * @param readTimeoutMilliseconds read timeout milliseconds - * @return http result - */ - public static HttpResult httpPost(final String url, final List paramValues, final String encoding, final long readTimeoutMilliseconds) { - HttpURLConnection connection = null; - try { - connection = (HttpURLConnection) new URL(url).openConnection(); - connection.setRequestMethod("POST"); - connection.setConnectTimeout((int) readTimeoutMilliseconds); - connection.setReadTimeout((int) readTimeoutMilliseconds); - connection.setDoOutput(true); - connection.setDoInput(true); - connection.getOutputStream().write(encodingParams(paramValues, encoding).getBytes(StandardCharsets.UTF_8)); - String response; - if (HttpURLConnection.HTTP_OK == connection.getResponseCode()) { - response = IOUtils.toString(connection.getInputStream(), encoding); - } else { - response = IOUtils.toString(connection.getErrorStream(), encoding); - } - return new HttpResult(connection.getResponseCode(), response); - } catch (final IOException ex) { - throw new HttpClientException(ex); - } finally { - if (null != connection) { - connection.disconnect(); - } - } - } - - @Getter - @Setter - public static class HttpResult { - - private final int code; - - private final String content; - - public HttpResult(final int code, final String content) { - this.code = code; - this.content = content; - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtils.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtils.java deleted file mode 100644 index 4462eac99c..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.util; - -import java.io.CharArrayWriter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.io.Writer; -import java.nio.charset.StandardCharsets; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -/** - * IO utils. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class IOUtils { - - /** - * Convert InputStream to String. - * - * @param inputStream input stream - * @param encoding encoding - * @return result of the String type - * @throws IOException IOException - */ - public static String toString(final InputStream inputStream, final String encoding) throws IOException { - return (null == encoding) ? toString(new InputStreamReader(inputStream, StandardCharsets.UTF_8)) : toString(new InputStreamReader(inputStream, encoding)); - } - - /** - * Convert Reader to String. - * - * @param reader reader - * @return result of the String type - * @throws IOException IOException - */ - public static String toString(final Reader reader) throws IOException { - CharArrayWriter charArrayWriter = new CharArrayWriter(); - copy(reader, charArrayWriter); - return charArrayWriter.toString(); - } - - private static void copy(final Reader input, final Writer output) throws IOException { - char[] buffer = new char[4096]; - for (int length; (length = input.read(buffer)) >= 0;) { - output.write(buffer, 0, length); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer deleted file mode 100644 index d640130045..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.cloud.console.config.serializer.JsonResponseBodySerializer diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/conf/elasticjob-cloud-scheduler.properties b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/conf/elasticjob-cloud-scheduler.properties deleted file mode 100755 index 6f78c07d8d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/conf/elasticjob-cloud-scheduler.properties +++ /dev/null @@ -1,68 +0,0 @@ -# -# 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. -# - -# Routable IP address -hostname=127.0.0.1 - -# Username for mesos framework -user= - -# Mesos zookeeper address -mesos_url=zk://127.0.0.1:2181/mesos - -# Role for mesos framework - -#mesos_role= - -# ElasticJob-Cloud's zookeeper address -zk_servers=127.0.0.1:2181 - -# ElasticJob-Cloud's zookeeper namespace -zk_namespace=elasticjob-cloud - -# ElasticJob-Cloud's zookeeper digest -zk_digest= - -# Job rest API port -http_port=8899 - -# Max size of job accumulated -job_state_queue_size=10000 - -# Event trace rdb config - -#event_trace_rdb_driver=com.mysql.jdbc.Driver - -#event_trace_rdb_url=jdbc:mysql://localhost:3306/elastic_job_cloud_log - -#event_trace_rdb_username=root - -#event_trace_rdb_password= - -# Task reconciliation interval - -#reconcile_interval_minutes=-1 - -# Enable/Disable mesos partition aware feature - -# enable_partition_aware=false - -# Auth username -auth_username=root - -# Auth password -auth_password=pwd diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/logback.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/logback.xml deleted file mode 100755 index 3a56e58217..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/resources/logback.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - ${log.context.name} - - - - ${log.pattern} - - - - - ${log.directory}${log.context.name}-log.%d{yyyy-MM-dd}.log - ${log.maxHistory} - - - ${log.pattern} - - - - - - - 0 - ${log.async.queue.size} - - - - - - ${log.error.log.level} - - - ${log.directory}${log.context.name}-error.%d{yyyy-MM-dd}.log - ${log.maxHistory} - - - ${log.pattern} - - - - - - - - - - - - - diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java deleted file mode 100644 index 5c35d9a2c2..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/ReflectionUtils.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.elasticjob.cloud; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.SneakyThrows; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - -/** - * Reflection utilities. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ReflectionUtils { - - /** - * Set field value. - * - * @param target target object - * @param fieldName field name - * @param fieldValue field value - */ - @SneakyThrows - public static void setFieldValue(final Object target, final String fieldName, final Object fieldValue) { - Field field = target.getClass().getDeclaredField(fieldName); - field.setAccessible(true); - field.set(target, fieldValue); - } - - /** - * Set static field value. - * - * @param target target object - * @param fieldName field name - * @param fieldValue field value - */ - @SneakyThrows - public static void setStaticFieldValue(final Class target, final String fieldName, final Object fieldValue) { - Field field = target.getDeclaredField(fieldName); - field.setAccessible(true); - Field modifiers = getModifierField(); - modifiers.setAccessible(true); - modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL); - field.set(target, fieldValue); - } - - @SneakyThrows({NoSuchMethodException.class, IllegalAccessException.class, InvocationTargetException.class}) - private static Field getModifierField() { - Method getDeclaredFields0 = Class.class.getDeclaredMethod("getDeclaredFields0", boolean.class); - getDeclaredFields0.setAccessible(true); - for (Field each : (Field[]) getDeclaredFields0.invoke(Field.class, false)) { - if ("modifiers".equals(each.getName())) { - return each; - } - } - throw new UnsupportedOperationException(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java deleted file mode 100644 index 4a8dbcf237..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/AbstractCloudControllerTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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.elasticjob.cloud.console; - -import lombok.AccessLevel; -import lombok.Getter; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.console.controller.search.JobEventRdbSearch; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.RestfulServerConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.FacadeService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.ReconcileService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.master.MesosMasterServerMock; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.slave.MesosSlaveServerMock; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; -import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; -import org.apache.shardingsphere.elasticjob.restful.RestfulService; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.reset; - -@ExtendWith(MockitoExtension.class) -public abstract class AbstractCloudControllerTest { - - @Getter(AccessLevel.PROTECTED) - private static CoordinatorRegistryCenter regCenter; - - @Getter(AccessLevel.PROTECTED) - private static JobEventRdbSearch jobEventRdbSearch; - - private static ConsoleBootstrap consoleBootstrap; - - private static RestfulService masterServer; - - private static RestfulService slaveServer; - - @BeforeAll - static void setUpClass() { - initRestfulServer(); - initMesosServer(); - } - - private static void initRestfulServer() { - regCenter = mock(CoordinatorRegistryCenter.class); - jobEventRdbSearch = mock(JobEventRdbSearch.class); - SchedulerDriver schedulerDriver = mock(SchedulerDriver.class); - ProducerManager producerManager = new ProducerManager(schedulerDriver, regCenter); - producerManager.startup(); - consoleBootstrap = new ConsoleBootstrap(regCenter, new RestfulServerConfiguration(19000), - producerManager, new ReconcileService(schedulerDriver, new FacadeService(regCenter))); - consoleBootstrap.start(); - } - - private static void initMesosServer() { - MesosStateService.register("127.0.0.1", 9050); - NettyRestfulServiceConfiguration masterServerConfiguration = new NettyRestfulServiceConfiguration(9050); - masterServerConfiguration.addControllerInstances(new MesosMasterServerMock()); - masterServer = new NettyRestfulService(masterServerConfiguration); - masterServer.startup(); - NettyRestfulServiceConfiguration slaveServerConfiguration = new NettyRestfulServiceConfiguration(9051); - slaveServerConfiguration.addControllerInstances(new MesosSlaveServerMock()); - slaveServer = new NettyRestfulService(slaveServerConfiguration); - slaveServer.startup(); - } - - @AfterAll - static void tearDown() { - consoleBootstrap.stop(); - masterServer.shutdown(); - slaveServer.shutdown(); - MesosStateService.deregister(); - } - - @BeforeEach - void setUp() { - reset(regCenter); - reset(jobEventRdbSearch); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/HttpTestUtil.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/HttpTestUtil.java deleted file mode 100644 index df71491429..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/HttpTestUtil.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * 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.elasticjob.cloud.console; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.Map; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.http.HttpEntity; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.client.methods.HttpRequestBase; -import org.apache.http.client.utils.URIBuilder; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationConstants; -import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.exception.HttpClientException; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; - -/** - * Http utils. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class HttpTestUtil { - - private static final AuthenticationService AUTH_SERVICE = new AuthenticationService(); - - private static void setAuth(final HttpRequestBase httpRequestBase) { - httpRequestBase.setHeader(AuthenticationConstants.HEADER_NAME, AUTH_SERVICE.getToken()); - } - - /** - * Send post request. - * - * @param url url - * @return http status code - */ - public static int post(final String url) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - HttpPost httpPost = new HttpPost(url); - setAuth(httpPost); - return httpClient.execute(httpPost).getStatusLine().getStatusCode(); - } catch (IOException e) { - throw new HttpClientException("send a post request for '%s' failed", e, url); - } - } - - /** - * Send post request. - * - * @param url url - * @param content content - * @return http status code - */ - public static int post(final String url, final String content) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - HttpPost httpPost = new HttpPost(url); - setAuth(httpPost); - StringEntity entity = new StringEntity(content, "utf-8"); - entity.setContentEncoding("UTF-8"); - entity.setContentType("application/json"); - httpPost.setEntity(entity); - return httpClient.execute(httpPost).getStatusLine().getStatusCode(); - } catch (IOException e) { - throw new HttpClientException("send a post request for '%s' with parameter '%s' failed", e, url, content); - } - } - - /** - * Send put request. - * - * @param url url - * @param content content - * @return http status code - */ - public static int put(final String url, final String content) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - HttpPut httpPut = new HttpPut(url); - setAuth(httpPut); - StringEntity entity = new StringEntity(content, "utf-8"); - entity.setContentEncoding("UTF-8"); - entity.setContentType("application/json"); - httpPut.setEntity(entity); - return httpClient.execute(httpPut).getStatusLine().getStatusCode(); - } catch (IOException e) { - throw new HttpClientException("send a put request for '%s' with parameter '%s' failed", e, url, content); - } - } - - /** - * Send get request. - * - * @param url url - * @return http result - */ - public static String get(final String url) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - HttpGet httpGet = new HttpGet(url); - setAuth(httpGet); - HttpEntity entity = httpClient.execute(httpGet).getEntity(); - return EntityUtils.toString(entity); - } catch (IOException e) { - throw new HttpClientException("send a get request for '%s' failed", e, url); - } - } - - /** - * Send get request. - * - * @param url url - * @param content content - * @return http result - */ - public static String get(final String url, final Map content) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - URIBuilder uriBuilder = new URIBuilder(url); - for (Map.Entry entry : content.entrySet()) { - uriBuilder.addParameter(entry.getKey(), entry.getValue()); - } - HttpGet httpGet = new HttpGet(uriBuilder.build()); - setAuth(httpGet); - HttpEntity entity = httpClient.execute(httpGet).getEntity(); - return EntityUtils.toString(entity); - } catch (IOException | URISyntaxException e) { - throw new HttpClientException("send a get request for '%s' failed", e, url); - } - } - - /** - * Send delete request. - * - * @param url url - * @return http status code - */ - public static int delete(final String url) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - HttpDelete httpDelete = new HttpDelete(url); - setAuth(httpDelete); - return httpClient.execute(httpDelete).getStatusLine().getStatusCode(); - } catch (IOException e) { - throw new HttpClientException("send a delete request for '%s' failed", e, url); - } - } - - /** - * Send post request. - * - * @param url url - * @param content content - * @return http response - */ - public static CloseableHttpResponse unauthorizedPost(final String url, final Map content) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - HttpPost httpPost = new HttpPost(url); - StringEntity entity = new StringEntity(GsonFactory.getGson().toJson(content), "utf-8"); - entity.setContentEncoding("UTF-8"); - entity.setContentType("application/json"); - httpPost.setEntity(entity); - return httpClient.execute(httpPost); - } catch (IOException e) { - throw new HttpClientException("send a post request for '%s' with parameter '%s' failed", e, url, content); - } - } - - /** - * Send get request. - * - * @param url url - * @return http status code - */ - public static int unauthorizedGet(final String url) { - try (CloseableHttpClient httpClient = HttpClients.createDefault()) { - HttpGet httpGet = new HttpGet(url); - return httpClient.execute(httpGet).getStatusLine().getStatusCode(); - } catch (IOException e) { - throw new HttpClientException("send a get request for '%s' failed", e, url); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java deleted file mode 100644 index 3980396e6c..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudAppControllerTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller; - -import org.apache.shardingsphere.elasticjob.cloud.console.AbstractCloudControllerTest; -import org.apache.shardingsphere.elasticjob.cloud.console.HttpTestUtil; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppJsonConstants; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class CloudAppControllerTest extends AbstractCloudControllerTest { - - private static final String YAML = "appCacheEnable: true\n" - + "appName: test_app\n" - + "appURL: http://localhost/app.jar\n" - + "bootstrapScript: bin/start.sh\n" - + "cpuCount: 1.0\n" - + "eventTraceSamplingCount: 0\n" - + "memoryMB: 128.0\n"; - - @Test - void assertRegister() { - when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(false); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); - verify(getRegCenter()).persist("/config/app/test_app", YAML); - } - - @Test - void assertRegisterWithExistedName() { - when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(false); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(500)); - } - - @Test - void assertRegisterWithBadRequest() { - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app", "\"{\"appName\":\"wrong_job\"}"), is(500)); - } - - @Test - void assertUpdate() { - when(getRegCenter().isExisted("/config/app/test_app")).thenReturn(true); - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - assertThat(HttpTestUtil.put("http://127.0.0.1:19000/api/app", CloudAppJsonConstants.getAppJson("test_app")), is(200)); - verify(getRegCenter()).update("/config/app/test_app", YAML); - } - - @Test - void assertDetail() { - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/test_app"), is(CloudAppJsonConstants.getAppJson("test_app"))); - verify(getRegCenter()).get("/config/app/test_app"); - } - - @Test - void assertDetailWithNotExistedJob() { - Map content = new HashMap<>(1); - content.put("appName", ""); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/notExistedJobName", content), is("")); - } - - @Test - void assertFindAllJobs() { - when(getRegCenter().isExisted("/config/app")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/config/app")).thenReturn(Collections.singletonList("test_app")); - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/list"), is("[" + CloudAppJsonConstants.getAppJson("test_app") + "]")); - verify(getRegCenter()).isExisted("/config/app"); - verify(getRegCenter()).getChildrenKeys("/config/app"); - verify(getRegCenter()).get("/config/app/test_app"); - } - - @Test - void assertDeregister() { - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - assertThat(HttpTestUtil.delete("http://127.0.0.1:19000/api/app/test_app"), is(200)); - verify(getRegCenter()).get("/config/app/test_app"); - } - - @Test - void assertIsDisabled() { - when(getRegCenter().isExisted("/state/disable/app/test_app")).thenReturn(true); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/app/test_app/disable"), is("true")); - } - - @Test - void assertDisable() { - when(getRegCenter().isExisted("/config/job")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app/test_app/disable"), is(200)); - verify(getRegCenter()).get("/config/app/test_app"); - verify(getRegCenter()).persist("/state/disable/app/test_app", "test_app"); - } - - @Test - void assertEnable() { - when(getRegCenter().isExisted("/config/job")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/app/test_app/enable"), is(200)); - verify(getRegCenter()).get("/config/app/test_app"); - verify(getRegCenter()).remove("/state/disable/app/test_app"); - } - -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java deleted file mode 100644 index 61948b1eb1..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudJobControllerTest.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller; - -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.console.AbstractCloudControllerTest; -import org.apache.shardingsphere.elasticjob.cloud.console.HttpTestUtil; -import org.apache.shardingsphere.elasticjob.cloud.console.controller.search.JobEventRdbSearch; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppJsonConstants; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverTaskInfo; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobExecutionTypeStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class CloudJobControllerTest extends AbstractCloudControllerTest { - - private static final String YAML = "appName: test_app\n" - + "cpuCount: 1.0\n" - + "cron: 0/30 * * * * ?\n" - + "description: ''\n" - + "disabled: false\n" - + "failover: true\n" - + "jobExecutionType: TRANSIENT\n" - + "jobName: test_job\n" - + "jobParameter: ''\n" - + "maxTimeDiffSeconds: 0\n" - + "memoryMB: 128.0\n" - + "misfire: true\n" - + "monitorExecution: false\n" - + "overwrite: false\n" - + "reconcileIntervalMinutes: 0\n" - + "shardingItemParameters: ''\n" - + "shardingTotalCount: 10\n"; - - @Test - void assertRegister() { - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(false); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", CloudJsonConstants.getJobJson()), is(200)); - verify(getRegCenter()).persist("/config/job/test_job", YAML); - HttpTestUtil.delete("http://127.0.0.1:19000/api/job/test_job/deregister"); - } - - @Test - void assertRegisterWithoutApp() { - when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(false); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", CloudJsonConstants.getJobJson()), is(500)); - } - - @Test - void assertRegisterWithExistedName() { - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - when(getRegCenter().get("/config/job/test_job")).thenReturn(null, CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", CloudJsonConstants.getJobJson()), is(200)); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", CloudJsonConstants.getJobJson()), is(500)); - HttpTestUtil.delete("http://127.0.0.1:19000/api/job/test_job/deregister"); - } - - @Test - void assertRegisterWithBadRequest() { - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/register", "\"{\"jobName\":\"wrong_job\"}"), is(500)); - } - - @Test - void assertUpdate() { - when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(true); - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.put("http://127.0.0.1:19000/api/job/update", CloudJsonConstants.getJobJson()), is(200)); - verify(getRegCenter()).update("/config/job/test_job", YAML); - HttpTestUtil.delete("http://127.0.0.1:19000/api/job/test_job/deregister"); - } - - @Test - void assertDeregister() { - when(getRegCenter().isExisted("/config/job/test_job")).thenReturn(false); - assertThat(HttpTestUtil.delete("http://127.0.0.1:19000/api/job/test_job/deregister"), is(200)); - verify(getRegCenter(), times(3)).get("/config/job/test_job"); - } - - @Test - void assertTriggerWithDaemonJob() { - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson(CloudJobExecutionType.DAEMON)); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/trigger", "test_job"), is(500)); - } - - @Test - void assertTriggerWithTransientJob() { - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/trigger", "test_job"), is(200)); - } - - @Test - void assertDetail() { - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/jobs/test_job"), is(CloudJsonConstants.getJobJson())); - verify(getRegCenter()).get("/config/job/test_job"); - } - - @Test - void assertFindAllJobs() { - when(getRegCenter().isExisted("/config/job")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/jobs"), is("[" + CloudJsonConstants.getJobJson() + "]")); - verify(getRegCenter()).isExisted("/config/job"); - verify(getRegCenter()).getChildrenKeys("/config/job"); - verify(getRegCenter()).get("/config/job/test_job"); - } - - @Test - void assertFindAllRunningTasks() { - RunningService runningService = new RunningService(getRegCenter()); - TaskContext actualTaskContext = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); - when(getRegCenter().get("/config/job/" + actualTaskContext.getMetaInfo().getJobName())).thenReturn(CloudJsonConstants.getJobJson()); - runningService.add(actualTaskContext); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/tasks/running"), is(HttpTestUtil.get("http://127.0.0.1:19000/api/job/tasks/running"))); - } - - @Test - void assertFindAllReadyTasks() { - when(getRegCenter().isExisted("/state/ready")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/state/ready")).thenReturn(Collections.singletonList("test_job")); - when(getRegCenter().get("/state/ready/test_job")).thenReturn("1"); - Map expectedMap = new HashMap<>(); - expectedMap.put("jobName", "test_job"); - expectedMap.put("times", "1"); - Collection> expectedResult = Collections.singletonList(expectedMap); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/tasks/ready"), is(GsonFactory.getGson().toJson(expectedResult))); - verify(getRegCenter()).isExisted("/state/ready"); - verify(getRegCenter()).getChildrenKeys("/state/ready"); - verify(getRegCenter()).get("/state/ready/test_job"); - } - - @Test - void assertFindAllFailoverTasks() { - when(getRegCenter().isExisted("/state/failover")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/state/failover")).thenReturn(Collections.singletonList("test_job")); - when(getRegCenter().getChildrenKeys("/state/failover/test_job")).thenReturn(Collections.singletonList("test_job@-@0")); - String originalTaskId = UUID.randomUUID().toString(); - when(getRegCenter().get("/state/failover/test_job/test_job@-@0")).thenReturn(originalTaskId); - FailoverTaskInfo expectedFailoverTask = new FailoverTaskInfo(TaskContext.MetaInfo.from("test_job@-@0"), originalTaskId); - Collection expectedResult = Collections.singletonList(expectedFailoverTask); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/tasks/failover"), is(GsonFactory.getGson().toJson(expectedResult))); - verify(getRegCenter()).isExisted("/state/failover"); - verify(getRegCenter()).getChildrenKeys("/state/failover"); - verify(getRegCenter()).getChildrenKeys("/state/failover/test_job"); - verify(getRegCenter()).get("/state/failover/test_job/test_job@-@0"); - } - - @Test - void assertFindJobExecutionEventsWhenNotConfigRDB() { - ReflectionUtils.setStaticFieldValue(CloudJobController.class, "jobEventRdbSearch", null); - Map query = new HashMap<>(); - query.put("per_page", "10"); - query.put("page", "1"); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/events/executions", query), is(GsonFactory.getGson().toJson(new JobEventRdbSearch.Result<>(0, - Collections.emptyList())))); - } - - @Test - void assertGetTaskResultStatistics() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results"), - is(GsonFactory.getGson().toJson(Collections.emptyList()))); - } - - @Test - void assertGetTaskResultStatisticsWithSinceParameter() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results?since=last24hours"), - is(GsonFactory.getGson().toJson(Collections.emptyList()))); - } - - @Test - void assertGetTaskResultStatisticsWithPathParameter() { - String[] parameters = {"online", "lastWeek", "lastHour", "lastMinute"}; - for (String each : parameters) { - String result = HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results/" + each); - TaskResultStatistics taskResultStatistics = GsonFactory.getGson().fromJson(result, TaskResultStatistics.class); - assertThat(taskResultStatistics.getSuccessCount(), is(0)); - assertThat(taskResultStatistics.getFailedCount(), is(0)); - } - } - - @Test - void assertGetTaskResultStatisticsWithErrorPathParameter() { - String result = HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/results/errorPath"); - TaskResultStatistics taskResultStatistics = GsonFactory.getGson().fromJson(result, TaskResultStatistics.class); - assertThat(taskResultStatistics.getSuccessCount(), is(0)); - assertThat(taskResultStatistics.getFailedCount(), is(0)); - } - - @Test - void assertGetJobExecutionTypeStatistics() { - String result = HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/executionType"); - JobExecutionTypeStatistics jobExecutionTypeStatistics = GsonFactory.getGson().fromJson(result, JobExecutionTypeStatistics.class); - assertThat(jobExecutionTypeStatistics.getDaemonJobCount(), is(0)); - assertThat(jobExecutionTypeStatistics.getTransientJobCount(), is(0)); - } - - @Test - void assertFindTaskRunningStatistics() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/running"), - is(GsonFactory.getGson().toJson(Collections.emptyList()))); - } - - @Test - void assertFindTaskRunningStatisticsWeekly() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/tasks/running?since=lastWeek"), - is(GsonFactory.getGson().toJson(Collections.emptyList()))); - } - - @Test - void assertFindJobRunningStatistics() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/running"), - is(GsonFactory.getGson().toJson(Collections.emptyList()))); - } - - @Test - void assertFindJobRunningStatisticsWeekly() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/running?since=lastWeek"), - is(GsonFactory.getGson().toJson(Collections.emptyList()))); - } - - @Test - void assertFindJobRegisterStatisticsSinceOnline() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/statistics/jobs/register"), - is(GsonFactory.getGson().toJson(Collections.emptyList()))); - } - - @Test - void assertIsDisabled() { - when(getRegCenter().isExisted("/state/disable/job/test_job")).thenReturn(true); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/job/test_job/disable"), is("true")); - } - - @Test - void assertDisable() { - when(getRegCenter().isExisted("/config/job")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/test_job/disable"), is(200)); - verify(getRegCenter()).persist("/state/disable/job/test_job", "test_job"); - } - - @Test - void assertEnable() { - when(getRegCenter().isExisted("/config/job")).thenReturn(true); - when(getRegCenter().getChildrenKeys("/config/job")).thenReturn(Collections.singletonList("test_job")); - when(getRegCenter().get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - when(getRegCenter().get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/job/test_job/enable", "test_job"), is(200)); - verify(getRegCenter()).remove("/state/disable/job/test_job"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java deleted file mode 100644 index c47b897d8a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudLoginTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller; - -import com.google.gson.JsonObject; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.util.EntityUtils; -import org.apache.shardingsphere.elasticjob.cloud.console.AbstractCloudControllerTest; -import org.apache.shardingsphere.elasticjob.cloud.console.HttpTestUtil; -import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationConstants; -import org.apache.shardingsphere.elasticjob.cloud.console.security.AuthenticationService; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -@ExtendWith(MockitoExtension.class) -class CloudLoginTest extends AbstractCloudControllerTest { - - @Test - void assertLoginSuccess() throws IOException { - Map authInfo = new HashMap<>(); - authInfo.put("username", "root"); - authInfo.put("password", "pwd"); - CloseableHttpResponse actual = HttpTestUtil.unauthorizedPost("http://127.0.0.1:19000/api/login", authInfo); - assertThat(actual.getStatusLine().getStatusCode(), is(200)); - AuthenticationService authenticationService = new AuthenticationService(); - String entity = EntityUtils.toString(actual.getEntity()); - String token = GsonFactory.getGson().fromJson(entity, JsonObject.class).get(AuthenticationConstants.HEADER_NAME).getAsString(); - assertThat(token, is(authenticationService.getToken())); - } - - @Test - void assertLoginFail() { - Map authInfo = new HashMap<>(); - authInfo.put("username", "root"); - authInfo.put("password", ""); - CloseableHttpResponse actual = HttpTestUtil.unauthorizedPost("http://127.0.0.1:19000/api/login", authInfo); - assertThat(actual.getStatusLine().getStatusCode(), is(401)); - } - - @Test - void assertUnauthorized() { - assertThat(HttpTestUtil.unauthorizedGet("http://127.0.0.1:19000/api/unauthorized"), is(401)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java deleted file mode 100644 index 95d306303a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/CloudOperationControllerTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller; - -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.console.AbstractCloudControllerTest; -import org.apache.shardingsphere.elasticjob.cloud.console.HttpTestUtil; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.HANode; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class CloudOperationControllerTest extends AbstractCloudControllerTest { - - @Test - void assertExplicitReconcile() { - ReflectionUtils.setFieldValue(new CloudOperationController(), "lastReconcileTime", 0); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/explicit", ""), is(200)); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/explicit", ""), is(500)); - } - - @Test - void assertImplicitReconcile() { - ReflectionUtils.setFieldValue(new CloudOperationController(), "lastReconcileTime", 0); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/implicit", ""), is(200)); - assertThat(HttpTestUtil.post("http://127.0.0.1:19000/api/operate/reconcile/implicit", ""), is(500)); - } - - @Test - void assertSandbox() { - when(getRegCenter().getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/operate/sandbox?appName=foo_app"), is("[{\"hostname\":\"127.0.0.1\"," - + "\"path\":\"/slaves/d8701508-41b7-471e-9b32-61cf824a660d-S0/frameworks/d8701508-41b7-471e-9b32-61cf824a660d-0000/executors/foo_app@-@" - + "d8701508-41b7-471e-9b32-61cf824a660d-S0/runs/53fb4af7-aee2-44f6-9e47-6f418d9f27e1\"}]")); - } - - @Test - void assertNoFrameworkSandbox() { - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/operate/sandbox?appName=foo_app"), is("[]")); - when(getRegCenter().getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("not-exists"); - assertThat(HttpTestUtil.get("http://127.0.0.1:19000/api/operate/sandbox?appName=foo_app"), is("[]")); - } - -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java deleted file mode 100644 index 3352a42d52..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/console/controller/search/JobEventRdbSearchTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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.elasticjob.cloud.console.controller.search; - -import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.Timestamp; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class JobEventRdbSearchTest { - - @Mock - private DataSource dataSource; - - @Mock - private PreparedStatement preparedStatement; - - // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. - @Mock(strictness = Mock.Strictness.LENIENT) - private ResultSet resultSet; - - @Mock - private Connection conn; - - private JobEventRdbSearch.Condition condition; - - private JobEventRdbSearch jobEventRdbSearch; - - @BeforeEach - void setUp() throws Exception { - jobEventRdbSearch = new JobEventRdbSearch(dataSource); - when(dataSource.getConnection()).thenReturn(conn); - when(conn.prepareStatement(any())).thenReturn(preparedStatement); - when(preparedStatement.executeQuery()).thenReturn(resultSet); - when(resultSet.getInt(1)).thenReturn(1); - when(resultSet.next()).thenReturn(true).thenReturn(true).thenReturn(false); - } - - @Test - @SneakyThrows - void assertFindJobExecutionEvents() { - when(resultSet.getString(5)).thenReturn("TestJobName"); - when(resultSet.getString(6)).thenReturn("FAILOVER"); - when(resultSet.getString(7)).thenReturn("1"); - when(resultSet.getTimestamp(8)).thenReturn(new Timestamp(System.currentTimeMillis())); - Map fields = new HashMap<>(); - fields.put("job_name", "TestJobName"); - condition = new JobEventRdbSearch.Condition(1, 10, "job_name", "ASC", new Date(), new Date(), fields); - JobEventRdbSearch.Result jobExecutionEvents = jobEventRdbSearch.findJobExecutionEvents(condition); - assertThat(jobExecutionEvents.getTotal(), is(1)); - assertThat(jobExecutionEvents.getRows().size(), is(1)); - assertThat(jobExecutionEvents.getRows().get(0).getJobName(), is("TestJobName")); - assertThat(jobExecutionEvents.getRows().get(0).getSource(), is(JobExecutionEvent.ExecutionSource.FAILOVER)); - assertThat(jobExecutionEvents.getRows().get(0).getShardingItem(), is(1)); - } - - @Test - @SneakyThrows - void assertFindJobStatusTraceEvents() { - when(resultSet.getString(2)).thenReturn("TestJobName"); - when(resultSet.getString(6)).thenReturn("LITE_EXECUTOR"); - when(resultSet.getString(9)).thenReturn("TASK_RUNNING"); - when(resultSet.getTimestamp(11)).thenReturn(new Timestamp(System.currentTimeMillis())); - Map fields = new HashMap<>(); - fields.put("job_name", "TestJobName"); - condition = new JobEventRdbSearch.Condition(0, 0, "job_name", "DESC", new Date(), new Date(), fields); - JobEventRdbSearch.Result jobStatusTraceEvents = jobEventRdbSearch.findJobStatusTraceEvents(condition); - assertThat(jobStatusTraceEvents.getTotal(), is(1)); - assertThat(jobStatusTraceEvents.getRows().size(), is(1)); - assertThat(jobStatusTraceEvents.getRows().get(0).getJobName(), is("TestJobName")); - assertThat(jobStatusTraceEvents.getRows().get(0).getSource(), is(JobStatusTraceEvent.Source.LITE_EXECUTOR)); - assertThat(jobStatusTraceEvents.getRows().get(0).getState(), is(JobStatusTraceEvent.State.TASK_RUNNING)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java deleted file mode 100644 index 29d8bd676a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationListenerTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app; - -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener; -import org.apache.mesos.Protos; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationListenerTest; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -class CloudAppConfigurationListenerTest { - - private static ZookeeperRegistryCenter regCenter; - - @Mock - private ProducerManager producerManager; - - @Mock - private MesosStateService mesosStateService; - - @InjectMocks - private CloudAppConfigurationListener cloudAppConfigurationListener; - - @BeforeEach - void setUp() { - ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "producerManager", producerManager); - ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "mesosStateService", mesosStateService); - initRegistryCenter(); - ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "regCenter", regCenter); - } - - private void initRegistryCenter() { - EmbedTestingServer.start(); - ZookeeperConfiguration configuration = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), CloudJobConfigurationListenerTest.class.getName()); - configuration.setDigest("digest:password"); - configuration.setSessionTimeoutMilliseconds(5000); - configuration.setConnectionTimeoutMilliseconds(5000); - regCenter = new ZookeeperRegistryCenter(configuration); - regCenter.init(); - } - - @Test - void assertRemoveWithInvalidPath() { - cloudAppConfigurationListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/other/test_app", null, "".getBytes()), - new ChildData("/other/test_app", null, "".getBytes())); - verify(mesosStateService, times(0)).executors(ArgumentMatchers.any()); - verify(producerManager, times(0)).sendFrameworkMessage(any(Protos.ExecutorID.class), any(Protos.SlaveID.class), any()); - } - - @Test - void assertRemoveWithNoAppNamePath() { - cloudAppConfigurationListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/config/app", null, "".getBytes()), - new ChildData("/config/app", null, "".getBytes())); - verify(mesosStateService, times(0)).executors(ArgumentMatchers.any()); - verify(producerManager, times(0)).sendFrameworkMessage(any(Protos.ExecutorID.class), any(Protos.SlaveID.class), any()); - } - - @Test - void assertRemoveApp() { - cloudAppConfigurationListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/config/app/test_app", null, "".getBytes()), - new ChildData("/config/app/test_app", null, "".getBytes())); - verify(mesosStateService).executors("test_app"); - } - - @Test - void start() { - cloudAppConfigurationListener.start(); - } - - @Test - void stop() { - regCenter.addCacheData(CloudAppConfigurationNode.ROOT); - ReflectionUtils.setFieldValue(cloudAppConfigurationListener, "regCenter", regCenter); - cloudAppConfigurationListener.stop(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java deleted file mode 100755 index bbc9dd4318..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationNodeTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app; - -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class CloudAppConfigurationNodeTest { - - @Test - void assertGetRootNodePath() { - assertThat(CloudAppConfigurationNode.getRootNodePath("test_job_app"), is("/config/app/test_job_app")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java deleted file mode 100755 index d873b22f96..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/CloudAppConfigurationServiceTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppJsonConstants; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class CloudAppConfigurationServiceTest { - - private static final String YAML = "appCacheEnable: true\n" - + "appName: test_app\n" - + "appURL: http://localhost/app.jar\n" - + "bootstrapScript: bin/start.sh\n" - + "cpuCount: 1.0\n" - + "eventTraceSamplingCount: 0\n" - + "memoryMB: 128.0\n"; - - @Mock - private CoordinatorRegistryCenter regCenter; - - @InjectMocks - private CloudAppConfigurationService configService; - - @Test - void assertAdd() { - CloudAppConfigurationPOJO appConfig = CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"); - configService.add(appConfig); - verify(regCenter).persist("/config/app/test_app", YAML); - } - - @Test - void assertUpdate() { - CloudAppConfigurationPOJO appConfig = CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"); - configService.update(appConfig); - verify(regCenter).update("/config/app/test_app", YAML); - } - - @Test - void assertLoadAllWithoutRootNode() { - when(regCenter.isExisted("/config/app")).thenReturn(false); - assertTrue(configService.loadAll().isEmpty()); - verify(regCenter).isExisted("/config/app"); - } - - @Test - void assertLoadAllWithRootNode() { - when(regCenter.isExisted("/config/app")).thenReturn(true); - when(regCenter.getChildrenKeys(CloudAppConfigurationNode.ROOT)).thenReturn(Arrays.asList("test_app_1", "test_app_2")); - when(regCenter.get("/config/app/test_app_1")).thenReturn(CloudAppJsonConstants.getAppJson("test_app_1")); - Collection actual = configService.loadAll(); - assertThat(actual.size(), is(1)); - assertThat(actual.iterator().next().getAppName(), is("test_app_1")); - verify(regCenter).isExisted("/config/app"); - verify(regCenter).getChildrenKeys("/config/app"); - verify(regCenter).get("/config/app/test_app_1"); - verify(regCenter).get("/config/app/test_app_2"); - } - - @Test - void assertLoadWithoutConfig() { - assertFalse(configService.load("test_app").isPresent()); - } - - @Test - void assertLoadWithConfig() { - when(regCenter.get("/config/app/test_app")).thenReturn(CloudAppJsonConstants.getAppJson("test_app")); - Optional actual = configService.load("test_app"); - assertTrue(actual.isPresent()); - assertThat(actual.get().getAppName(), is("test_app")); - } - - @Test - void assertRemove() { - configService.remove("test_app"); - verify(regCenter).remove("/config/app/test_app"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java deleted file mode 100644 index 366390d504..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/app/pojo/CloudAppConfigurationPOJOTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.app.pojo; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class CloudAppConfigurationPOJOTest { - - @Test - void assertToCloudAppConfiguration() { - CloudAppConfigurationPOJO pojo = new CloudAppConfigurationPOJO(); - pojo.setAppName("app"); - pojo.setAppURL("url"); - pojo.setBootstrapScript("start.sh"); - CloudAppConfiguration actual = pojo.toCloudAppConfiguration(); - assertThat(actual.getAppName(), is("app")); - assertThat(actual.getAppURL(), is("url")); - assertThat(actual.getBootstrapScript(), is("start.sh")); - assertThat(actual.getCpuCount(), is(1d)); - assertThat(actual.getMemoryMB(), is(128d)); - assertTrue(actual.isAppCacheEnable()); - assertThat(actual.getEventTraceSamplingCount(), is(0)); - } - - @Test - void assertFromCloudAppConfiguration() { - CloudAppConfigurationPOJO actual = CloudAppConfigurationPOJO.fromCloudAppConfiguration(new CloudAppConfiguration("app", "url", "start.sh")); - assertThat(actual.getAppName(), is("app")); - assertThat(actual.getAppURL(), is("url")); - assertThat(actual.getBootstrapScript(), is("start.sh")); - assertThat(actual.getCpuCount(), is(1d)); - assertThat(actual.getMemoryMB(), is(128d)); - assertTrue(actual.isAppCacheEnable()); - assertThat(actual.getEventTraceSamplingCount(), is(0)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java deleted file mode 100755 index 34bdcfba27..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationListenerTest.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.job; - -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener.Type; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collections; - -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -public class CloudJobConfigurationListenerTest { - - private static ZookeeperRegistryCenter regCenter; - - @Mock - private ProducerManager producerManager; - - @Mock - private ReadyService readyService; - - @InjectMocks - private CloudJobConfigurationListener cloudJobConfigurationListener; - - @BeforeEach - void setUp() { - ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "producerManager", producerManager); - ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "readyService", readyService); - initRegistryCenter(); - ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "regCenter", regCenter); - } - - private void initRegistryCenter() { - EmbedTestingServer.start(); - ZookeeperConfiguration configuration = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), CloudJobConfigurationListenerTest.class.getName()); - configuration.setDigest("digest:password"); - configuration.setSessionTimeoutMilliseconds(5000); - configuration.setConnectionTimeoutMilliseconds(5000); - regCenter = new ZookeeperRegistryCenter(configuration); - regCenter.init(); - } - - @Test - void assertChildEventWhenIsNotConfigPath() { - cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/other/test_job", null, "".getBytes())); - verify(producerManager, times(0)).schedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - } - - @Test - void assertChildEventWhenIsRootConfigPath() { - cloudJobConfigurationListener.event(Type.NODE_DELETED, new ChildData("/config/job", null, "".getBytes()), - new ChildData("/config/job", null, "".getBytes())); - verify(producerManager, times(0)).schedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - } - - @Test - void assertChildEventWhenStateIsAddAndIsConfigPathAndInvalidData() { - cloudJobConfigurationListener.event(Type.NODE_CREATED, null, new ChildData("/config/job/test_job", null, "".getBytes())); - verify(producerManager, times(0)).schedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - } - - @Test - void assertChildEventWhenStateIsAddAndIsConfigPath() { - cloudJobConfigurationListener.event(Type.NODE_CREATED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson().getBytes())); - verify(producerManager).schedule(ArgumentMatchers.any()); - } - - @Test - void assertChildEventWhenStateIsUpdateAndIsConfigPathAndTransientJob() { - cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson().getBytes())); - verify(readyService, times(0)).remove(Collections.singletonList("test_job")); - verify(producerManager).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertChildEventWhenStateIsUpdateAndIsConfigPathAndDaemonJob() { - cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson(CloudJobExecutionType.DAEMON).getBytes())); - verify(readyService).remove(Collections.singletonList("test_job")); - verify(producerManager).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertChildEventWhenStateIsUpdateAndIsConfigPathAndMisfireDisabled() { - cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson(false).getBytes())); - verify(readyService).setMisfireDisabled("test_job"); - verify(producerManager).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertChildEventWhenStateIsRemovedAndIsJobConfigPath() { - cloudJobConfigurationListener.event(Type.NODE_DELETED, new ChildData("/config/job/test_job", null, "".getBytes()), - new ChildData("/config/job/test_job", null, "".getBytes())); - verify(producerManager).unschedule("test_job"); - } - - @Test - void assertChildEventWhenStateIsUpdateAndIsConfigPath() { - cloudJobConfigurationListener.event(Type.NODE_CHANGED, null, new ChildData("/config/job/test_job", null, "".getBytes())); - } - - @Test - void assertStart() { - cloudJobConfigurationListener.start(); - } - - @Test - void assertStop() { - regCenter.addCacheData(CloudJobConfigurationNode.ROOT); - ReflectionUtils.setFieldValue(cloudJobConfigurationListener, "regCenter", regCenter); - cloudJobConfigurationListener.stop(); - } - -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java deleted file mode 100755 index baec18760a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationNodeTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.job; - -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class CloudJobConfigurationNodeTest { - - @Test - void assertGetRootNodePath() { - assertThat(CloudJobConfigurationNode.getRootNodePath("test_job"), is("/config/job/test_job")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java deleted file mode 100755 index 6132905c3e..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/job/CloudJobConfigurationServiceTest.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.config.job; - -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class CloudJobConfigurationServiceTest { - - private static final String YAML = "appName: test_app\n" - + "cpuCount: 1.0\n" - + "cron: 0/30 * * * * ?\n" - + "description: ''\n" - + "disabled: false\n" - + "failover: true\n" - + "jobExecutionType: TRANSIENT\n" - + "jobName: test_job\n" - + "jobParameter: ''\n" - + "maxTimeDiffSeconds: -1\n" - + "memoryMB: 128.0\n" - + "misfire: true\n" - + "monitorExecution: true\n" - + "overwrite: false\n" - + "reconcileIntervalMinutes: 10\n" - + "shardingItemParameters: ''\n" - + "shardingTotalCount: 10\n"; - - @Mock - private CoordinatorRegistryCenter regCenter; - - @InjectMocks - private CloudJobConfigurationService configService; - - @Test - void assertAdd() { - CloudJobConfigurationPOJO cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"); - configService.add(cloudJobConfig); - verify(regCenter).persist("/config/job/test_job", YAML); - } - - @Test - void assertUpdate() { - CloudJobConfigurationPOJO cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"); - configService.update(cloudJobConfig); - verify(regCenter).update("/config/job/test_job", YAML); - } - - @Test - void assertLoadAllWithoutRootNode() { - when(regCenter.isExisted("/config/job")).thenReturn(false); - assertTrue(configService.loadAll().isEmpty()); - verify(regCenter).isExisted("/config/job"); - } - - @Test - void assertLoadAllWithRootNode() { - when(regCenter.isExisted("/config/job")).thenReturn(true); - when(regCenter.getChildrenKeys(CloudJobConfigurationNode.ROOT)).thenReturn(Arrays.asList("test_job_1", "test_job_2")); - when(regCenter.get("/config/job/test_job_1")).thenReturn(CloudJsonConstants.getJobJson("test_job_1")); - Collection actual = configService.loadAll(); - assertThat(actual.size(), is(1)); - assertThat(actual.iterator().next().getJobName(), is("test_job_1")); - verify(regCenter).isExisted("/config/job"); - verify(regCenter).getChildrenKeys("/config/job"); - verify(regCenter).get("/config/job/test_job_1"); - verify(regCenter).get("/config/job/test_job_2"); - } - - @Test - void assertLoadWithoutConfig() { - assertFalse(configService.load("test_job").isPresent()); - } - - @Test - void assertLoadWithConfig() { - when(regCenter.get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson()); - Optional actual = configService.load("test_job"); - assertTrue(actual.isPresent()); - assertThat(actual.get().getJobName(), is("test_job")); - } - - @Test - void assertLoadWithSpringConfig() { - when(regCenter.get("/config/job/test_spring_job")).thenReturn(CloudJsonConstants.getSpringJobJson()); - Optional actual = configService.load("test_spring_job"); - assertTrue(actual.isPresent()); - } - - @Test - void assertRemove() { - configService.remove("test_job"); - verify(regCenter).remove("/config/job/test_job"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java deleted file mode 100755 index 35228cad2f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/JobContextTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.context; - -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class JobContextTest { - - @Test - void assertFrom() { - CloudJobConfiguration cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration(); - JobContext actual = JobContext.from(cloudJobConfig, ExecutionType.READY); - assertThat(actual.getAssignedShardingItems().size(), is(10)); - for (int i = 0; i < actual.getAssignedShardingItems().size(); i++) { - assertThat(actual.getAssignedShardingItems().get(i), is(i)); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java deleted file mode 100755 index 1fc195cfb4..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/BootstrapEnvironmentTest.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.env; - -import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.junit.jupiter.api.Test; - -import java.util.Map; -import java.util.Optional; -import java.util.Properties; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; - -class BootstrapEnvironmentTest { - - private final BootstrapEnvironment bootstrapEnvironment = BootstrapEnvironment.getINSTANCE(); - - @Test - void assertGetMesosConfiguration() { - MesosConfiguration mesosConfig = bootstrapEnvironment.getMesosConfiguration(); - assertThat(mesosConfig.getHostname(), is("localhost")); - assertThat(mesosConfig.getUser(), is("")); - assertThat(mesosConfig.getUrl(), is("zk://localhost:2181/mesos")); - } - - @Test - void assertGetZookeeperConfiguration() { - Properties properties = new Properties(); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.ZOOKEEPER_DIGEST.getKey(), "test"); - ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); - ZookeeperConfiguration zkConfig = bootstrapEnvironment.getZookeeperConfiguration(); - assertThat(zkConfig.getServerLists(), is("localhost:2181")); - assertThat(zkConfig.getNamespace(), is("elasticjob-cloud")); - assertThat(zkConfig.getDigest(), is("test")); - } - - @Test - void assertGetRestfulServerConfiguration() { - RestfulServerConfiguration restfulServerConfig = bootstrapEnvironment.getRestfulServerConfiguration(); - assertThat(restfulServerConfig.getPort(), is(8899)); - } - - @Test - void assertGetFrameworkConfiguration() { - FrameworkConfiguration frameworkConfig = bootstrapEnvironment.getFrameworkConfiguration(); - assertThat(frameworkConfig.getJobStateQueueSize(), is(10000)); - } - - @Test - void assertGetEventTraceRdbConfiguration() { - Properties properties = new Properties(); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_DRIVER.getKey(), "org.h2.Driver"); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_URL.getKey(), "jdbc:h2:mem:job_event_trace"); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_USERNAME.getKey(), "sa"); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_PASSWORD.getKey(), "password"); - ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); - bootstrapEnvironment.getTracingConfiguration().ifPresent(tracingConfig -> assertThat(tracingConfig.getTracingStorageConfiguration().getStorage(), instanceOf(BasicDataSource.class))); - } - - @Test - void assertWithoutEventTraceRdbConfiguration() { - assertFalse(bootstrapEnvironment.getTracingConfiguration().isPresent()); - } - - @Test - void assertGetEventTraceRdbConfigurationMap() { - Properties properties = new Properties(); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_DRIVER.getKey(), "org.h2.Driver"); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_URL.getKey(), "jdbc:h2:mem:job_event_trace"); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_USERNAME.getKey(), "sa"); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_PASSWORD.getKey(), "password"); - ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); - Map jobEventRdbConfigurationMap = bootstrapEnvironment.getJobEventRdbConfigurationMap(); - assertThat(jobEventRdbConfigurationMap.get(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_DRIVER.getKey()), is("org.h2.Driver")); - assertThat(jobEventRdbConfigurationMap.get(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_URL.getKey()), is("jdbc:h2:mem:job_event_trace")); - assertThat(jobEventRdbConfigurationMap.get(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_USERNAME.getKey()), is("sa")); - assertThat(jobEventRdbConfigurationMap.get(BootstrapEnvironment.EnvironmentArgument.EVENT_TRACE_RDB_PASSWORD.getKey()), is("password")); - } - - @Test - void assertReconcileConfiguration() { - FrameworkConfiguration configuration = bootstrapEnvironment.getFrameworkConfiguration(); - assertThat(configuration.getReconcileIntervalMinutes(), is(-1)); - assertFalse(configuration.isEnabledReconcile()); - Properties properties = new Properties(); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.RECONCILE_INTERVAL_MINUTES.getKey(), "0"); - ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); - configuration = bootstrapEnvironment.getFrameworkConfiguration(); - assertThat(configuration.getReconcileIntervalMinutes(), is(0)); - assertFalse(configuration.isEnabledReconcile()); - } - - @Test - void assertGetMesosRole() { - assertThat(bootstrapEnvironment.getMesosRole(), is(Optional.empty())); - Properties properties = new Properties(); - properties.setProperty(BootstrapEnvironment.EnvironmentArgument.MESOS_ROLE.getKey(), "0"); - ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); - assertThat(bootstrapEnvironment.getMesosRole(), is(Optional.of("0"))); - } - - @Test - void assertGetFrameworkHostPort() { - Properties properties = new Properties(); - ReflectionUtils.setFieldValue(bootstrapEnvironment, "properties", properties); - assertThat(bootstrapEnvironment.getFrameworkHostPort(), is("localhost:8899")); - } - -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java deleted file mode 100755 index 3ce7b175e8..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppConfigurationBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.fixture; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class CloudAppConfigurationBuilder { - - /** - * Create cloud app configuration. - * @param appName app name - * @return CloudAppConfiguration - */ - public static CloudAppConfigurationPOJO createCloudAppConfiguration(final String appName) { - return CloudAppConfigurationPOJO.fromCloudAppConfiguration(new CloudAppConfiguration(appName, - "http://localhost/app.jar", "bin/start.sh")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java deleted file mode 100755 index 9f34b87b59..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudAppJsonConstants.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.fixture; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class CloudAppJsonConstants { - - private static final String APP_JSON = "{\"appName\":\"%s\",\"appURL\":\"http://localhost/app.jar\",\"bootstrapScript\":\"bin/start.sh\"," - + "\"cpuCount\":1.0,\"memoryMB\":128.0,\"appCacheEnable\":true,\"eventTraceSamplingCount\":0}"; - - /** - * Get app in json format. - * @param appName app name - * @return app in json format - */ - public static String getAppJson(final String appName) { - return String.format(APP_JSON, appName); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java deleted file mode 100755 index 34efe0e146..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJobConfigurationBuilder.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.fixture; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class CloudJobConfigurationBuilder { - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @return cloud job configuration - */ - public static CloudJobConfigurationPOJO createCloudJobConfiguration(final String jobName) { - return CloudJobConfigurationPOJO.fromCloudJobConfiguration(new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, - JobConfiguration.newBuilder(jobName, 10).cron("0/30 * * * * ?").failover(true).misfire(true).build())); - } - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @param jobExecutionType job execution type - * @return cloud job configuration - */ - public static CloudJobConfigurationPOJO createCloudJobConfiguration(final String jobName, final CloudJobExecutionType jobExecutionType) { - return CloudJobConfigurationPOJO.fromCloudJobConfiguration(new CloudJobConfiguration("test_app", 1.0d, 128.0d, - jobExecutionType, JobConfiguration.newBuilder(jobName, 10).cron("0/30 * * * * ?").failover(true).misfire(true).build())); - } - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @param jobExecutionType execution type - * @param shardingTotalCount sharding total count - * @return cloud job configuration - */ - public static CloudJobConfiguration createCloudJobConfiguration(final String jobName, final CloudJobExecutionType jobExecutionType, final int shardingTotalCount) { - return new CloudJobConfiguration("test_app", 1.0d, 128.0d, jobExecutionType, - JobConfiguration.newBuilder(jobName, shardingTotalCount).cron("0/30 * * * * ?").failover(true).misfire(true).build()); - } - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @param misfire misfire - * @return cloud job configuration - */ - public static CloudJobConfigurationPOJO createCloudJobConfiguration(final String jobName, final boolean misfire) { - return CloudJobConfigurationPOJO.fromCloudJobConfiguration(new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, - JobConfiguration.newBuilder(jobName, 10).cron("0/30 * * * * ?").failover(true).misfire(misfire).build())); - } - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @param appName app name - * @return cloud job configuration - */ - public static CloudJobConfigurationPOJO createCloudJobConfiguration(final String jobName, final String appName) { - return CloudJobConfigurationPOJO.fromCloudJobConfiguration(new CloudJobConfiguration(appName, 1.0d, 128.0d, - CloudJobExecutionType.TRANSIENT, JobConfiguration.newBuilder(jobName, 10).cron("0/30 * * * * ?").failover(true).misfire(true).build())); - } - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @return cloud job configuration - */ - public static CloudJobConfigurationPOJO createOtherCloudJobConfiguration(final String jobName) { - return CloudJobConfigurationPOJO.fromCloudJobConfiguration(new CloudJobConfiguration( - "test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, JobConfiguration.newBuilder(jobName, 3).cron("0/30 * * * * ?").failover(false).misfire(true).build())); - } - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @return cloud job configuration - */ - public static CloudJobConfiguration createDataflowCloudJobConfiguration(final String jobName) { - return new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, - JobConfiguration.newBuilder(jobName, 3).cron("0/30 * * * * ?").failover(false).misfire(false).setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, Boolean.TRUE.toString()).build()); - } - - /** - * Create cloud job configuration. - * - * @param jobName job name - * @return cloud job configuration - */ - public static CloudJobConfigurationPOJO createScriptCloudJobConfiguration(final String jobName) { - return createScriptCloudJobConfiguration(jobName, 3); - } - - /** - * Create script cloud job configuration. - * - * @param jobName job name - * @param shardingTotalCount sharding total count - * @return cloud job configuration - */ - public static CloudJobConfigurationPOJO createScriptCloudJobConfiguration(final String jobName, final int shardingTotalCount) { - return CloudJobConfigurationPOJO.fromCloudJobConfiguration(new CloudJobConfiguration("test_app", 1.0d, 128.0d, CloudJobExecutionType.TRANSIENT, - JobConfiguration.newBuilder(jobName, shardingTotalCount).cron("0/30 * * * * ?").failover(false).misfire(false).setProperty(ScriptJobProperties.SCRIPT_KEY, "test.sh").build())); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJsonConstants.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJsonConstants.java deleted file mode 100755 index 8793d3b52f..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/CloudJsonConstants.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.fixture; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class CloudJsonConstants { - - private static final String JOB_JSON = "{\"appName\":\"test_app\",\"cpuCount\":1.0,\"memoryMB\":128.0," - + "\"jobExecutionType\":\"%s\",\"jobName\":\"%s\",\"cron\":\"0/30 * * * * ?\"," - + "\"shardingTotalCount\":10,\"shardingItemParameters\":\"\",\"jobParameter\":\"\",\"monitorExecution\":false," - + "\"failover\":true,\"misfire\":%s,\"maxTimeDiffSeconds\":0,\"reconcileIntervalMinutes\":0," - + "\"jobShardingStrategyType\":null,\"jobExecutorServiceHandlerType\":null,\"jobErrorHandlerType\":null," - + "\"description\":\"\",\"props\":{},\"disabled\":false,\"overwrite\":false}"; - - private static final String SPRING_JOB_JSON = "{\"jobName\":\"test_spring_job\"," - + "\"cron\":\"0/30 * * * * ?\",\"shardingTotalCount\":10,\"shardingItemParameters\":\"\",\"jobParameter\":\"\",\"failover\":true,\"misfire\":true,\"description\":\"\"," - + "\"appName\":\"test_spring_app\",\"cpuCount\":1.0,\"memoryMB\":128.0," - + "\"jobExecutionType\":\"TRANSIENT\"}"; - - /** - * Get job in json format. - * @return job in json format - */ - public static String getJobJson() { - return String.format(JOB_JSON, "TRANSIENT", "test_job", true); - } - - /** - * Get job in json format. - * @param jobName job name - * @return job in json format - */ - public static String getJobJson(final String jobName) { - return String.format(JOB_JSON, "TRANSIENT", jobName, true); - } - - /** - * Get job in json format. - * @param jobExecutionType job execution type - * @return job in json format - */ - public static String getJobJson(final CloudJobExecutionType jobExecutionType) { - return String.format(JOB_JSON, jobExecutionType.name(), "test_job", true); - } - - /** - * Get job in json format. - * @param misfire is misfire - * @return job in json format - */ - public static String getJobJson(final boolean misfire) { - return String.format(JOB_JSON, "TRANSIENT", "test_job", misfire); - } - - /** - * Get sprint job in json format. - * @return job in json format - */ - public static String getSpringJobJson() { - return SPRING_JOB_JSON; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java deleted file mode 100755 index d15e60facc..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/EmbedTestingServer.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.fixture; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.CuratorFrameworkFactory; -import org.apache.curator.framework.imps.CuratorFrameworkState; -import org.apache.curator.retry.ExponentialBackoffRetry; -import org.apache.curator.test.TestingServer; -import org.apache.zookeeper.KeeperException; - -import java.io.IOException; -import java.util.Collection; -import java.util.concurrent.TimeUnit; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@Slf4j -public final class EmbedTestingServer { - - private static final int PORT = 10181; - - private static volatile TestingServer testingServer; - - private static final Object INIT_LOCK = new Object(); - - /** - * Start embed zookeeper server. - */ - public static void start() { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); - return; - } - log.info("Starting embed zookeeper server..."); - synchronized (INIT_LOCK) { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); - return; - } - start0(); - waitTestingServerReady(); - } - } - - private static void start0() { - try { - testingServer = new TestingServer(PORT, true); - // CHECKSTYLE:OFF - } catch (final Exception ex) { - // CHECKSTYLE:ON - if (!isIgnoredException(ex)) { - throw new RuntimeException(ex); - } else { - log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); - } - } finally { - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - testingServer.close(); - } catch (final IOException ignored) { - } - log.info("Close embed zookeeper server done"); - })); - } - } - - private static void waitTestingServerReady() { - int maxRetries = 60; - try (CuratorFramework client = buildCuratorClient()) { - client.start(); - int round = 0; - while (round < maxRetries) { - try { - if (client.getZookeeperClient().isConnected()) { - log.info("client is connected"); - break; - } - if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { - CuratorFrameworkState state = client.getState(); - Collection childrenKeys = client.getChildren().forPath("/"); - log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); - break; - } - // CHECKSTYLE:OFF - } catch (final Exception ignored) { - // CHECKSTYLE:ON - } - ++round; - } - } - } - - private static CuratorFramework buildCuratorClient() { - CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); - int retryIntervalMilliseconds = 500; - int maxRetries = 3; - builder.connectString(getConnectionString()) - .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) - .namespace("test"); - builder.sessionTimeoutMs(60 * 1000); - builder.connectionTimeoutMs(500); - return builder.build(); - } - - private static boolean isIgnoredException(final Throwable cause) { - return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; - } - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java deleted file mode 100755 index f02337f4db..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TaskNode.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.fixture; - -import lombok.Builder; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; - -@Builder -public final class TaskNode { - - private static final String DELIMITER = "@-@"; - - private final String jobName; - - private final int shardingItem; - - private final ExecutionType type; - - private final String slaveId; - - private final String uuid; - - /** - * Get task node path. - * @return task node path - */ - public String getTaskNodePath() { - return String.join(DELIMITER, null == jobName ? "test_job" : jobName, String.valueOf(shardingItem)); - } - - /** - * Get task node value. - * @return task node value - */ - public String getTaskNodeValue() { - return String.join(DELIMITER, getTaskNodePath(), null == type ? ExecutionType.READY.toString() : type.toString(), null == slaveId ? "slave-S0" : slaveId, null == uuid ? "0" : uuid); - } - - /** - * Get task meta info. - * @return meta info - */ - public MetaInfo getMetaInfo() { - return MetaInfo.from(String.join(DELIMITER, "test_job", "0")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TestSimpleJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TestSimpleJob.java deleted file mode 100755 index 6d6eaadc41..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/fixture/TestSimpleJob.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.fixture; - -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; - -public final class TestSimpleJob implements SimpleJob { - - @Override - public void execute(final ShardingContext shardingContext) { - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java deleted file mode 100755 index 9a43a4171d..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/FrameworkIDServiceTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.ha; - -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class FrameworkIDServiceTest { - - @Mock - private CoordinatorRegistryCenter registryCenter; - - private FrameworkIDService frameworkIDService; - - @BeforeEach - void init() { - frameworkIDService = new FrameworkIDService(registryCenter); - } - - @Test - void assertFetch() { - when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("1"); - Optional frameworkIDOptional = frameworkIDService.fetch(); - assertTrue(frameworkIDOptional.isPresent()); - assertThat(frameworkIDOptional.get(), is("1")); - verify(registryCenter).getDirectly(HANode.FRAMEWORK_ID_NODE); - } - - @Test - void assertSave() { - when(registryCenter.isExisted(HANode.FRAMEWORK_ID_NODE)).thenReturn(false); - frameworkIDService.save("1"); - verify(registryCenter).isExisted(HANode.FRAMEWORK_ID_NODE); - verify(registryCenter).persist(HANode.FRAMEWORK_ID_NODE, "1"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java deleted file mode 100755 index a90e1a1ceb..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AppConstraintEvaluatorTest.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.gson.JsonParseException; -import com.netflix.fenzo.ConstraintEvaluator; -import com.netflix.fenzo.SchedulingResult; -import com.netflix.fenzo.TaskRequest; -import com.netflix.fenzo.TaskScheduler; -import com.netflix.fenzo.VMAssignmentResult; -import com.netflix.fenzo.VirtualMachineLease; -import com.netflix.fenzo.plugins.VMLeaseObject; -import org.apache.mesos.Protos; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService.ExecutorStateInfo; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.mockito.stubbing.Answer; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -class AppConstraintEvaluatorTest { - - private static final double SUFFICIENT_CPU = 1.0 * 13; - - private static final double INSUFFICIENT_CPU = 1.0 * 11; - - private static final double SUFFICIENT_MEM = 128.0 * 13; - - private static final double INSUFFICIENT_MEM = 128.0 * 11; - - private static FacadeService facadeService; - - private TaskScheduler taskScheduler; - - @BeforeAll - static void init() { - facadeService = mock(FacadeService.class); - AppConstraintEvaluator.init(facadeService); - } - - @BeforeEach - void setUp() { - taskScheduler = new TaskScheduler.Builder().withLeaseOfferExpirySecs(1000000000L).withLeaseRejectAction(virtualMachineLease -> { - }).build(); - } - - @AfterEach - void tearDown() { - AppConstraintEvaluator.getInstance().clearAppRunningState(); - } - - @Test - void assertFirstLaunch() { - SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, SUFFICIENT_CPU, SUFFICIENT_MEM), getLease(1, SUFFICIENT_CPU, SUFFICIENT_MEM))); - assertThat(result.getResultMap().size(), is(2)); - assertThat(result.getFailures().size(), is(0)); - assertThat(getAssignedTaskNumber(result), is(20)); - } - - @Test - void assertFirstLaunchLackCpu() { - SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, INSUFFICIENT_CPU, SUFFICIENT_MEM), getLease(1, INSUFFICIENT_CPU, SUFFICIENT_MEM))); - assertThat(result.getResultMap().size(), is(2)); - assertThat(getAssignedTaskNumber(result), is(18)); - } - - @Test - void assertFirstLaunchLackMem() { - SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, SUFFICIENT_CPU, INSUFFICIENT_MEM), getLease(1, SUFFICIENT_CPU, INSUFFICIENT_MEM))); - assertThat(result.getResultMap().size(), is(2)); - assertThat(getAssignedTaskNumber(result), is(18)); - } - - @Test - void assertExistExecutorOnS0() { - when(facadeService.loadExecutorInfo()).thenReturn(Collections.singletonList(new ExecutorStateInfo("foo-app@-@S0", "S0"))); - AppConstraintEvaluator.getInstance().loadAppRunningState(); - SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, INSUFFICIENT_CPU, INSUFFICIENT_MEM), getLease(1, INSUFFICIENT_CPU, INSUFFICIENT_MEM))); - assertThat(result.getResultMap().size(), is(2)); - assertTrue(getAssignedTaskNumber(result) > 18); - } - - @Test - void assertGetExecutorError() { - when(facadeService.loadExecutorInfo()).thenThrow(JsonParseException.class); - AppConstraintEvaluator.getInstance().loadAppRunningState(); - SchedulingResult result = taskScheduler.scheduleOnce(getTasks(), Arrays.asList(getLease(0, INSUFFICIENT_CPU, INSUFFICIENT_MEM), getLease(1, INSUFFICIENT_CPU, INSUFFICIENT_MEM))); - assertThat(result.getResultMap().size(), is(2)); - assertThat(getAssignedTaskNumber(result), is(18)); - } - - @Test - void assertLackJobConfig() { - when(facadeService.load("test")).thenReturn(Optional.empty()); - SchedulingResult result = taskScheduler.scheduleOnce(Collections.singletonList(getTask("test")), Collections.singletonList(getLease(0, 1.5, 192))); - assertThat(result.getResultMap().size(), is(1)); - assertThat(getAssignedTaskNumber(result), is(1)); - } - - @Test - void assertLackAppConfig() { - when(facadeService.load("test")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test"))); - when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.empty()); - SchedulingResult result = taskScheduler.scheduleOnce(Collections.singletonList(getTask("test")), Collections.singletonList(getLease(0, 1.5, 192))); - assertThat(result.getResultMap().size(), is(1)); - assertThat(getAssignedTaskNumber(result), is(1)); - } - - private VirtualMachineLease getLease(final int index, final double cpus, final double mem) { - return new VMLeaseObject(Protos.Offer.newBuilder() - .setId(Protos.OfferID.newBuilder().setValue("offer" + index)) - .setSlaveId(Protos.SlaveID.newBuilder().setValue("S" + index)) - .setHostname("slave" + index) - .setFrameworkId(Protos.FrameworkID.newBuilder().setValue("f1")) - .addResources(Protos.Resource.newBuilder().setName("cpus").setType(Protos.Value.Type.SCALAR).setScalar(Protos.Value.Scalar.newBuilder().setValue(cpus))) - .addResources(Protos.Resource.newBuilder().setName("mem").setType(Protos.Value.Type.SCALAR).setScalar(Protos.Value.Scalar.newBuilder().setValue(mem))) - .build()); - } - - private List getTasks() { - List result = new ArrayList<>(20); - for (int i = 0; i < 20; i++) { - String jobName; - String appName; - if (i % 2 == 0) { - jobName = String.format("foo-%d", i); - appName = "foo-app"; - } else { - jobName = String.format("bar-%d", i); - appName = "bar-app"; - } - result.add(getTask(jobName)); - when(facadeService.load(jobName)).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration(jobName, appName))); - } - when(facadeService.loadAppConfig("foo-app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("foo-app"))); - when(facadeService.loadAppConfig("bar-app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("bar-app"))); - return result; - } - - private TaskRequest getTask(final String jobName) { - TaskRequest result = mock(TaskRequest.class); - when(result.getCPUs()).thenReturn(1.0d); - when(result.getMemory()).thenReturn(128.0d); - when(result.getHardConstraints()).thenAnswer((Answer>) invocationOnMock -> Collections.singletonList(AppConstraintEvaluator.getInstance())); - when(result.getId()).thenReturn(new TaskContext(jobName, Collections.singletonList(0), ExecutionType.READY).getId()); - return result; - } - - private int getAssignedTaskNumber(final SchedulingResult schedulingResult) { - int result = 0; - for (VMAssignmentResult each : schedulingResult.getResultMap().values()) { - result += each.getTasksAssigned().size(); - } - return result; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java deleted file mode 100755 index ae00cfb4cd..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/FacadeServiceTest.java +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.collect.Sets; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.DisableAppService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class FacadeServiceTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - @Mock - private CloudAppConfigurationService appConfigService; - - @Mock - private CloudJobConfigurationService jobConfigService; - - @Mock - private ReadyService readyService; - - @Mock - private RunningService runningService; - - @Mock - private FailoverService failoverService; - - @Mock - private DisableAppService disableAppService; - - @Mock - private DisableJobService disableJobService; - - @Mock - private MesosStateService mesosStateService; - - private FacadeService facadeService; - - @BeforeEach - void setUp() { - facadeService = new FacadeService(regCenter); - ReflectionUtils.setFieldValue(facadeService, "jobConfigService", jobConfigService); - ReflectionUtils.setFieldValue(facadeService, "appConfigService", appConfigService); - ReflectionUtils.setFieldValue(facadeService, "readyService", readyService); - ReflectionUtils.setFieldValue(facadeService, "runningService", runningService); - ReflectionUtils.setFieldValue(facadeService, "failoverService", failoverService); - ReflectionUtils.setFieldValue(facadeService, "disableAppService", disableAppService); - ReflectionUtils.setFieldValue(facadeService, "disableJobService", disableJobService); - ReflectionUtils.setFieldValue(facadeService, "mesosStateService", mesosStateService); - } - - @Test - void assertStart() { - facadeService.start(); - verify(runningService).start(); - } - - @Test - void assertGetEligibleJobContext() { - Collection failoverJobContexts = Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder - .createCloudJobConfiguration("failover_job").toCloudJobConfiguration(), ExecutionType.FAILOVER)); - Collection readyJobContexts = Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder - .createCloudJobConfiguration("ready_job").toCloudJobConfiguration(), ExecutionType.READY)); - when(failoverService.getAllEligibleJobContexts()).thenReturn(failoverJobContexts); - when(readyService.getAllEligibleJobContexts(failoverJobContexts)).thenReturn(readyJobContexts); - Collection actual = facadeService.getEligibleJobContext(); - assertThat(actual.size(), is(2)); - int i = 0; - for (JobContext each : actual) { - switch (i) { - case 0: - assertThat(each.getCloudJobConfig().getJobConfig().getJobName(), is("failover_job")); - break; - case 1: - assertThat(each.getCloudJobConfig().getJobConfig().getJobName(), is("ready_job")); - break; - default: - break; - } - i++; - } - } - - @Test - void assertRemoveLaunchTasksFromQueue() { - facadeService.removeLaunchTasksFromQueue(Arrays.asList( - TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()), - TaskContext.from(TaskNode.builder().build().getTaskNodeValue()))); - verify(failoverService).remove(Collections.singletonList(MetaInfo.from(TaskNode.builder().build().getTaskNodePath()))); - verify(readyService).remove(Sets.newHashSet("test_job")); - } - - @Test - void assertAddRunning() { - TaskContext taskContext = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); - facadeService.addRunning(taskContext); - verify(runningService).add(taskContext); - } - - @Test - void assertUpdateDaemonStatus() { - TaskContext taskContext = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); - facadeService.updateDaemonStatus(taskContext, true); - verify(runningService).updateIdle(taskContext, true); - } - - @Test - void assertRemoveRunning() { - String taskNodeValue = TaskNode.builder().build().getTaskNodeValue(); - TaskContext taskContext = TaskContext.from(taskNodeValue); - facadeService.removeRunning(taskContext); - verify(runningService).remove(taskContext); - } - - @Test - void assertRecordFailoverTaskWhenJobConfigNotExisted() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(jobConfigService.load("test_job")).thenReturn(Optional.empty()); - facadeService.recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(failoverService, times(0)).add(TaskContext.from(taskNode.getTaskNodeValue())); - } - - @Test - void assertRecordFailoverTaskWhenIsFailoverDisabled() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createOtherCloudJobConfiguration("test_job"))); - facadeService.recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(failoverService, times(0)).add(TaskContext.from(taskNode.getTaskNodeValue())); - } - - @Test - void assertRecordFailoverTaskWhenIsFailoverDisabledAndIsDaemonJob() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); - facadeService.recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(failoverService).add(TaskContext.from(taskNode.getTaskNodeValue())); - } - - @Test - void assertRecordFailoverTaskWhenIsFailoverEnabled() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - TaskContext taskContext = TaskContext.from(taskNode.getTaskNodeValue()); - facadeService.recordFailoverTask(taskContext); - verify(failoverService).add(taskContext); - } - - @Test - void assertLoadAppConfig() { - Optional appConfigOptional = Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app")); - when(appConfigService.load("test_app")).thenReturn(appConfigOptional); - assertThat(facadeService.loadAppConfig("test_app"), is(appConfigOptional)); - } - - @Test - void assertLoadJobConfig() { - Optional cloudJobConfig = Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job")); - when(jobConfigService.load("test_job")).thenReturn(cloudJobConfig); - assertThat(facadeService.load("test_job"), is(cloudJobConfig)); - } - - @Test - void assertLoadAppConfigWhenAbsent() { - when(appConfigService.load("test_app")).thenReturn(Optional.empty()); - assertThat(facadeService.loadAppConfig("test_app"), is(Optional.empty())); - } - - @Test - void assertLoadJobConfigWhenAbsent() { - when(jobConfigService.load("test_job")).thenReturn(Optional.empty()); - assertThat(facadeService.load("test_job"), is(Optional.empty())); - } - - @Test - void assertAddDaemonJobToReadyQueue() { - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - facadeService.addDaemonJobToReadyQueue("test_job"); - verify(readyService).addDaemon("test_job"); - } - - @Test - void assertIsRunningForReadyJobAndNotRunning() { - when(runningService.getRunningTasks("test_job")).thenReturn(Collections.emptyList()); - assertFalse(facadeService.isRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.READY).build().getTaskNodeValue()))); - } - - @Test - void assertIsRunningForFailoverJobAndNotRunning() { - when(runningService.isTaskRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()).getMetaInfo())).thenReturn(false); - assertFalse(facadeService.isRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()))); - } - - @Test - void assertIsRunningForFailoverJobAndRunning() { - when(runningService.isTaskRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()).getMetaInfo())).thenReturn(true); - assertTrue(facadeService.isRunning(TaskContext.from(TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodeValue()))); - } - - @Test - void assertAddMapping() { - facadeService.addMapping("taskId", "localhost"); - verify(runningService).addMapping("taskId", "localhost"); - } - - @Test - void assertPopMapping() { - facadeService.popMapping("taskId"); - verify(runningService).popMapping("taskId"); - } - - @Test - void assertStop() { - facadeService.stop(); - verify(runningService).clear(); - } - - @Test - void assertGetFailoverTaskId() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - TaskContext taskContext = TaskContext.from(taskNode.getTaskNodeValue()); - facadeService.recordFailoverTask(taskContext); - verify(failoverService).add(taskContext); - facadeService.getFailoverTaskId(taskContext.getMetaInfo()); - verify(failoverService).getTaskId(taskContext.getMetaInfo()); - } - - @Test - void assertJobDisabledWhenAppEnabled() { - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - when(disableAppService.isDisabled("test_app")).thenReturn(false); - when(disableJobService.isDisabled("test_job")).thenReturn(true); - assertTrue(facadeService.isJobDisabled("test_job")); - } - - @Test - void assertIsJobEnabled() { - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - assertFalse(facadeService.isJobDisabled("test_job")); - } - - @Test - void assertIsJobDisabledWhenAppDisabled() { - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - when(disableAppService.isDisabled("test_app")).thenReturn(true); - assertTrue(facadeService.isJobDisabled("test_job")); - } - - @Test - void assertIsJobDisabledWhenAppEnabled() { - when(jobConfigService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - when(disableAppService.isDisabled("test_app")).thenReturn(false); - when(disableJobService.isDisabled("test_job")).thenReturn(true); - assertTrue(facadeService.isJobDisabled("test_job")); - } - - @Test - void assertEnableJob() { - facadeService.enableJob("test_job"); - verify(disableJobService).remove("test_job"); - } - - @Test - void assertDisableJob() { - facadeService.disableJob("test_job"); - verify(disableJobService).add("test_job"); - } - - @Test - void assertLoadExecutor() { - facadeService.loadExecutorInfo(); - verify(mesosStateService).executors(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java deleted file mode 100755 index a5d918fe89..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/JobTaskRequestTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.netflix.fenzo.TaskRequest; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.hamcrest.core.StringStartsWith; -import org.junit.jupiter.api.Test; - -import java.util.Collections; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertNull; - -class JobTaskRequestTest { - - private final JobTaskRequest jobTaskRequest = - new JobTaskRequest(new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "unassigned-slave"), - CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); - - @Test - void assertGetId() { - assertThat(jobTaskRequest.getId(), StringStartsWith.startsWith("test_job@-@0@-@READY@-@unassigned-slave")); - } - - @Test - void assertTaskGroupName() { - assertThat(jobTaskRequest.taskGroupName(), is("")); - } - - @Test - void assertGetCPUs() { - assertThat(jobTaskRequest.getCPUs(), is(1.0d)); - } - - @Test - void assertGetMemory() { - assertThat(jobTaskRequest.getMemory(), is(128.0d)); - } - - @Test - void assertGetNetworkMbps() { - assertThat(jobTaskRequest.getNetworkMbps(), is(0d)); - } - - @Test - void assertGetDisk() { - assertThat(jobTaskRequest.getDisk(), is(10d)); - } - - @Test - void assertGetPorts() { - assertThat(jobTaskRequest.getPorts(), is(1)); - } - - @Test - void assertGetScalarRequests() { - assertNull(jobTaskRequest.getScalarRequests()); - } - - @Test - void assertGetHardConstraints() { - AppConstraintEvaluator.init(null); - assertThat(jobTaskRequest.getHardConstraints().size(), is(1)); - } - - @Test - void assertGetSoftConstraints() { - assertNull(jobTaskRequest.getSoftConstraints()); - } - - @Test - void assertSetAssignedResources() { - jobTaskRequest.setAssignedResources(null); - } - - @Test - void assertGetAssignedResources() { - assertNull(jobTaskRequest.getAssignedResources()); - } - - @Test - void assertGetCustomNamedResources() { - assertThat(jobTaskRequest.getCustomNamedResources(), is(Collections.emptyMap())); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java deleted file mode 100755 index 4f57d79f20..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LaunchingTasksTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.netflix.fenzo.TaskRequest; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.List; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class LaunchingTasksTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - @Mock - private CloudJobConfigurationService jobConfigService; - - @Mock - private ReadyService readyService; - - @Mock - private RunningService runningService; - - @Mock - private FailoverService failoverService; - - private LaunchingTasks launchingTasks; - - @BeforeEach - void setUp() { - FacadeService facadeService = new FacadeService(regCenter); - ReflectionUtils.setFieldValue(facadeService, "jobConfigService", jobConfigService); - ReflectionUtils.setFieldValue(facadeService, "readyService", readyService); - ReflectionUtils.setFieldValue(facadeService, "runningService", runningService); - ReflectionUtils.setFieldValue(facadeService, "failoverService", failoverService); - when(facadeService.getEligibleJobContext()).thenReturn(Arrays.asList( - JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("ready_job").toCloudJobConfiguration(), ExecutionType.READY), - JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("failover_job").toCloudJobConfiguration(), ExecutionType.FAILOVER))); - launchingTasks = new LaunchingTasks(facadeService.getEligibleJobContext()); - } - - @Test - void assertGetPendingTasks() { - List actual = launchingTasks.getPendingTasks(); - assertThat(actual.size(), is(20)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java deleted file mode 100755 index 1b3cc80052..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/LeasesQueueTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.OfferBuilder; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class LeasesQueueTest { - - private final LeasesQueue leasesQueue = LeasesQueue.getInstance(); - - @Test - void assertOperate() { - assertTrue(leasesQueue.drainTo().isEmpty()); - leasesQueue.offer(OfferBuilder.createOffer("offer_1")); - leasesQueue.offer(OfferBuilder.createOffer("offer_2")); - assertThat(leasesQueue.drainTo().size(), is(2)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java deleted file mode 100755 index 0c7aca9588..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/MesosStateServiceTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import org.apache.shardingsphere.elasticjob.cloud.console.AbstractCloudControllerTest; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.HANode; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateService.ExecutorStateInfo; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collection; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class MesosStateServiceTest extends AbstractCloudControllerTest { - - @Mock - private CoordinatorRegistryCenter registryCenter; - - @Test - void assertSandbox() { - when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); - MesosStateService service = new MesosStateService(registryCenter); - Collection> sandbox = service.sandbox("foo_app"); - assertThat(sandbox.size(), is(1)); - assertThat(sandbox.iterator().next().get("hostname"), is("127.0.0.1")); - assertThat(sandbox.iterator().next().get("path"), is("/slaves/d8701508-41b7-471e-9b32-61cf824a660d-S0/" - + "frameworks/d8701508-41b7-471e-9b32-61cf824a660d-0000/executors/foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0/runs/53fb4af7-aee2-44f6-9e47-6f418d9f27e1")); - } - - @Test - void assertExecutors() { - when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); - MesosStateService service = new MesosStateService(registryCenter); - Collection executorStateInfo = service.executors("foo_app"); - assertThat(executorStateInfo.size(), is(1)); - ExecutorStateInfo executor = executorStateInfo.iterator().next(); - assertThat(executor.getId(), is("foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0")); - assertThat(executor.getSlaveId(), is("d8701508-41b7-471e-9b32-61cf824a660d-S0")); - } - - @Test - void assertAllExecutors() { - when(registryCenter.getDirectly(HANode.FRAMEWORK_ID_NODE)).thenReturn("d8701508-41b7-471e-9b32-61cf824a660d-0000"); - MesosStateService service = new MesosStateService(registryCenter); - Collection executorStateInfo = service.executors(); - assertThat(executorStateInfo.size(), is(1)); - ExecutorStateInfo executor = executorStateInfo.iterator().next(); - assertThat(executor.getId(), is("foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0")); - assertThat(executor.getSlaveId(), is("d8701508-41b7-471e-9b32-61cf824a660d-S0")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java deleted file mode 100755 index fbcbe0b8f8..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/ReconcileServiceTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.collect.Sets; -import org.apache.mesos.Protos; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class ReconcileServiceTest { - - @Mock - private SchedulerDriver schedulerDriver; - - @Mock - private FacadeService facadeService; - - private ReconcileService reconcileService; - - @Captor - private ArgumentCaptor> taskStatusCaptor; - - @BeforeEach - void setUp() { - reconcileService = new ReconcileService(schedulerDriver, facadeService); - } - - @Test - void assertRunOneIteration() { - reconcileService.runOneIteration(); - verify(schedulerDriver).reconcileTasks(Collections.emptyList()); - } - - @Test - void assertImplicitReconcile() { - reconcileService.implicitReconcile(); - verify(schedulerDriver).reconcileTasks(Collections.emptyList()); - } - - @Test - void assertExplicitReconcile() { - Map> runningTaskMap = new HashMap<>(); - runningTaskMap.put("transient_test_job", Sets.newHashSet( - TaskContext.from("transient_test_job@-@0@-@READY@-@SLAVE-S0@-@UUID"), TaskContext.from("transient_test_job@-@1@-@READY@-@SLAVE-S0@-@UUID"))); - when(facadeService.getAllRunningTasks()).thenReturn(runningTaskMap); - reconcileService.explicitReconcile(); - verify(schedulerDriver).reconcileTasks(taskStatusCaptor.capture()); - assertThat(taskStatusCaptor.getValue().size(), is(2)); - for (Protos.TaskStatus each : taskStatusCaptor.getValue()) { - assertThat(each.getSlaveId().getValue(), is("SLAVE-S0")); - assertThat(each.getState(), is(Protos.TaskState.TASK_RUNNING)); - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java deleted file mode 100755 index c0ba180d37..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerEngineTest.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.netflix.fenzo.TaskScheduler; -import com.netflix.fenzo.functions.Action2; -import org.apache.mesos.Protos; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.FrameworkIDService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.OfferBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.lenient; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class SchedulerEngineTest { - - @Mock - private TaskScheduler taskScheduler; - - @Mock - private FacadeService facadeService; - - @Mock - private FrameworkIDService frameworkIDService; - - @Mock - private StatisticManager statisticManager; - - private SchedulerEngine schedulerEngine; - - @BeforeEach - void setUp() { - schedulerEngine = new SchedulerEngine(taskScheduler, facadeService, new JobTracingEventBus(), frameworkIDService, statisticManager); - ReflectionUtils.setFieldValue(schedulerEngine, "facadeService", facadeService); - lenient().when(facadeService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - new RunningService(mock(CoordinatorRegistryCenter.class)).clear(); - } - - @Test - void assertRegistered() { - schedulerEngine.registered(null, Protos.FrameworkID.newBuilder().setValue("1").build(), Protos.MasterInfo.getDefaultInstance()); - verify(taskScheduler).expireAllLeases(); - verify(frameworkIDService).save("1"); - } - - @Test - void assertReregistered() { - schedulerEngine.reregistered(null, Protos.MasterInfo.getDefaultInstance()); - verify(taskScheduler).expireAllLeases(); - } - - @Test - void assertResourceOffers() { - SchedulerDriver schedulerDriver = mock(SchedulerDriver.class); - List offers = Arrays.asList(OfferBuilder.createOffer("offer_0"), OfferBuilder.createOffer("offer_1")); - schedulerEngine.resourceOffers(schedulerDriver, offers); - assertThat(LeasesQueue.getInstance().drainTo().size(), is(2)); - } - - @Test - void assertOfferRescinded() { - schedulerEngine.offerRescinded(null, Protos.OfferID.newBuilder().setValue("myOffer").build()); - verify(taskScheduler).expireLease("myOffer"); - } - - @Test - void assertRunningStatusUpdateForDaemonJobBegin() { - TaskNode taskNode = TaskNode.builder().build(); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_RUNNING).setMessage("BEGIN").setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).updateDaemonStatus(TaskContext.from(taskNode.getTaskNodeValue()), false); - } - - @Test - void assertRunningStatusUpdateForDaemonJobComplete() { - TaskNode taskNode = TaskNode.builder().build(); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_RUNNING).setMessage("COMPLETE").setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).updateDaemonStatus(TaskContext.from(taskNode.getTaskNodeValue()), true); - } - - @Test - void assertRunningStatusUpdateForOther() { - TaskNode taskNode = TaskNode.builder().build(); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_RUNNING).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService, times(0)).updateDaemonStatus(TaskContext.from(taskNode.getTaskNodeValue()), ArgumentMatchers.eq(ArgumentMatchers.anyBoolean())); - } - - @Test - void assertFinishedStatusUpdateWithoutLaunchedTasks() { - TaskNode taskNode = TaskNode.builder().build(); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_FINISHED).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskScheduler, times(0)).getTaskUnAssigner(); - } - - @Test - void assertFinishedStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_FINISHED).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - verify(statisticManager).taskRunSuccessfully(); - } - - @Test - void assertKilledStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_KILLED).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(facadeService).addDaemonJobToReadyQueue("test_job"); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - } - - @Test - void assertFailedStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_FAILED).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertErrorStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder().setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())) - .setState(Protos.TaskState.TASK_ERROR).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertLostStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() - .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_LOST).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertDroppedStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() - .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_DROPPED) - .setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertGoneStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() - .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_GONE).setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertGoneByOperatorStatusUpdate() { - @SuppressWarnings("unchecked") - Action2 taskUnAssigner = mock(Action2.class); - when(taskScheduler.getTaskUnAssigner()).thenReturn(taskUnAssigner); - TaskNode taskNode = TaskNode.builder().build(); - when(facadeService.popMapping(taskNode.getTaskNodeValue())).thenReturn("localhost"); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() - .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_GONE_BY_OPERATOR) - .setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(facadeService).recordFailoverTask(TaskContext.from(taskNode.getTaskNodeValue())); - verify(facadeService).removeRunning(TaskContext.from(taskNode.getTaskNodeValue())); - verify(taskUnAssigner).call(TaskContext.getIdForUnassignedSlave(taskNode.getTaskNodeValue()), "localhost"); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertUnknownStatusUpdate() { - TaskNode taskNode = TaskNode.builder().build(); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() - .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_UNKNOWN) - .setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertUnReachedStatusUpdate() { - TaskNode taskNode = TaskNode.builder().build(); - schedulerEngine.statusUpdate(null, Protos.TaskStatus.newBuilder() - .setTaskId(Protos.TaskID.newBuilder().setValue(taskNode.getTaskNodeValue())).setState(Protos.TaskState.TASK_UNREACHABLE) - .setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-S0")).build()); - verify(statisticManager).taskRunFailed(); - } - - @Test - void assertFrameworkMessage() { - schedulerEngine.frameworkMessage(null, null, Protos.SlaveID.newBuilder().setValue("slave-S0").build(), new byte[1]); - } - - @Test - void assertSlaveLost() { - schedulerEngine.slaveLost(null, Protos.SlaveID.newBuilder().setValue("slave-S0").build()); - verify(taskScheduler).expireAllLeasesByVMId("slave-S0"); - } - - @Test - void assertExecutorLost() { - schedulerEngine.executorLost(null, Protos.ExecutorID.newBuilder().setValue("test_job@-@0@-@00").build(), Protos.SlaveID.newBuilder().setValue("slave-S0").build(), 0); - } - - @Test - void assertError() { - schedulerEngine.error(null, null); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java deleted file mode 100755 index c06632f705..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SchedulerServiceTest.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.util.concurrent.Service; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.console.ConsoleBootstrap; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.FrameworkConfiguration; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.CloudAppDisableListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.CloudJobDisableListener; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InOrder; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.mockito.Mockito.inOrder; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class SchedulerServiceTest { - - @Mock - private BootstrapEnvironment env; - - @Mock - private CloudJobConfigurationListener cloudJobConfigurationListener; - - @Mock - private FacadeService facadeService; - - @Mock - private SchedulerDriver schedulerDriver; - - @Mock - private ProducerManager producerManager; - - @Mock - private StatisticManager statisticManager; - - @Mock - private Service taskLaunchScheduledService; - - @Mock - private ConsoleBootstrap consoleBootstrap; - - @Mock - private ReconcileService reconcileService; - - @Mock - private CloudJobDisableListener cloudJobDisableListener; - - @Mock - private CloudAppConfigurationListener cloudAppConfigurationListener; - - @Mock - private CloudAppDisableListener cloudAppDisableListener; - - private SchedulerService schedulerService; - - @BeforeEach - void setUp() { - schedulerService = new SchedulerService(env, facadeService, schedulerDriver, - producerManager, statisticManager, cloudJobConfigurationListener, - taskLaunchScheduledService, consoleBootstrap, reconcileService, cloudJobDisableListener, - cloudAppConfigurationListener, cloudAppDisableListener); - } - - @Test - void assertStart() { - setReconcileEnabled(true); - schedulerService.start(); - InOrder inOrder = getInOrder(); - inOrder.verify(facadeService).start(); - inOrder.verify(producerManager).startup(); - inOrder.verify(statisticManager).startup(); - inOrder.verify(cloudJobConfigurationListener).start(); - inOrder.verify(taskLaunchScheduledService).startAsync(); - inOrder.verify(consoleBootstrap).start(); - inOrder.verify(schedulerDriver).start(); - inOrder.verify(reconcileService).startAsync(); - } - - @Test - void assertStartWithoutReconcile() { - setReconcileEnabled(false); - schedulerService.start(); - InOrder inOrder = getInOrder(); - inOrder.verify(facadeService).start(); - inOrder.verify(producerManager).startup(); - inOrder.verify(statisticManager).startup(); - inOrder.verify(cloudJobConfigurationListener).start(); - inOrder.verify(taskLaunchScheduledService).startAsync(); - inOrder.verify(consoleBootstrap).start(); - inOrder.verify(schedulerDriver).start(); - inOrder.verify(reconcileService, never()).stopAsync(); - } - - @Test - void assertStop() { - setReconcileEnabled(true); - schedulerService.stop(); - InOrder inOrder = getInOrder(); - inOrder.verify(consoleBootstrap).stop(); - inOrder.verify(taskLaunchScheduledService).stopAsync(); - inOrder.verify(cloudJobConfigurationListener).stop(); - inOrder.verify(statisticManager).shutdown(); - inOrder.verify(producerManager).shutdown(); - inOrder.verify(schedulerDriver).stop(true); - inOrder.verify(facadeService).stop(); - inOrder.verify(reconcileService).stopAsync(); - } - - @Test - void assertStopWithoutReconcile() { - setReconcileEnabled(false); - schedulerService.stop(); - InOrder inOrder = getInOrder(); - inOrder.verify(consoleBootstrap).stop(); - inOrder.verify(taskLaunchScheduledService).stopAsync(); - inOrder.verify(cloudJobConfigurationListener).stop(); - inOrder.verify(statisticManager).shutdown(); - inOrder.verify(producerManager).shutdown(); - inOrder.verify(schedulerDriver).stop(true); - inOrder.verify(facadeService).stop(); - inOrder.verify(reconcileService, never()).stopAsync(); - } - - private InOrder getInOrder() { - return inOrder(facadeService, schedulerDriver, producerManager, - statisticManager, cloudJobConfigurationListener, taskLaunchScheduledService, consoleBootstrap, reconcileService); - } - - private void setReconcileEnabled(final boolean isEnabled) { - FrameworkConfiguration frameworkConfiguration = mock(FrameworkConfiguration.class); - when(frameworkConfiguration.isEnabledReconcile()).thenReturn(isEnabled); - when(env.getFrameworkConfiguration()).thenReturn(frameworkConfiguration); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java deleted file mode 100755 index ee31b68a9a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/SupportedExtractionTypeTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -class SupportedExtractionTypeTest { - - @Test - void assertIsExtraction() { - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tar")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tar.gz")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tar.bz2")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tar.xz")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.gz")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tgz")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.tbz2")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.txz")); - assertTrue(SupportedExtractionType.isExtraction("http://localhost:8080/test.zip")); - assertFalse(SupportedExtractionType.isExtraction("http://localhost:8080/test.sh")); - assertFalse(SupportedExtractionType.isExtraction("http://localhost:8080/test")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java deleted file mode 100755 index 7bdc6c6738..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskInfoDataTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import org.apache.commons.lang3.SerializationUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.junit.jupiter.api.Test; - -import java.util.Collections; -import java.util.Map; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -class TaskInfoDataTest { - - private final ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 3, "test_param", Collections.emptyMap()); - - @Test - void assertSerializeSimpleJob() { - TaskInfoData actual = new TaskInfoData(shardingContexts, CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job").toCloudJobConfiguration()); - assertSerialize(SerializationUtils.deserialize(actual.serialize())); - } - - @Test - void assertSerializeDataflowJob() { - TaskInfoData actual = new TaskInfoData(shardingContexts, CloudJobConfigurationBuilder.createDataflowCloudJobConfiguration("test_job")); - assertSerialize(SerializationUtils.deserialize(actual.serialize())); - } - - @Test - void assertSerializeScriptJob() { - TaskInfoData actual = new TaskInfoData(shardingContexts, CloudJobConfigurationBuilder.createScriptCloudJobConfiguration("test_job").toCloudJobConfiguration()); - assertSerialize(SerializationUtils.deserialize(actual.serialize())); - } - - private void assertSerialize(final Map expected) { - assertThat(expected.size(), is(2)); - assertNotNull(expected.get("shardingContext")); - assertNotNull(expected.get("jobConfigContext")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java deleted file mode 100755 index 8b8d1b83ac..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/TaskLaunchScheduledServiceTest.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos; - -import com.google.common.collect.Sets; -import com.google.common.util.concurrent.AbstractScheduledService.Scheduler; -import com.netflix.fenzo.SchedulingResult; -import com.netflix.fenzo.TaskAssignmentResult; -import com.netflix.fenzo.TaskScheduler; -import com.netflix.fenzo.VMAssignmentResult; -import com.netflix.fenzo.functions.Action2; -import com.netflix.fenzo.plugins.VMLeaseObject; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.OfferBuilder; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.lenient; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class TaskLaunchScheduledServiceTest { - - @Mock - private SchedulerDriver schedulerDriver; - - @Mock - private TaskScheduler taskScheduler; - - @Mock - private FacadeService facadeService; - - @Mock - private JobTracingEventBus jobTracingEventBus; - - private TaskLaunchScheduledService taskLaunchScheduledService; - - @BeforeEach - void setUp() { - lenient().when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"))); - taskLaunchScheduledService = new TaskLaunchScheduledService(schedulerDriver, taskScheduler, facadeService, jobTracingEventBus); - taskLaunchScheduledService.startUp(); - } - - @AfterEach - void tearDown() { - taskLaunchScheduledService.shutDown(); - } - - @Test - void assertRunOneIteration() { - when(facadeService.getEligibleJobContext()).thenReturn( - Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("failover_job", CloudJobExecutionType.DAEMON, 1), ExecutionType.FAILOVER))); - Map vmAssignmentResultMap = new HashMap<>(); - vmAssignmentResultMap.put("rs1", new VMAssignmentResult("localhost", Collections.singletonList(new VMLeaseObject(OfferBuilder.createOffer("offer_0"))), - Sets.newHashSet(mockTaskAssignmentResult("failover_job", ExecutionType.FAILOVER)))); - when(taskScheduler.scheduleOnce(ArgumentMatchers.anyList(), ArgumentMatchers.anyList())).thenReturn(new SchedulingResult(vmAssignmentResultMap)); - when(facadeService.load("failover_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("failover_job"))); - when(facadeService.getFailoverTaskId(any(MetaInfo.class))).thenReturn(Optional.of(String.format("%s@-@0@-@%s@-@unassigned-slave@-@0", "failover_job", ExecutionType.FAILOVER.name()))); - when(taskScheduler.getTaskAssigner()).thenReturn(mock(Action2.class)); - taskLaunchScheduledService.runOneIteration(); - verify(facadeService).removeLaunchTasksFromQueue(ArgumentMatchers.anyList()); - verify(facadeService).loadAppConfig("test_app"); - verify(jobTracingEventBus).post(ArgumentMatchers.any()); - } - - @Test - void assertRunOneIterationWithScriptJob() { - when(facadeService.getEligibleJobContext()).thenReturn( - Collections.singletonList(JobContext.from(CloudJobConfigurationBuilder.createScriptCloudJobConfiguration("script_job", 1).toCloudJobConfiguration(), ExecutionType.READY))); - Map vmAssignmentResultMap = new HashMap<>(); - vmAssignmentResultMap.put("rs1", new VMAssignmentResult("localhost", Collections.singletonList(new VMLeaseObject(OfferBuilder.createOffer("offer_0"))), - Sets.newHashSet(mockTaskAssignmentResult("script_job", ExecutionType.READY)))); - when(taskScheduler.scheduleOnce(ArgumentMatchers.anyList(), ArgumentMatchers.anyList())).thenReturn(new SchedulingResult(vmAssignmentResultMap)); - when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"))); - when(facadeService.load("script_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createScriptCloudJobConfiguration("script_job", 1))); - when(taskScheduler.getTaskAssigner()).thenReturn(mock(Action2.class)); - taskLaunchScheduledService.runOneIteration(); - verify(facadeService).removeLaunchTasksFromQueue(ArgumentMatchers.anyList()); - verify(facadeService).isRunning(TaskContext.from(String.format("%s@-@0@-@%s@-@unassigned-slave@-@0", "script_job", ExecutionType.READY))); - verify(facadeService).loadAppConfig("test_app"); - verify(jobTracingEventBus).post(ArgumentMatchers.any()); - } - - private TaskAssignmentResult mockTaskAssignmentResult(final String taskName, final ExecutionType executionType) { - TaskAssignmentResult result = mock(TaskAssignmentResult.class); - when(result.getTaskId()).thenReturn(String.format("%s@-@0@-@%s@-@unassigned-slave@-@0", taskName, executionType.name())); - return result; - } - - @Test - void assertScheduler() { - assertThat(taskLaunchScheduledService.scheduler(), instanceOf(Scheduler.class)); - } - - @Test - void assertServiceName() { - assertThat(taskLaunchScheduledService.serviceName(), is("task-launch-processor")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java deleted file mode 100755 index d6993ffeae..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/OfferBuilder.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos.fixture; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.mesos.Protos; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class OfferBuilder { - - /** - * Create offer. - * @param offerId offer id - * @return Offer - */ - public static Protos.Offer createOffer(final String offerId) { - return Protos.Offer.newBuilder() - .setId(Protos.OfferID.newBuilder().setValue(offerId)) - .setFrameworkId(Protos.FrameworkID.newBuilder().setValue("elasticjob-cloud-test").build()) - .setSlaveId(Protos.SlaveID.newBuilder().setValue("slave-" + offerId).build()) - .setHostname("localhost") - .addResources(Protos.Resource.newBuilder().setName("cpus").setType(Protos.Value.Type.SCALAR).setScalar(Protos.Value.Scalar.newBuilder().setValue(100d).build()).build()) - .addResources(Protos.Resource.newBuilder().setName("mem").setType(Protos.Value.Type.SCALAR).setScalar(Protos.Value.Scalar.newBuilder().setValue(128000d).build()).build()) - .build(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/master/MesosMasterServerMock.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/master/MesosMasterServerMock.java deleted file mode 100755 index f794e6506c..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/master/MesosMasterServerMock.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos.fixture.master; - -import org.apache.shardingsphere.elasticjob.restful.Http; -import org.apache.shardingsphere.elasticjob.restful.RestfulController; -import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; - -public class MesosMasterServerMock implements RestfulController { - - /** - * Check master server state. - * - * @return json object - */ - @Mapping(method = Http.GET, path = "/state") - public String state() { - return "{\"version\":\"1.1.0\",\"build_date\":\"2017-02-27 10:51:31\",\"build_time\":1488163891.0,\"build_user\":\"user\",\"start_time\"" - + ":1488179758.62289,\"elected_time\":1488179758.69795,\"id\":\"d8701508-41b7-471e-9b32-61cf824a660d\",\"pid\":\"master@127.0.0.1:9050\",\"hostname\":\"127.0.0.1\"," - + "\"activated_slaves\":1.0,\"deactivated_slaves\":0.0,\"leader\":\"master@127.0.0.1:9050\",\"leader_info\":{\"id\":\"d8701508-41b7-471e-9b32-61cf824a660d\"," - + "\"pid\":\"master@127.0.0.1:9050\",\"port\":9050,\"hostname\":\"127.0.0.1\"},\"flags\":{\"agent_ping_timeout\":\"15secs\",\"agent_reregister_timeout\":\"10mins\"," - + "\"allocation_interval\":\"1secs\",\"allocator\":\"HierarchicalDRF\",\"authenticate_agents\":\"false\",\"authenticate_frameworks\":\"false\"," - + "\"authenticate_http_frameworks\":\"false\",\"authenticate_http_readonly\":\"false\",\"authenticate_http_readwrite\":\"false\",\"authenticators\":\"crammd5\"," - + "\"authorizers\":\"local\",\"framework_sorter\":\"drf\",\"help\":\"false\",\"hostname_lookup\":\"true\",\"http_authenticators\":\"basic\"," - + "\"initialize_driver_logging\":\"true\",\"ip\":\"127.0.0.1\",\"log_auto_initialize\":\"true\",\"logbufsecs\":\"0\",\"logging_level\":\"INFO\",\"max_agent_ping_timeouts\":\"5\"," - + "\"max_completed_frameworks\":\"50\",\"max_completed_tasks_per_framework\":\"1000\",\"port\":\"9050\",\"quiet\":\"false\",\"quorum\":\"1\",\"recovery_agent_removal_limit\":\"100%\"," - + "\"registry\":\"replicated_log\",\"registry_fetch_timeout\":\"1mins\",\"registry_gc_interval\":\"15mins\",\"registry_max_agent_age\":\"2weeks\",\"registry_max_agent_count\"" - + ":\"102400\",\"registry_store_timeout\":\"20secs\",\"registry_strict\":\"false\",\"root_submissions\":\"true\",\"user_sorter\":\"drf\",\"version\":\"false\",\"webui_dir\":\"\\/home" - + "\\/user\\/mesos\\/mesos-1.1.0\\/build\\/..\\/src\\/webui\",\"work_dir\":\"\\/home\\/user\\/mesos\\/work-1.1.0\",\"zk\":\"zk:\\/\\/localhost:4181,\\/mesos\"," - + "\"zk_session_timeout\":\"10secs\"},\"slaves\":[{\"id\":\"d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"pid\":\"slave(1)@127.0.0.1:9051\",\"hostname\":\"127.0.0.1\"," - + "\"registered_time\":1488179768.08728,\"resources\":{\"disk\":416050.0,\"mem\":6883.0,\"gpus\":0.0,\"cpus\":4.0,\"ports\":\"[31000-32000]\"},\"used_resources\":" - + "{\"disk\":0.0,\"mem\":512.0,\"gpus\":0.0,\"cpus\":2.5},\"offered_resources\":{\"disk\":416050.0,\"mem\":6371.0,\"gpus\":0.0,\"cpus\":1.5,\"ports\":\"[31000-32000]\"}," - + "\"reserved_resources\":{},\"unreserved_resources\":{\"disk\":416050.0,\"mem\":6883.0,\"gpus\":0.0,\"cpus\":4.0,\"ports\":\"[31000-32000]\"},\"attributes\":{},\"active\":true," - + "\"version\":\"1.1.0\"}],\"frameworks\":[{\"id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"name\":\"ElasticJob-Cloud\",\"pid\":" - + "\"scheduler-da326b36-34ed-4b6e-ac40-0c936f76be4e@127.0.0.1:53639\",\"used_resources\":{\"disk\":0.0,\"mem\":512.0,\"gpus\":0.0,\"cpus\":2.5},\"offered_resources\"" - + ":{\"disk\":416050.0,\"mem\":6371.0,\"gpus\":0.0,\"cpus\":1.5,\"ports\":\"[31000-32000]\"},\"capabilities\":[],\"hostname\":\"127.0.0.1\",\"webui_url\":\"http:\\/" - + "\\/127.0.0.1:8899\",\"active\":true,\"user\":\"user\",\"failover_timeout\":604800.0,\"checkpoint\":false,\"role\":\"*\",\"registered_time\":1488179830.94584," - + "\"unregistered_time\":0.0,\"resources\":{\"disk\":416050.0,\"mem\":6883.0,\"gpus\":0.0,\"cpus\":4.0,\"ports\":\"[31000-32000]\"},\"tasks\":[{\"id\":" - + "\"cpu_job_1@-@2@-@READY@-@d8701508-41b7-471e-9b32-61cf824a660d-S0@-@a03017a7-f520-483b-afce-2a5685d0ca2e\",\"name\":\"cpu_job_1@-@2@-@READY@-@d8701508-41b7-471e-" - + "9b32-61cf824a660d-S0\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"executor_id\":\"foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"slave_id\":" - + "\"d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"state\":\"TASK_RUNNING\",\"resources\":{\"disk\":0.0,\"mem\":128.0,\"gpus\":0.0,\"cpus\":0.5},\"statuses\":[{\"state\"" - + ":\"TASK_RUNNING\",\"timestamp\":1488179870.00284,\"container_status\":{\"network_infos\":[{\"ip_addresses\":[{\"ip_address\":\"127.0.0.1\"}]}]}}]},{\"id\":" - + "\"cpu_job_1@-@0@-@READY@-@d8701508-41b7-471e-9b32-61cf824a660d-S0@-@31a2862f-c68c-448d-bbcf-8815b5c2dfef\",\"name\":\"cpu_job_1@-@0@-@READY@-@d8701508-41b7-471e-" - + "9b32-61cf824a660d-S0\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"executor_id\":\"foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"slave_id\":" - + "\"d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"state\":\"TASK_RUNNING\",\"resources\":{\"disk\":0.0,\"mem\":128.0,\"gpus\":0.0,\"cpus\":0.5},\"statuses\":[{\"state\":" - + "\"TASK_RUNNING\",\"timestamp\":1488179870.00305,\"container_status\":{\"network_infos\":[{\"ip_addresses\":[{\"ip_address\":\"127.0.0.1\"}]}]}}]},{\"id\":" - + "\"cpu_job_1@-@1@-@READY@-@d8701508-41b7-471e-9b32-61cf824a660d-S0@-@ede114f0-f2db-4bad-b0e0-e820a7d19c59\",\"name\":\"cpu_job_1@-@1@-@READY@-@d8701508-41b7-471e-" - + "9b32-61cf824a660d-S0\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"executor_id\":\"foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"slave_id\":" - + "\"d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"state\":\"TASK_RUNNING\",\"resources\":{\"disk\":0.0,\"mem\":128.0,\"gpus\":0.0,\"cpus\":0.5},\"statuses\":" - + "[{\"state\":\"TASK_RUNNING\",\"timestamp\":1488179870.00294,\"container_status\":{\"network_infos\":[{\"ip_addresses\":[{\"ip_address\":\"127.0.0.1\"}]}]}}]}]," - + "\"completed_tasks\":[],\"offers\":[{\"id\":\"d8701508-41b7-471e-9b32-61cf824a660d-O1\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"slave_id\":" - + "\"d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"resources\":{\"disk\":416050.0,\"mem\":6371.0,\"gpus\":0.0,\"cpus\":1.5,\"ports\":\"[31000-32000]\"}}],\"executors\":" - + "[{\"executor_id\":\"foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"name\":\"\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"command\":" - + "{\"shell\":true,\"value\":\"bin\\/start.sh\",\"argv\":[],\"uris\":[{\"value\":\"http:\\/\\/127.0.0.1\\/image\\/es-test-1.0.tar.gz\",\"executable\":false}]}," - + "\"resources\":{\"disk\":0.0,\"mem\":128.0,\"gpus\":0.0,\"cpus\":1.0},\"slave_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-S0\"}]}],\"completed_frameworks\":[]," - + "\"orphan_tasks\":[],\"unregistered_frameworks\":[]}"; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/slave/MesosSlaveServerMock.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/slave/MesosSlaveServerMock.java deleted file mode 100755 index 800ed86c8e..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/fixture/slave/MesosSlaveServerMock.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.mesos.fixture.slave; - -import org.apache.shardingsphere.elasticjob.restful.Http; -import org.apache.shardingsphere.elasticjob.restful.RestfulController; -import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; - -public class MesosSlaveServerMock implements RestfulController { - - /** - * Check slave server state. - * - * @return json object - */ - @Mapping(method = Http.GET, path = "/state") - public String state() { - return "{\"version\":\"1.1.0\",\"build_date\":\"2017-02-27 10:51:31\",\"build_time\":1488163891.0,\"build_user\":\"gaohon" - + "gtao\",\"start_time\":1488179767.60204,\"id\":\"d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"pid\":\"slave(1)@" - + "127.0.0.1:9051\",\"hostname\":\"127.0.0.1\",\"resources\":{\"disk\":416050.0,\"mem\":6883.0,\"gpus\":0.0,\"" - + "cpus\":4.0,\"ports\":\"[31000-32000]\"},\"reserved_resources\":{},\"unreserved_resources\":{\"disk\":416050.0,\"" - + "mem\":6883.0,\"gpus\":0.0,\"cpus\":4.0,\"ports\":\"[31000-32000]\"},\"reserved_resources_full\":{},\"attributes\"" - + ":{},\"master_hostname\":\"127.0.0.1\",\"flags\":{\"appc_simple_discovery_uri_prefix\":\"http:\\/\\/\",\"appc_" - + "store_dir\":\"\\/tmp\\/mesos\\/store\\/appc\",\"authenticate_http_readonly\":\"false\",\"authenticate_http_readw" - + "rite\":\"false\",\"authenticatee\":\"crammd5\",\"authentication_backoff_factor\":\"1secs\",\"authorizer\":\"local\"" - + ",\"cgroups_cpu_enable_pids_and_tids_count\":\"false\",\"cgroups_enable_cfs\":\"false\",\"cgroups_hierarchy\":\"" - + "\\/sys\\/fs\\/cgroup\",\"cgroups_limit_swap\":\"false\",\"cgroups_root\":\"mesos\",\"container_disk_watch_interva" - + "l\":\"15secs\",\"containerizers\":\"mesos\",\"default_role\":\"*\",\"disk_watch_interval\":\"1mins\",\"docker\":\"dock" - + "er\",\"docker_kill_orphans\":\"true\",\"docker_registry\":\"https:\\/\\/registry-1.docker.io\",\"docker_remove_d" - + "elay\":\"6hrs\",\"docker_socket\":\"\\/var\\/run\\/docker.sock\",\"docker_stop_timeout\":\"0ns\",\"docker_store_dir" - + "\":\"\\/tmp\\/mesos\\/store\\/docker\",\"docker_volume_checkpoint_dir\":\"\\/var\\/run\\/mesos\\/isolators\\/docker" - + "\\/volume\",\"enforce_container_disk_quota\":\"false\",\"executor_registration_timeout\":\"1mins\",\"executor_s" - + "hutdown_grace_period\":\"5secs\",\"fetcher_cache_dir\":\"\\/tmp\\/mesos\\/fetch\",\"fetcher_cache_size\":\"2GB\",\"" - + "frameworks_home\":\"\",\"gc_delay\":\"1weeks\",\"gc_disk_headroom\":\"0.1\",\"hadoop_home\":\"\",\"help\":\"false\",\"ho" - + "stname_lookup\":\"true\",\"http_authenticators\":\"basic\",\"http_command_executor\":\"false\",\"image_provision" - + "er_backend\":\"copy\",\"initialize_driver_logging\":\"true\",\"ip\":\"127.0.0.1\",\"isolation\":\"cgroups\\/cpu" - + ",cgroups\\/mem\",\"launcher\":\"linux\",\"launcher_dir\":\"\\/home\\/user\\/mesos\\/mesos-1.1.0\\/build\\/src" - + "\",\"logbufsecs\":\"0\",\"logging_level\":\"INFO\",\"master\":\"zk:\\/\\/localhost:4181,\\/mesos\",\"max_completed_ex" - + "ecutors_per_framework\":\"150\",\"oversubscribed_resources_interval\":\"15secs\",\"perf_duration\":\"10secs\",\"" - + "perf_interval\":\"1mins\",\"port\":\"9051\",\"qos_correction_interval_min\":\"0ns\",\"quiet\":\"false\",\"recover\":\"" - + "reconnect\",\"recovery_timeout\":\"15mins\",\"registration_backoff_factor\":\"1secs\",\"revocable_cpu_low_prio" - + "rity\":\"true\",\"runtime_dir\":\"\\/var\\/run\\/mesos\",\"sandbox_directory\":\"\\/mnt\\/mesos\\/sandbox\",\"strict\":" - + "\"true\",\"switch_user\":\"true\",\"systemd_enable_support\":\"true\",\"systemd_runtime_directory\":\"\\/run\\/syst" - + "emd\\/system\",\"version\":\"false\",\"work_dir\":\"\\/home\\/user\\/mesos\\/work-1.1.0\"},\"frameworks\":[{\"i" - + "d\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"name\":\"ElasticJob-Cloud\",\"user\":\"user\",\"failo" - + "ver_timeout\":604800.0,\"checkpoint\":false,\"role\":\"*\",\"hostname\":\"127.0.0.1\",\"executors\":[{\"id\":\"" - + "foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"name\":\"\",\"source\":\"\",\"container\":\"53fb4af7-aee2-" - + "44f6-9e47-6f418d9f27e1\",\"directory\":\"\\/home\\/user\\/mesos\\/work-1.1.0\\/slaves\\/d8701508-41b7-47" - + "1e-9b32-61cf824a660d-S0\\/frameworks\\/d8701508-41b7-471e-9b32-61cf824a660d-0000\\/executors\\/foo_app@-" - + "@d8701508-41b7-471e-9b32-61cf824a660d-S0\\/runs\\/53fb4af7-aee2-44f6-9e47-6f418d9f27e1\",\"resources\":{\"" - + "disk\":0.0,\"mem\":512.0,\"gpus\":0.0,\"cpus\":2.5},\"tasks\":[{\"id\":\"cpu_job_1@-@1@-@READY@-@d8701508-41b7-4" - + "71e-9b32-61cf824a660d-S0@-@ede114f0-f2db-4bad-b0e0-e820a7d19c59\",\"name\":\"cpu_job_1@-@1@-@READY@-@d87" - + "01508-41b7-471e-9b32-61cf824a660d-S0\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"ex" - + "ecutor_id\":\"foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"slave_id\":\"d8701508-41b7-471e-9b32-6" - + "1cf824a660d-S0\",\"state\":\"TASK_RUNNING\",\"resources\":{\"disk\":0.0,\"mem\":128.0,\"gpus\":0.0,\"cpus\":0.5},\"s" - + "tatuses\":[{\"state\":\"TASK_RUNNING\",\"timestamp\":1488186955.00194,\"container_status\":{\"network_infos\":[" - + "{\"ip_addresses\":[{\"ip_address\":\"127.0.0.1\"}]}]}}]},{\"id\":\"cpu_job_1@-@0@-@READY@-@d8701508-41b7-" - + "471e-9b32-61cf824a660d-S0@-@31a2862f-c68c-448d-bbcf-8815b5c2dfef\",\"name\":\"cpu_job_1@-@0@-@READY@-@d8" - + "701508-41b7-471e-9b32-61cf824a660d-S0\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"e" - + "xecutor_id\":\"foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"slave_id\":\"d8701508-41b7-471e-9b32-" - + "61cf824a660d-S0\",\"state\":\"TASK_RUNNING\",\"resources\":{\"disk\":0.0,\"mem\":128.0,\"gpus\":0.0,\"cpus\":0.5},\"" - + "statuses\":[{\"state\":\"TASK_RUNNING\",\"timestamp\":1488186955.00214,\"container_status\":{\"network_infos\":" - + "[{\"ip_addresses\":[{\"ip_address\":\"127.0.0.1\"}]}]}}]},{\"id\":\"cpu_job_1@-@2@-@READY@-@d8701508-41b7" - + "-471e-9b32-61cf824a660d-S0@-@a03017a7-f520-483b-afce-2a5685d0ca2e\",\"name\":\"cpu_job_1@-@2@-@READY@-@d" - + "8701508-41b7-471e-9b32-61cf824a660d-S0\",\"framework_id\":\"d8701508-41b7-471e-9b32-61cf824a660d-0000\",\"" - + "executor_id\":\"foo_app@-@d8701508-41b7-471e-9b32-61cf824a660d-S0\",\"slave_id\":\"d8701508-41b7-471e-9b32" - + "-61cf824a660d-S0\",\"state\":\"TASK_RUNNING\",\"resources\":{\"disk\":0.0,\"mem\":128.0,\"gpus\":0.0,\"cpus\":0.5}," - + "\"statuses\":[{\"state\":\"TASK_RUNNING\",\"timestamp\":1488186955.00174,\"container_status\":{\"network_infos\"" - + ":[{\"ip_addresses\":[{\"ip_address\":\"127.0.0.1\"}]}]}}]}],\"queued_tasks\":[],\"completed_tasks\":[]}],\"" - + "completed_executors\":[]}],\"completed_frameworks\":[]}"; - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java deleted file mode 100755 index b9ab1cd5e5..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerJobTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.producer; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.JobBuilder; -import org.quartz.JobExecutionContext; -import org.quartz.JobKey; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class ProducerJobTest { - - @Mock - private JobExecutionContext jobExecutionContext; - - @Mock - private ReadyService readyService; - - private final TransientProducerRepository repository = new TransientProducerRepository(); - - private TransientProducerScheduler.ProducerJob producerJob; - - @BeforeEach - void setUp() { - producerJob = new TransientProducerScheduler.ProducerJob(); - producerJob.setRepository(repository); - producerJob.setReadyService(readyService); - } - - @Test - void assertExecute() { - when(jobExecutionContext.getJobDetail()).thenReturn(JobBuilder.newJob(TransientProducerScheduler.ProducerJob.class).withIdentity("0/30 * * * * ?").build()); - repository.put(JobKey.jobKey("0/30 * * * * ?"), "test_job"); - producerJob.execute(jobExecutionContext); - verify(readyService).addTransient("test_job"); - repository.remove("test_job"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java deleted file mode 100755 index 285a705dcf..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.producer; - -import org.apache.mesos.Protos; -import org.apache.mesos.SchedulerDriver; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.pojo.CloudAppConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.exception.AppConfigurationException; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class ProducerManagerTest { - - @Mock - private SchedulerDriver schedulerDriver; - - @Mock - private CoordinatorRegistryCenter regCenter; - - @Mock - private CloudAppConfigurationService appConfigService; - - @Mock - private CloudJobConfigurationService configService; - - @Mock - private ReadyService readyService; - - @Mock - private RunningService runningService; - - @Mock - private DisableJobService disableJobService; - - @Mock - private TransientProducerScheduler transientProducerScheduler; - - private ProducerManager producerManager; - - private final CloudAppConfigurationPOJO appConfig = CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app"); - - private final CloudJobConfigurationPOJO transientJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("transient_test_job"); - - private final CloudJobConfigurationPOJO daemonJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("daemon_test_job", CloudJobExecutionType.DAEMON); - - @BeforeEach - void setUp() { - producerManager = new ProducerManager(schedulerDriver, regCenter); - ReflectionUtils.setFieldValue(producerManager, "appConfigService", appConfigService); - ReflectionUtils.setFieldValue(producerManager, "configService", configService); - ReflectionUtils.setFieldValue(producerManager, "readyService", readyService); - ReflectionUtils.setFieldValue(producerManager, "runningService", runningService); - ReflectionUtils.setFieldValue(producerManager, "disableJobService", disableJobService); - ReflectionUtils.setFieldValue(producerManager, "transientProducerScheduler", transientProducerScheduler); - } - - @Test - void assertStartup() { - when(configService.loadAll()).thenReturn(Arrays.asList(transientJobConfig, daemonJobConfig)); - producerManager.startup(); - verify(configService).loadAll(); - verify(transientProducerScheduler).register(transientJobConfig); - verify(readyService).addDaemon("daemon_test_job"); - } - - @Test - void assertRegisterJobWithoutApp() { - assertThrows(AppConfigurationException.class, () -> { - when(appConfigService.load("test_app")).thenReturn(Optional.empty()); - producerManager.register(transientJobConfig); - }); - } - - @Test - void assertRegisterExistedJob() { - assertThrows(JobConfigurationException.class, () -> { - when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); - when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); - producerManager.register(transientJobConfig); - }); - } - - @Test - void assertRegisterDisabledJob() { - assertThrows(JobConfigurationException.class, () -> { - when(disableJobService.isDisabled("transient_test_job")).thenReturn(true); - producerManager.register(transientJobConfig); - }); - } - - @Test - void assertRegisterTransientJob() { - when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); - when(configService.load("transient_test_job")).thenReturn(Optional.empty()); - producerManager.register(transientJobConfig); - verify(configService).add(transientJobConfig); - verify(transientProducerScheduler).register(transientJobConfig); - } - - @Test - void assertRegisterDaemonJob() { - when(appConfigService.load("test_app")).thenReturn(Optional.of(appConfig)); - when(configService.load("daemon_test_job")).thenReturn(Optional.empty()); - producerManager.register(daemonJobConfig); - verify(configService).add(daemonJobConfig); - verify(readyService).addDaemon("daemon_test_job"); - } - - @Test - void assertUpdateNotExisted() { - assertThrows(JobConfigurationException.class, () -> { - when(configService.load("transient_test_job")).thenReturn(Optional.empty()); - producerManager.update(transientJobConfig); - }); - } - - @Test - void assertUpdateExisted() { - when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); - List taskContexts = Arrays.asList( - TaskContext.from("transient_test_job@-@0@-@READY@-@SLAVE-S0@-@UUID"), TaskContext.from("transient_test_job@-@1@-@READY@-@SLAVE-S0@-@UUID")); - when(runningService.getRunningTasks("transient_test_job")).thenReturn(taskContexts); - producerManager.update(transientJobConfig); - verify(configService).update(transientJobConfig); - for (TaskContext each : taskContexts) { - verify(schedulerDriver).killTask(Protos.TaskID.newBuilder().setValue(each.getId()).build()); - } - verify(runningService).remove("transient_test_job"); - verify(readyService).remove(Collections.singletonList("transient_test_job")); - } - - @Test - void assertDeregisterNotExisted() { - when(configService.load("transient_test_job")).thenReturn(Optional.empty()); - producerManager.deregister("transient_test_job"); - verify(configService, times(0)).remove("transient_test_job"); - } - - @Test - void assertDeregisterExisted() { - when(configService.load("transient_test_job")).thenReturn(Optional.of(transientJobConfig)); - List taskContexts = Arrays.asList( - TaskContext.from("transient_test_job@-@0@-@READY@-@SLAVE-S0@-@UUID"), TaskContext.from("transient_test_job@-@1@-@READY@-@SLAVE-S0@-@UUID")); - when(runningService.getRunningTasks("transient_test_job")).thenReturn(taskContexts); - producerManager.deregister("transient_test_job"); - for (TaskContext each : taskContexts) { - verify(schedulerDriver).killTask(Protos.TaskID.newBuilder().setValue(each.getId()).build()); - } - verify(disableJobService).remove("transient_test_job"); - verify(configService).remove("transient_test_job"); - verify(runningService).remove("transient_test_job"); - verify(readyService).remove(Collections.singletonList("transient_test_job")); - } - - @Test - void assertShutdown() { - producerManager.shutdown(); - verify(transientProducerScheduler).shutdown(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java deleted file mode 100755 index 70a82a3a8a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerRepositoryTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.producer; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.JobKey; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - -@ExtendWith(MockitoExtension.class) -class TransientProducerRepositoryTest { - - private final JobKey jobKey = JobKey.jobKey("0/45 * * * * ?"); - - private final String jobName = "test_job"; - - private final TransientProducerRepository transientProducerRepository = new TransientProducerRepository(); - - @Test - void assertPutJobKey() { - transientProducerRepository.put(jobKey, jobName); - assertThat(transientProducerRepository.get(jobKey).get(0), is(jobName)); - transientProducerRepository.remove(jobName); - } - - @Test - void assertPutJobWithChangedCron() { - transientProducerRepository.put(jobKey, jobName); - JobKey newJobKey = JobKey.jobKey("0/15 * * * * ?"); - transientProducerRepository.put(newJobKey, jobName); - assertTrue(transientProducerRepository.get(jobKey).isEmpty()); - assertThat(transientProducerRepository.get(newJobKey).get(0), is(jobName)); - transientProducerRepository.remove(jobName); - } - - @Test - void assertPutMoreJobWithChangedCron() { - String jobName2 = "other_test_job"; - transientProducerRepository.put(jobKey, jobName); - transientProducerRepository.put(jobKey, jobName2); - JobKey newJobKey = JobKey.jobKey("0/15 * * * * ?"); - transientProducerRepository.put(newJobKey, jobName); - assertThat(transientProducerRepository.get(jobKey).get(0), is(jobName2)); - assertThat(transientProducerRepository.get(newJobKey).get(0), is(jobName)); - transientProducerRepository.remove(jobName); - transientProducerRepository.remove(jobName2); - } - - @Test - void assertRemoveJobKey() { - transientProducerRepository.put(jobKey, jobName); - transientProducerRepository.remove(jobName); - assertTrue(transientProducerRepository.get(jobKey).isEmpty()); - } - - @Test - void assertContainsKey() { - transientProducerRepository.put(jobKey, jobName); - assertTrue(transientProducerRepository.containsKey(jobKey)); - transientProducerRepository.remove(jobName); - assertFalse(transientProducerRepository.containsKey(jobKey)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java deleted file mode 100755 index 80c7214196..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerSchedulerTest.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.producer; - -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.pojo.CloudJobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.CronScheduleBuilder; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.Trigger; -import org.quartz.TriggerBuilder; -import org.quartz.TriggerKey; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class TransientProducerSchedulerTest { - - @Mock - private ReadyService readyService; - - @Mock - private Scheduler scheduler; - - private TransientProducerScheduler transientProducerScheduler; - - private final CloudJobConfigurationPOJO cloudJobConfig = CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"); - - private final JobDetail jobDetail = JobBuilder.newJob(TransientProducerScheduler.ProducerJob.class).withIdentity(cloudJobConfig.getCron()).build(); - - private final Trigger trigger = TriggerBuilder.newTrigger().withIdentity(cloudJobConfig.getCron()) - .withSchedule(CronScheduleBuilder.cronSchedule(cloudJobConfig.getCron()) - .withMisfireHandlingInstructionDoNothing()) - .build(); - - @BeforeEach - void setUp() { - transientProducerScheduler = new TransientProducerScheduler(readyService); - ReflectionUtils.setFieldValue(transientProducerScheduler, "scheduler", scheduler); - } - - @Test - void assertRegister() throws SchedulerException { - when(scheduler.checkExists(jobDetail.getKey())).thenReturn(false); - transientProducerScheduler.register(cloudJobConfig); - verify(scheduler).checkExists(jobDetail.getKey()); - verify(scheduler).scheduleJob(jobDetail, trigger); - } - - @Test - void assertDeregister() throws SchedulerException { - transientProducerScheduler.deregister(cloudJobConfig); - verify(scheduler).unscheduleJob(TriggerKey.triggerKey(cloudJobConfig.getCron())); - } - - @Test - void assertShutdown() throws SchedulerException { - transientProducerScheduler.shutdown(); - verify(scheduler).isShutdown(); - verify(scheduler).shutdown(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java deleted file mode 100644 index 1c385a8455..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/CloudAppDisableListenerTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.app; - -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationListenerTest; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -public class CloudAppDisableListenerTest { - - private static ZookeeperRegistryCenter regCenter; - - @Mock - private ProducerManager producerManager; - - @Mock - private CloudJobConfigurationService jobConfigService; - - @InjectMocks - private CloudAppDisableListener cloudAppDisableListener; - - @BeforeEach - void setUp() { - ReflectionUtils.setFieldValue(cloudAppDisableListener, "producerManager", producerManager); - initRegistryCenter(); - ReflectionUtils.setFieldValue(cloudAppDisableListener, "regCenter", regCenter); - ReflectionUtils.setFieldValue(cloudAppDisableListener, "jobConfigService", jobConfigService); - } - - private void initRegistryCenter() { - EmbedTestingServer.start(); - ZookeeperConfiguration configuration = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), CloudJobConfigurationListenerTest.class.getName()); - configuration.setDigest("digest:password"); - configuration.setSessionTimeoutMilliseconds(5000); - configuration.setConnectionTimeoutMilliseconds(5000); - regCenter = new ZookeeperRegistryCenter(configuration); - regCenter.init(); - } - - @Test - void assertDisableWithInvalidPath() { - cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/other/test_app", null, "".getBytes())); - verify(jobConfigService, times(0)).loadAll(); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - } - - @Test - void assertDisableWithNoAppNamePath() { - cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/app", null, "".getBytes())); - verify(jobConfigService, times(0)).loadAll(); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - } - - @Test - void assertDisable() { - cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/app/app_test", null, "".getBytes())); - verify(jobConfigService).loadAll(); - } - - @Test - void assertEnableWithInvalidPath() { - cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/other/test_app", null, "".getBytes()), - new ChildData("/other/test_app", null, "".getBytes())); - verify(jobConfigService, times(0)).loadAll(); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertEnableWithNoAppNamePath() { - cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/app", null, "".getBytes()), - new ChildData("/state/disable/app", null, "".getBytes())); - verify(jobConfigService, times(0)).loadAll(); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - } - - @Test - void assertEnable() { - cloudAppDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/app/app_test", null, "".getBytes()), - new ChildData("/state/disable/app/app_test", null, "".getBytes())); - verify(jobConfigService).loadAll(); - } - - @Test - void start() { - cloudAppDisableListener.start(); - } - - @Test - void stop() { - regCenter.addCacheData("/state/disable/app"); - ReflectionUtils.setFieldValue(cloudAppDisableListener, "regCenter", regCenter); - cloudAppDisableListener.stop(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java deleted file mode 100755 index a79bfb5e3b..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppNodeTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.app; - -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class DisableAppNodeTest { - - @Test - void assertGetDisableAppNodePath() { - assertThat(DisableAppNode.getDisableAppNodePath("test_app0000000001"), is("/state/disable/app/test_app0000000001")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java deleted file mode 100755 index bdb681b181..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/app/DisableAppServiceTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.app; - -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class DisableAppServiceTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - private DisableAppService disableAppService; - - @BeforeEach - void setUp() { - disableAppService = new DisableAppService(regCenter); - } - - @Test - void assertAdd() { - disableAppService.add("test_app"); - verify(regCenter).isExisted("/state/disable/app/test_app"); - verify(regCenter).persist("/state/disable/app/test_app", "test_app"); - } - - @Test - void assertRemove() { - disableAppService.remove("test_app"); - verify(regCenter).remove("/state/disable/app/test_app"); - } - - @Test - void assertIsDisabled() { - when(regCenter.isExisted("/state/disable/app/test_app")).thenReturn(true); - assertTrue(disableAppService.isDisabled("test_app")); - verify(regCenter).isExisted("/state/disable/app/test_app"); - } - - @Test - void assertIsEnabled() { - when(regCenter.isExisted("/state/disable/app/test_app")).thenReturn(false); - assertFalse(disableAppService.isDisabled("test_app")); - verify(regCenter).isExisted("/state/disable/app/test_app"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java deleted file mode 100644 index 212ad33904..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/CloudJobDisableListenerTest.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.job; - -import org.apache.curator.framework.recipes.cache.ChildData; -import org.apache.curator.framework.recipes.cache.CuratorCacheListener; -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationListenerTest; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -class CloudJobDisableListenerTest { - - private static ZookeeperRegistryCenter regCenter; - - @Mock - private ProducerManager producerManager; - - @InjectMocks - private CloudJobDisableListener cloudJobDisableListener; - - @BeforeEach - void setUp() { - ReflectionUtils.setFieldValue(cloudJobDisableListener, "producerManager", producerManager); - initRegistryCenter(); - ReflectionUtils.setFieldValue(cloudJobDisableListener, "regCenter", regCenter); - } - - private void initRegistryCenter() { - EmbedTestingServer.start(); - ZookeeperConfiguration configuration = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), CloudJobConfigurationListenerTest.class.getName()); - configuration.setDigest("digest:password"); - configuration.setSessionTimeoutMilliseconds(5000); - configuration.setConnectionTimeoutMilliseconds(5000); - regCenter = new ZookeeperRegistryCenter(configuration); - regCenter.init(); - } - - @Test - void assertDisableWithInvalidPath() { - cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/other/test_job", null, "".getBytes())); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertDisableWithNoJobNamePath() { - cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/job", null, "".getBytes())); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertDisable() { - cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_CREATED, null, new ChildData("/state/disable/job/job_test", null, "".getBytes())); - verify(producerManager).unschedule(eq("job_test")); - } - - @Test - void assertEnableWithInvalidPath() { - cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/other/test_job", null, "".getBytes()), - new ChildData("/other/test_job", null, "".getBytes())); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertEnableWithNoJobNamePath() { - cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/job", null, "".getBytes()), - new ChildData("/state/disable/job", null, "".getBytes())); - verify(producerManager, times(0)).unschedule(ArgumentMatchers.any()); - verify(producerManager, times(0)).reschedule(ArgumentMatchers.any()); - } - - @Test - void assertEnable() { - cloudJobDisableListener.event(CuratorCacheListener.Type.NODE_DELETED, new ChildData("/state/disable/job/job_test", null, "".getBytes()), - new ChildData("/state/disable/job/job_test", null, "".getBytes())); - verify(producerManager).reschedule(eq("job_test")); - } - - @Test - void assertStart() { - cloudJobDisableListener.start(); - } - - @Test - void assertStop() { - regCenter.addCacheData("/state/disable/job"); - ReflectionUtils.setFieldValue(cloudJobDisableListener, "regCenter", regCenter); - cloudJobDisableListener.stop(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java deleted file mode 100755 index a4f5a4b193..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobNodeTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.job; - -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class DisableJobNodeTest { - - @Test - void assertGetDisableAppNodePath() { - assertThat(DisableJobNode.getDisableJobNodePath("test_job0000000001"), is("/state/disable/job/test_job0000000001")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java deleted file mode 100755 index bbac784d71..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/disable/job/DisableJobServiceTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.disable.job; - -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class DisableJobServiceTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - private DisableJobService disableJobService; - - @BeforeEach - void setUp() { - disableJobService = new DisableJobService(regCenter); - } - - @Test - void assertAdd() { - disableJobService.add("test_job"); - verify(regCenter).isExisted("/state/disable/job/test_job"); - verify(regCenter).persist("/state/disable/job/test_job", "test_job"); - } - - @Test - void assertRemove() { - disableJobService.remove("test_job"); - verify(regCenter).remove("/state/disable/job/test_job"); - } - - @Test - void assertIsDisabled() { - when(regCenter.isExisted("/state/disable/job/test_job")).thenReturn(true); - assertTrue(disableJobService.isDisabled("test_job")); - verify(regCenter).isExisted("/state/disable/job/test_job"); - } - - @Test - void assertIsEnabled() { - when(regCenter.isExisted("/state/disable/job/test_job")).thenReturn(false); - assertFalse(disableJobService.isDisabled("test_job")); - verify(regCenter).isExisted("/state/disable/job/test_job"); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java deleted file mode 100755 index e6443690bc..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverNodeTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.failover; - -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class FailoverNodeTest { - - @Test - void assertGetFailoverJobNodePath() { - assertThat(FailoverNode.getFailoverJobNodePath("test_job"), is("/state/failover/test_job")); - } - - @Test - void assertGetFailoverTaskNodePath() { - String jobNodePath = TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodePath(); - assertThat(FailoverNode.getFailoverTaskNodePath(jobNodePath), is("/state/failover/test_job/" + jobNodePath)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java deleted file mode 100755 index 7fa55733a0..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/failover/FailoverServiceTest.java +++ /dev/null @@ -1,219 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.failover; - -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class FailoverServiceTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - @Mock - private CloudJobConfigurationService configService; - - @Mock - private RunningService runningService; - - private FailoverService failoverService; - - @BeforeEach - void setUp() { - failoverService = new FailoverService(regCenter); - ReflectionUtils.setFieldValue(failoverService, "configService", configService); - ReflectionUtils.setFieldValue(failoverService, "runningService", runningService); - } - - @Test - void assertAddWhenJobIsOverQueueSize() { - when(regCenter.getNumChildren(FailoverNode.ROOT)).thenReturn(BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration().getJobStateQueueSize() + 1); - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); - verify(regCenter, times(0)).persist("/state/failover/test_job/" + taskNode.getTaskNodePath(), taskNode.getTaskNodeValue()); - } - - @Test - void assertAddWhenExisted() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(true); - failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); - verify(regCenter).isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath()); - verify(regCenter, times(0)).persist("/state/failover/test_job/" + taskNode.getTaskNodePath(), taskNode.getTaskNodeValue()); - } - - @Test - void assertAddWhenNotExistedAndTaskIsRunning() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(false); - when(runningService.isTaskRunning(MetaInfo.from(taskNode.getTaskNodePath()))).thenReturn(true); - failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); - verify(regCenter).isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath()); - verify(runningService).isTaskRunning(MetaInfo.from(taskNode.getTaskNodePath())); - verify(regCenter, times(0)).persist("/state/failover/test_job/" + taskNode.getTaskNodePath(), taskNode.getTaskNodeValue()); - } - - @Test - void assertAddWhenNotExistedAndTaskIsNotRunning() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(false); - when(runningService.isTaskRunning(MetaInfo.from(taskNode.getTaskNodePath()))).thenReturn(false); - failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); - verify(regCenter).isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath()); - verify(runningService).isTaskRunning(MetaInfo.from(taskNode.getTaskNodePath())); - verify(regCenter).persist("/state/failover/test_job/" + taskNode.getTaskNodePath(), taskNode.getTaskNodeValue()); - } - - @Test - void assertGetAllEligibleJobContextsWithoutRootNode() { - when(regCenter.isExisted("/state/failover")).thenReturn(false); - assertTrue(failoverService.getAllEligibleJobContexts().isEmpty()); - verify(regCenter).isExisted("/state/failover"); - } - - @Test - void assertGetAllEligibleJobContextsWithRootNode() { - when(regCenter.isExisted("/state/failover")).thenReturn(true); - when(regCenter.getChildrenKeys("/state/failover")).thenReturn(Arrays.asList("task_empty_job", "not_existed_job", "eligible_job")); - when(regCenter.getChildrenKeys("/state/failover/task_empty_job")).thenReturn(Collections.emptyList()); - when(regCenter.getChildrenKeys("/state/failover/not_existed_job")).thenReturn(Arrays.asList( - TaskNode.builder().jobName("not_existed_job").build().getTaskNodePath(), TaskNode.builder().jobName("not_existed_job").shardingItem(1).build().getTaskNodePath())); - String eligibleJobNodePath1 = TaskNode.builder().jobName("eligible_job").build().getTaskNodePath(); - String eligibleJobNodePath2 = TaskNode.builder().jobName("eligible_job").shardingItem(1).build().getTaskNodePath(); - when(regCenter.getChildrenKeys("/state/failover/eligible_job")).thenReturn(Arrays.asList(eligibleJobNodePath1, eligibleJobNodePath2)); - when(configService.load("not_existed_job")).thenReturn(Optional.empty()); - when(configService.load("eligible_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("eligible_job"))); - when(runningService.isTaskRunning(MetaInfo.from(eligibleJobNodePath1))).thenReturn(true); - when(runningService.isTaskRunning(MetaInfo.from(eligibleJobNodePath2))).thenReturn(false); - Collection actual = failoverService.getAllEligibleJobContexts(); - assertThat(actual.size(), is(1)); - assertThat(actual.iterator().next().getAssignedShardingItems().size(), is(1)); - assertThat(actual.iterator().next().getAssignedShardingItems().get(0), is(1)); - verify(regCenter).isExisted("/state/failover"); - verify(regCenter).remove("/state/failover/task_empty_job"); - verify(regCenter).remove("/state/failover/not_existed_job"); - } - - @Test - void assertRemove() { - String jobNodePath1 = TaskNode.builder().type(ExecutionType.FAILOVER).build().getTaskNodePath(); - String jobNodePath2 = TaskNode.builder().shardingItem(1).type(ExecutionType.FAILOVER).build().getTaskNodePath(); - failoverService.remove(Arrays.asList(MetaInfo.from(jobNodePath1), MetaInfo.from(jobNodePath2))); - verify(regCenter).remove("/state/failover/test_job/" + jobNodePath1); - verify(regCenter).remove("/state/failover/test_job/" + jobNodePath2); - } - - @Test - void assertGetTaskId() { - TaskNode taskNode = TaskNode.builder().type(ExecutionType.FAILOVER).build(); - failoverService.add(TaskContext.from(taskNode.getTaskNodeValue())); - when(regCenter.isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(true); - when(regCenter.get("/state/failover/test_job/" + taskNode.getTaskNodePath())).thenReturn(taskNode.getTaskNodeValue()); - Optional taskId = failoverService.getTaskId(taskNode.getMetaInfo()); - assertTrue(taskId.isPresent()); - assertThat(taskId.get(), is(taskNode.getTaskNodeValue())); - verify(regCenter, times(2)).isExisted("/state/failover/test_job/" + taskNode.getTaskNodePath()); - } - - @Test - void assertGetAllFailoverTasksWithoutRootNode() { - when(regCenter.isExisted(FailoverNode.ROOT)).thenReturn(false); - assertTrue(failoverService.getAllFailoverTasks().isEmpty()); - verify(regCenter).isExisted(FailoverNode.ROOT); - } - - @Test - void assertGetAllFailoverTasksWhenRootNodeHasNoChild() { - when(regCenter.isExisted(FailoverNode.ROOT)).thenReturn(true); - when(regCenter.getChildrenKeys(FailoverNode.ROOT)).thenReturn(Collections.emptyList()); - assertTrue(failoverService.getAllFailoverTasks().isEmpty()); - verify(regCenter).isExisted(FailoverNode.ROOT); - verify(regCenter).getChildrenKeys(FailoverNode.ROOT); - } - - @Test - void assertGetAllFailoverTasksWhenJobNodeHasNoChild() { - when(regCenter.isExisted(FailoverNode.ROOT)).thenReturn(true); - when(regCenter.getChildrenKeys(FailoverNode.ROOT)).thenReturn(Collections.singletonList("test_job")); - when(regCenter.getChildrenKeys(FailoverNode.getFailoverJobNodePath("test_job"))).thenReturn(Collections.emptyList()); - assertTrue(failoverService.getAllFailoverTasks().isEmpty()); - verify(regCenter).isExisted(FailoverNode.ROOT); - verify(regCenter).getChildrenKeys(FailoverNode.ROOT); - verify(regCenter).getChildrenKeys(FailoverNode.getFailoverJobNodePath("test_job")); - } - - @Test - void assertGetAllFailoverTasksWithRootNode() { - String uuid1 = UUID.randomUUID().toString(); - String uuid2 = UUID.randomUUID().toString(); - String uuid3 = UUID.randomUUID().toString(); - when(regCenter.isExisted(FailoverNode.ROOT)).thenReturn(true); - when(regCenter.getChildrenKeys(FailoverNode.ROOT)).thenReturn(Arrays.asList("test_job_1", "test_job_2")); - when(regCenter.getChildrenKeys(FailoverNode.getFailoverJobNodePath("test_job_1"))).thenReturn(Arrays.asList("test_job_1@-@0", "test_job_1@-@1")); - when(regCenter.getChildrenKeys(FailoverNode.getFailoverJobNodePath("test_job_2"))).thenReturn(Collections.singletonList("test_job_2@-@0")); - when(regCenter.get(FailoverNode.getFailoverTaskNodePath("test_job_1@-@0"))).thenReturn(uuid1); - when(regCenter.get(FailoverNode.getFailoverTaskNodePath("test_job_1@-@1"))).thenReturn(uuid2); - when(regCenter.get(FailoverNode.getFailoverTaskNodePath("test_job_2@-@0"))).thenReturn(uuid3); - Map> result = failoverService.getAllFailoverTasks(); - assertThat(result.size(), is(2)); - assertThat(result.get("test_job_1").size(), is(2)); - assertThat(result.get("test_job_1").toArray(new FailoverTaskInfo[]{})[0].getTaskInfo().toString(), is("test_job_1@-@0")); - assertThat(result.get("test_job_1").toArray(new FailoverTaskInfo[]{})[0].getOriginalTaskId(), is(uuid1)); - assertThat(result.get("test_job_1").toArray(new FailoverTaskInfo[]{})[1].getTaskInfo().toString(), is("test_job_1@-@1")); - assertThat(result.get("test_job_1").toArray(new FailoverTaskInfo[]{})[1].getOriginalTaskId(), is(uuid2)); - assertThat(result.get("test_job_2").size(), is(1)); - assertThat(result.get("test_job_2").iterator().next().getTaskInfo().toString(), is("test_job_2@-@0")); - assertThat(result.get("test_job_2").iterator().next().getOriginalTaskId(), is(uuid3)); - verify(regCenter).isExisted(FailoverNode.ROOT); - verify(regCenter).getChildrenKeys(FailoverNode.ROOT); - verify(regCenter).getChildrenKeys(FailoverNode.getFailoverJobNodePath("test_job_1")); - verify(regCenter).getChildrenKeys(FailoverNode.getFailoverJobNodePath("test_job_2")); - verify(regCenter).get(FailoverNode.getFailoverTaskNodePath("test_job_1@-@0")); - verify(regCenter).get(FailoverNode.getFailoverTaskNodePath("test_job_1@-@1")); - verify(regCenter).get(FailoverNode.getFailoverTaskNodePath("test_job_2@-@0")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java deleted file mode 100755 index aa59c75ad5..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyNodeTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.ready; - -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class ReadyNodeTest { - - @Test - void assertGetReadyJobNodePath() { - assertThat(ReadyNode.getReadyJobNodePath("test_job0000000001"), is("/state/ready/test_job0000000001")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java deleted file mode 100755 index bf03950ca1..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/ready/ReadyServiceTest.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.ready; - -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class ReadyServiceTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - @Mock - private CloudJobConfigurationService configService; - - @Mock - private RunningService runningService; - - private ReadyService readyService; - - @BeforeEach - void setUp() { - readyService = new ReadyService(regCenter); - ReflectionUtils.setFieldValue(readyService, "configService", configService); - ReflectionUtils.setFieldValue(readyService, "runningService", runningService); - } - - @Test - void assertAddTransientWithJobConfigIsNotPresent() { - when(configService.load("test_job")).thenReturn(Optional.empty()); - readyService.addTransient("test_job"); - verify(regCenter, times(0)).isExisted("/state/ready"); - verify(regCenter, times(0)).persist(ArgumentMatchers.any(), ArgumentMatchers.eq("")); - } - - @Test - void assertAddTransientWithJobConfigIsNotTransient() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); - readyService.addTransient("test_job"); - verify(regCenter, times(0)).isExisted("/state/ready"); - verify(regCenter, times(0)).persist(ArgumentMatchers.any(), ArgumentMatchers.eq("")); - } - - @Test - void assertAddTransientWhenJobExistedAndEnableMisfired() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - when(regCenter.getDirectly("/state/ready/test_job")).thenReturn("1"); - readyService.addTransient("test_job"); - verify(regCenter).persist("/state/ready/test_job", "2"); - } - - @Test - void assertAddTransientWhenJobExistedAndDisableMisfired() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", false))); - when(regCenter.getDirectly("/state/ready/test_job")).thenReturn("1"); - readyService.addTransient("test_job"); - verify(regCenter).persist("/state/ready/test_job", "1"); - } - - @Test - void assertAddTransientWhenJobNotExisted() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - readyService.addTransient("test_job"); - verify(regCenter).persist("/state/ready/test_job", "1"); - } - - @Test - void assertAddTransientWithOverJobQueueSize() { - when(regCenter.getNumChildren(ReadyNode.ROOT)).thenReturn(BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration().getJobStateQueueSize() + 1); - readyService.addTransient("test_job"); - verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); - } - - @Test - void assertAddDaemonWithOverJobQueueSize() { - when(regCenter.getNumChildren(ReadyNode.ROOT)).thenReturn(BootstrapEnvironment.getINSTANCE().getFrameworkConfiguration().getJobStateQueueSize() + 1); - readyService.addDaemon("test_job"); - verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); - } - - @Test - void assertAddDaemonWithJobConfigIsNotPresent() { - when(configService.load("test_job")).thenReturn(Optional.empty()); - readyService.addDaemon("test_job"); - verify(regCenter, times(0)).isExisted("/state/ready"); - verify(regCenter, times(0)).persist(ArgumentMatchers.any(), ArgumentMatchers.eq("1")); - } - - @Test - void assertAddDaemonWithJobConfigIsNotDaemon() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - readyService.addDaemon("test_job"); - verify(regCenter, times(0)).isExisted("/state/ready"); - verify(regCenter, times(0)).persist(ArgumentMatchers.any(), ArgumentMatchers.eq("1")); - } - - @Test - void assertAddDaemonWithoutRootNode() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); - readyService.addDaemon("test_job"); - verify(regCenter).persist("/state/ready/test_job", "1"); - } - - @Test - void assertAddDaemonWithSameJobName() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); - readyService.addDaemon("test_job"); - verify(regCenter).persist(ArgumentMatchers.any(), ArgumentMatchers.eq("1")); - } - - @Test - void assertAddRunningDaemon() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); - when(runningService.isJobRunning("test_job")).thenReturn(true); - readyService.addDaemon("test_job"); - verify(regCenter, never()).persist(ArgumentMatchers.any(), ArgumentMatchers.eq("1")); - } - - @Test - void assertAddDaemonWithoutSameJobName() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job", CloudJobExecutionType.DAEMON))); - readyService.addDaemon("test_job"); - verify(regCenter).persist("/state/ready/test_job", "1"); - } - - @Test - void assertGetAllEligibleJobContextsWithoutRootNode() { - when(regCenter.isExisted("/state/ready")).thenReturn(false); - assertTrue(readyService.getAllEligibleJobContexts(Collections.emptyList()).isEmpty()); - verify(regCenter).isExisted("/state/ready"); - } - - @Test - void assertSetMisfireDisabledWhenJobIsNotExisted() { - when(configService.load("test_job")).thenReturn(Optional.empty()); - readyService.setMisfireDisabled("test_job"); - verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); - } - - @Test - void assertSetMisfireDisabledWhenReadyNodeNotExisted() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - readyService.setMisfireDisabled("test_job"); - verify(regCenter, times(0)).persist("/state/ready/test_job", "1"); - } - - @Test - void assertSetMisfireDisabledWhenReadyNodeExisted() { - when(configService.load("test_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - when(regCenter.getDirectly("/state/ready/test_job")).thenReturn("100"); - readyService.setMisfireDisabled("test_job"); - verify(regCenter).persist("/state/ready/test_job", "1"); - } - - @Test - void assertGetAllEligibleJobContextsWithRootNode() { - when(regCenter.isExisted("/state/ready")).thenReturn(true); - when(regCenter.getChildrenKeys("/state/ready")).thenReturn(Arrays.asList("not_existed_job", "running_job", "ineligible_job", "eligible_job")); - when(configService.load("not_existed_job")).thenReturn(Optional.empty()); - when(configService.load("running_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("running_job"))); - when(configService.load("eligible_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("eligible_job"))); - when(runningService.isJobRunning("running_job")).thenReturn(true); - when(runningService.isJobRunning("eligible_job")).thenReturn(false); - assertThat(readyService.getAllEligibleJobContexts(Collections.singletonList( - JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("ineligible_job").toCloudJobConfiguration(), ExecutionType.READY))).size(), is(1)); - verify(regCenter).isExisted("/state/ready"); - verify(regCenter, times(1)).getChildrenKeys("/state/ready"); - verify(configService).load("not_existed_job"); - verify(configService).load("running_job"); - verify(configService).load("eligible_job"); - verify(regCenter).remove("/state/ready/not_existed_job"); - } - - @Test - void assertGetAllEligibleJobContextsWithRootNodeAndDaemonJob() { - when(regCenter.isExisted("/state/ready")).thenReturn(true); - when(regCenter.getChildrenKeys("/state/ready")).thenReturn(Arrays.asList("not_existed_job", "running_job")); - when(configService.load("not_existed_job")).thenReturn(Optional.empty()); - when(configService.load("running_job")).thenReturn(Optional.of(CloudJobConfigurationBuilder.createCloudJobConfiguration("running_job", CloudJobExecutionType.DAEMON))); - when(runningService.isJobRunning("running_job")).thenReturn(true); - assertThat(readyService.getAllEligibleJobContexts(Collections.emptyList()).size(), is(0)); - verify(regCenter).isExisted("/state/ready"); - verify(regCenter, times(1)).getChildrenKeys("/state/ready"); - verify(configService).load("not_existed_job"); - verify(configService).load("running_job"); - } - - @Test - void assertRemove() { - when(regCenter.getDirectly("/state/ready/test_job_1")).thenReturn("1"); - when(regCenter.getDirectly("/state/ready/test_job_2")).thenReturn("2"); - readyService.remove(Arrays.asList("test_job_1", "test_job_2")); - verify(regCenter).persist("/state/ready/test_job_2", "1"); - verify(regCenter).remove("/state/ready/test_job_1"); - verify(regCenter, times(0)).persist("/state/ready/test_job_1", "0"); - verify(regCenter, times(0)).remove("/state/ready/test_job_2"); - } - - @Test - void assertGetAllTasksWithoutRootNode() { - when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(false); - assertTrue(readyService.getAllReadyTasks().isEmpty()); - verify(regCenter).isExisted(ReadyNode.ROOT); - verify(regCenter, times(0)).getChildrenKeys(ArgumentMatchers.any()); - verify(regCenter, times(0)).get(ArgumentMatchers.any()); - } - - @Test - void assertGetAllTasksWhenRootNodeHasNoChild() { - when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(true); - when(regCenter.getChildrenKeys(ReadyNode.ROOT)).thenReturn(Collections.emptyList()); - assertTrue(readyService.getAllReadyTasks().isEmpty()); - verify(regCenter).isExisted(ReadyNode.ROOT); - verify(regCenter).getChildrenKeys(ReadyNode.ROOT); - verify(regCenter, times(0)).get(ArgumentMatchers.any()); - } - - @Test - void assertGetAllTasksWhenNodeIsEmpty() { - when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(true); - when(regCenter.getChildrenKeys(ReadyNode.ROOT)).thenReturn(Collections.singletonList("test_job")); - when(regCenter.get(ReadyNode.getReadyJobNodePath("test_job"))).thenReturn(""); - assertTrue(readyService.getAllReadyTasks().isEmpty()); - verify(regCenter).isExisted(ReadyNode.ROOT); - verify(regCenter).getChildrenKeys(ReadyNode.ROOT); - verify(regCenter).get(ReadyNode.getReadyJobNodePath("test_job")); - } - - @Test - void assertGetAllTasksWithRootNode() { - when(regCenter.isExisted(ReadyNode.ROOT)).thenReturn(true); - when(regCenter.getChildrenKeys(ReadyNode.ROOT)).thenReturn(Arrays.asList("test_job_1", "test_job_2")); - when(regCenter.get(ReadyNode.getReadyJobNodePath("test_job_1"))).thenReturn("1"); - when(regCenter.get(ReadyNode.getReadyJobNodePath("test_job_2"))).thenReturn("5"); - Map result = readyService.getAllReadyTasks(); - assertThat(result.size(), is(2)); - assertThat(result.get("test_job_1"), is(1)); - assertThat(result.get("test_job_2"), is(5)); - verify(regCenter).isExisted(ReadyNode.ROOT); - verify(regCenter).getChildrenKeys(ReadyNode.ROOT); - verify(regCenter, times(2)).get(ArgumentMatchers.any()); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java deleted file mode 100755 index a0df3815ba..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningNodeTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.running; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class RunningNodeTest { - - @Test - void assertGetRunningJobNodePath() { - assertThat(RunningNode.getRunningJobNodePath("test_job"), is("/state/running/test_job")); - } - - @Test - void assertGetRunningTaskNodePath() { - String nodePath = TaskNode.builder().build().getTaskNodePath(); - assertThat(RunningNode.getRunningTaskNodePath(nodePath), is("/state/running/test_job/" + nodePath)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java deleted file mode 100755 index bfcadc93b8..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/running/RunningServiceTest.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.state.running; - -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJsonConstants; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collections; -import java.util.UUID; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class RunningServiceTest { - - private TaskContext taskContext; - - private TaskContext taskContextT; - - @Mock - private CoordinatorRegistryCenter regCenter; - - private RunningService runningService; - - @BeforeEach - void setUp() { - when(regCenter.get("/config/job/test_job")).thenReturn(CloudJsonConstants.getJobJson(CloudJobExecutionType.DAEMON)); - when(regCenter.get("/config/job/test_job_t")).thenReturn(CloudJsonConstants.getJobJson("test_job_t")); - runningService = new RunningService(regCenter); - taskContext = TaskContext.from(TaskNode.builder().build().getTaskNodeValue()); - taskContextT = TaskContext.from(TaskNode.builder().jobName("test_job_t").build().getTaskNodeValue()); - runningService.add(taskContext); - runningService.add(taskContextT); - assertThat(runningService.getAllRunningDaemonTasks().size(), is(1)); - assertThat(runningService.getAllRunningTasks().size(), is(2)); - String path = RunningNode.getRunningTaskNodePath(taskContext.getMetaInfo().toString()); - verify(regCenter).isExisted(path); - verify(regCenter).persist(path, taskContext.getId()); - } - - @AfterEach - void tearDown() { - runningService.clear(); - } - - @Test - void assertStart() { - TaskNode taskNode1 = TaskNode.builder().jobName("test_job").shardingItem(0).slaveId("111").type(ExecutionType.READY).uuid(UUID.randomUUID().toString()).build(); - TaskNode taskNode2 = TaskNode.builder().jobName("test_job").shardingItem(1).slaveId("222").type(ExecutionType.FAILOVER).uuid(UUID.randomUUID().toString()).build(); - when(regCenter.getChildrenKeys(RunningNode.ROOT)).thenReturn(Collections.singletonList("test_job")); - when(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath("test_job"))).thenReturn(Arrays.asList(taskNode1.getTaskNodePath(), taskNode2.getTaskNodePath())); - when(regCenter.get(RunningNode.getRunningTaskNodePath(taskNode1.getTaskNodePath()))).thenReturn(taskNode1.getTaskNodeValue()); - when(regCenter.get(RunningNode.getRunningTaskNodePath(taskNode2.getTaskNodePath()))).thenReturn(taskNode2.getTaskNodeValue()); - runningService.start(); - assertThat(runningService.getAllRunningDaemonTasks().size(), is(2)); - } - - @Test - void assertAddWithoutData() { - assertThat(runningService.getRunningTasks("test_job").size(), is(1)); - assertThat(runningService.getRunningTasks("test_job").iterator().next(), is(taskContext)); - assertThat(runningService.getRunningTasks("test_job_t").size(), is(1)); - assertThat(runningService.getRunningTasks("test_job_t").iterator().next(), is(taskContextT)); - } - - @Test - void assertAddWithData() { - when(regCenter.get("/config/job/other_job")).thenReturn(CloudJsonConstants.getJobJson("other_job")); - TaskNode taskNode = TaskNode.builder().jobName("other_job").build(); - runningService.add(TaskContext.from(taskNode.getTaskNodeValue())); - assertThat(runningService.getRunningTasks("other_job").size(), is(1)); - assertThat(runningService.getRunningTasks("other_job").iterator().next(), is(TaskContext.from(taskNode.getTaskNodeValue()))); - } - - @Test - void assertUpdateIdle() { - runningService.updateIdle(taskContext, true); - assertThat(runningService.getRunningTasks("test_job").size(), is(1)); - assertTrue(runningService.getRunningTasks("test_job").iterator().next().isIdle()); - } - - @Test - void assertRemoveByJobName() { - runningService.remove("test_job"); - assertTrue(runningService.getRunningTasks("test_job").isEmpty()); - verify(regCenter).remove(RunningNode.getRunningJobNodePath("test_job")); - runningService.remove("test_job_t"); - assertTrue(runningService.getRunningTasks("test_job_t").isEmpty()); - } - - @Test - void assertRemoveByTaskContext() { - when(regCenter.isExisted(RunningNode.getRunningJobNodePath("test_job"))).thenReturn(true); - when(regCenter.getChildrenKeys(RunningNode.getRunningJobNodePath("test_job"))).thenReturn(Collections.emptyList()); - runningService.remove(taskContext); - assertTrue(runningService.getRunningTasks("test_job").isEmpty()); - verify(regCenter).remove(RunningNode.getRunningTaskNodePath(taskContext.getMetaInfo().toString())); - runningService.remove(taskContextT); - assertTrue(runningService.getRunningTasks("test_job_t").isEmpty()); - } - - @Test - void assertIsJobRunning() { - assertTrue(runningService.isJobRunning("test_job")); - } - - @Test - void assertIsTaskRunning() { - assertTrue(runningService.isTaskRunning(MetaInfo.from(TaskNode.builder().build().getTaskNodePath()))); - } - - @Test - void assertIsTaskNotRunning() { - assertFalse(runningService.isTaskRunning(MetaInfo.from(TaskNode.builder().shardingItem(2).build().getTaskNodePath()))); - } - - @Test - void assertMappingOperate() { - String taskId = TaskNode.builder().build().getTaskNodeValue(); - assertNull(runningService.popMapping(taskId)); - runningService.addMapping(taskId, "localhost"); - assertThat(runningService.popMapping(taskId), is("localhost")); - assertNull(runningService.popMapping(taskId)); - } - - @Test - void assertClear() { - assertFalse(runningService.getRunningTasks("test_job").isEmpty()); - runningService.addMapping(TaskNode.builder().build().getTaskNodeValue(), "localhost"); - runningService.clear(); - assertTrue(runningService.getRunningTasks("test_job").isEmpty()); - assertNull(runningService.popMapping(TaskNode.builder().build().getTaskNodeValue())); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java deleted file mode 100755 index de9ef44749..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticManagerTest.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics; - -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.config.CloudJobExecutionType; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import java.util.Arrays; -import java.util.Collections; -import java.util.Date; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.reset; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class StatisticManagerTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - @Mock - private StatisticRdbRepository rdbRepository; - - @Mock - private StatisticsScheduler scheduler; - - @Mock - private CloudJobConfigurationService configurationService; - - private StatisticManager statisticManager; - - @BeforeEach - void setUp() { - statisticManager = StatisticManager.getInstance(regCenter, null); - } - - @AfterEach - void tearDown() { - statisticManager.shutdown(); - ReflectionUtils.setStaticFieldValue(StatisticManager.class, "instance", null); - reset(configurationService); - reset(rdbRepository); - } - - @Test - void assertGetInstance() { - assertThat(statisticManager, is(StatisticManager.getInstance(regCenter, null))); - } - - @Test - void assertStartupWhenRdbIsNotConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); - statisticManager.startup(); - } - - @Test - void assertStartupWhenRdbIsConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); - statisticManager.startup(); - } - - @Test - void assertShutdown() { - ReflectionUtils.setFieldValue(statisticManager, "scheduler", scheduler); - statisticManager.shutdown(); - verify(scheduler).shutdown(); - } - - @Test - void assertTaskRun() { - statisticManager.taskRunSuccessfully(); - statisticManager.taskRunFailed(); - } - - @Test - void assertTaskResultStatisticsWhenRdbIsNotConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); - assertThat(statisticManager.getTaskResultStatisticsWeekly().getSuccessCount(), is(0)); - assertThat(statisticManager.getTaskResultStatisticsWeekly().getFailedCount(), is(0)); - assertThat(statisticManager.getTaskResultStatisticsSinceOnline().getSuccessCount(), is(0)); - assertThat(statisticManager.getTaskResultStatisticsSinceOnline().getFailedCount(), is(0)); - } - - @Test - void assertTaskResultStatisticsWhenRdbIsConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); - when(rdbRepository.getSummedTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) - .thenReturn(new TaskResultStatistics(10, 10, StatisticInterval.DAY, new Date())); - assertThat(statisticManager.getTaskResultStatisticsWeekly().getSuccessCount(), is(10)); - assertThat(statisticManager.getTaskResultStatisticsWeekly().getFailedCount(), is(10)); - assertThat(statisticManager.getTaskResultStatisticsSinceOnline().getSuccessCount(), is(10)); - assertThat(statisticManager.getTaskResultStatisticsSinceOnline().getFailedCount(), is(10)); - verify(rdbRepository, times(4)).getSummedTaskResultStatistics(any(Date.class), any(StatisticInterval.class)); - } - - @Test - void assertJobExecutionTypeStatistics() { - ReflectionUtils.setFieldValue(statisticManager, "configurationService", configurationService); - when(configurationService.loadAll()).thenReturn(Arrays.asList( - CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_1", CloudJobExecutionType.DAEMON), - CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job_2", CloudJobExecutionType.TRANSIENT))); - assertThat(statisticManager.getJobExecutionTypeStatistics().getDaemonJobCount(), is(1)); - assertThat(statisticManager.getJobExecutionTypeStatistics().getTransientJobCount(), is(1)); - verify(configurationService, times(2)).loadAll(); - } - - @Test - void assertFindTaskRunningStatisticsWhenRdbIsNotConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); - assertTrue(statisticManager.findTaskRunningStatisticsWeekly().isEmpty()); - } - - @Test - void assertFindTaskRunningStatisticsWhenRdbIsConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); - when(rdbRepository.findTaskRunningStatistics(any(Date.class))).thenReturn(Collections.singletonList(new TaskRunningStatistics(10, new Date()))); - assertThat(statisticManager.findTaskRunningStatisticsWeekly().size(), is(1)); - verify(rdbRepository).findTaskRunningStatistics(any(Date.class)); - } - - @Test - void assertFindJobRunningStatisticsWhenRdbIsNotConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); - assertTrue(statisticManager.findJobRunningStatisticsWeekly().isEmpty()); - } - - @Test - void assertFindJobRunningStatisticsWhenRdbIsConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); - when(rdbRepository.findJobRunningStatistics(any(Date.class))).thenReturn(Collections.singletonList(new JobRunningStatistics(10, new Date()))); - assertThat(statisticManager.findJobRunningStatisticsWeekly().size(), is(1)); - verify(rdbRepository).findJobRunningStatistics(any(Date.class)); - } - - @Test - void assertFindJobRegisterStatisticsWhenRdbIsNotConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); - assertTrue(statisticManager.findJobRegisterStatisticsSinceOnline().isEmpty()); - } - - @Test - void assertFindJobRegisterStatisticsWhenRdbIsConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); - when(rdbRepository.findJobRegisterStatistics(any(Date.class))).thenReturn(Collections.singletonList(new JobRegisterStatistics(10, new Date()))); - assertThat(statisticManager.findJobRegisterStatisticsSinceOnline().size(), is(1)); - verify(rdbRepository).findJobRegisterStatistics(any(Date.class)); - } - - @Test - void assertFindLatestTaskResultStatisticsWhenRdbIsNotConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); - for (StatisticInterval each : StatisticInterval.values()) { - TaskResultStatistics actual = statisticManager.findLatestTaskResultStatistics(each); - assertThat(actual.getSuccessCount(), is(0)); - assertThat(actual.getFailedCount(), is(0)); - } - } - - @Test - void assertFindLatestTaskResultStatisticsWhenRdbIsConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); - for (StatisticInterval each : StatisticInterval.values()) { - when(rdbRepository.findLatestTaskResultStatistics(each)) - .thenReturn(Optional.of(new TaskResultStatistics(10, 5, each, new Date()))); - TaskResultStatistics actual = statisticManager.findLatestTaskResultStatistics(each); - assertThat(actual.getSuccessCount(), is(10)); - assertThat(actual.getFailedCount(), is(5)); - } - verify(rdbRepository, times(StatisticInterval.values().length)).findLatestTaskResultStatistics(any(StatisticInterval.class)); - } - - @Test - void assertFindTaskResultStatisticsDailyWhenRdbIsNotConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", null); - assertTrue(statisticManager.findTaskResultStatisticsDaily().isEmpty()); - } - - @Test - void assertFindTaskResultStatisticsDailyWhenRdbIsConfigured() { - ReflectionUtils.setFieldValue(statisticManager, "rdbRepository", rdbRepository); - when(rdbRepository.findTaskResultStatistics(any(Date.class), any(StatisticInterval.class))) - .thenReturn(Collections.singletonList(new TaskResultStatistics(10, 5, StatisticInterval.MINUTE, new Date()))); - assertThat(statisticManager.findTaskResultStatisticsDaily().size(), is(1)); - verify(rdbRepository).findTaskResultStatistics(any(Date.class), any(StatisticInterval.class)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java deleted file mode 100755 index 24a594c79a..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsSchedulerTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics; - -import org.apache.shardingsphere.elasticjob.cloud.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.StatisticJob; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.TestStatisticJob; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class StatisticsSchedulerTest { - - private StatisticsScheduler statisticsScheduler; - - @Mock - private Scheduler scheduler; - - @BeforeEach - void setUp() { - statisticsScheduler = new StatisticsScheduler(); - ReflectionUtils.setFieldValue(statisticsScheduler, "scheduler", scheduler); - } - - @Test - void assertRegister() throws SchedulerException { - StatisticJob job = new TestStatisticJob(); - statisticsScheduler.register(job); - verify(scheduler).scheduleJob(job.buildJobDetail(), job.buildTrigger()); - } - - @Test - void assertShutdown() throws SchedulerException { - when(scheduler.isShutdown()).thenReturn(false); - statisticsScheduler.shutdown(); - when(scheduler.isShutdown()).thenReturn(true); - statisticsScheduler.shutdown(); - verify(scheduler).shutdown(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java deleted file mode 100755 index 6fed73a2b8..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/TaskResultMetaDataTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class TaskResultMetaDataTest { - - private TaskResultMetaData metaData; - - @BeforeEach - void setUp() { - metaData = new TaskResultMetaData(); - } - - @Test - void assertIncrementAndGet() { - for (int i = 0; i < 100; i++) { - assertThat(metaData.incrementAndGetSuccessCount(), is(i + 1)); - assertThat(metaData.incrementAndGetFailedCount(), is(i + 1)); - assertThat(metaData.getSuccessCount(), is(i + 1)); - assertThat(metaData.getFailedCount(), is(i + 1)); - } - } - - @Test - void assertReset() { - for (int i = 0; i < 100; i++) { - metaData.incrementAndGetSuccessCount(); - metaData.incrementAndGetFailedCount(); - } - metaData.reset(); - assertThat(metaData.getSuccessCount(), is(0)); - assertThat(metaData.getFailedCount(), is(0)); - } - -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java deleted file mode 100755 index 922409aabc..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/BaseStatisticJobTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.util.Date; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class BaseStatisticJobTest { - - private TestStatisticJob testStatisticJob; - - @BeforeEach - void setUp() { - testStatisticJob = new TestStatisticJob(); - } - - @Test - void assertGetTriggerName() { - assertThat(testStatisticJob.getTriggerName(), is(TestStatisticJob.class.getSimpleName() + "Trigger")); - } - - @Test - void assertGetJobName() { - assertThat(testStatisticJob.getJobName(), is(TestStatisticJob.class.getSimpleName())); - } - - @Test - void assertFindBlankStatisticTimes() { - for (StatisticInterval each : StatisticInterval.values()) { - int num = -2; - for (Date eachTime : testStatisticJob.findBlankStatisticTimes(StatisticTimeUtils.getStatisticTime(each, num - 1), each)) { - assertThat(eachTime.getTime(), is(StatisticTimeUtils.getStatisticTime(each, num++).getTime())); - } - } - } - -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java deleted file mode 100755 index 0ffdc5a98e..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/JobRunningStatisticJobTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRunningStatistics; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskRunningStatistics; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.ArgumentMatchers; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.Trigger; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Optional; -import java.util.Set; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class JobRunningStatisticJobTest { - - @Mock - private RunningService runningService; - - @Mock - private StatisticRdbRepository repository; - - private JobRunningStatisticJob jobRunningStatisticJob; - - @BeforeEach - void setUp() { - jobRunningStatisticJob = new JobRunningStatisticJob(); - jobRunningStatisticJob.setRunningService(runningService); - jobRunningStatisticJob.setRepository(repository); - } - - @Test - void assertBuildJobDetail() { - assertThat(jobRunningStatisticJob.buildJobDetail().getKey().getName(), is(JobRunningStatisticJob.class.getSimpleName())); - } - - @Test - void assertBuildTrigger() { - Trigger trigger = jobRunningStatisticJob.buildTrigger(); - assertThat(trigger.getKey().getName(), is(JobRunningStatisticJob.class.getSimpleName() + "Trigger")); - } - - @Test - void assertGetDataMap() { - assertThat(jobRunningStatisticJob.getDataMap().get("runningService"), is(runningService)); - assertThat(jobRunningStatisticJob.getDataMap().get("repository"), is(repository)); - } - - @Test - void assertExecuteWhenRepositoryIsEmpty() { - Optional latestJobRunningStatistics = Optional.empty(); - Optional latestTaskRunningStatistics = Optional.empty(); - when(repository.findLatestJobRunningStatistics()).thenReturn(latestJobRunningStatistics); - when(repository.findLatestTaskRunningStatistics()).thenReturn(latestTaskRunningStatistics); - when(repository.add(ArgumentMatchers.any(JobRunningStatistics.class))).thenReturn(true); - when(repository.add(ArgumentMatchers.any(TaskRunningStatistics.class))).thenReturn(true); - when(runningService.getAllRunningTasks()).thenReturn(Collections.emptyMap()); - jobRunningStatisticJob.execute(null); - verify(repository).findLatestJobRunningStatistics(); - verify(repository).add(ArgumentMatchers.any(JobRunningStatistics.class)); - verify(repository).add(ArgumentMatchers.any(TaskRunningStatistics.class)); - verify(runningService).getAllRunningTasks(); - } - - @Test - void assertExecute() { - Optional latestJobRunningStatistics = Optional.of(new JobRunningStatistics(0, StatisticTimeUtils.getStatisticTime(StatisticInterval.MINUTE, -3))); - Optional latestTaskRunningStatistics = Optional.of(new TaskRunningStatistics(0, StatisticTimeUtils.getStatisticTime(StatisticInterval.MINUTE, -3))); - when(repository.findLatestJobRunningStatistics()).thenReturn(latestJobRunningStatistics); - when(repository.findLatestTaskRunningStatistics()).thenReturn(latestTaskRunningStatistics); - when(repository.add(ArgumentMatchers.any(JobRunningStatistics.class))).thenReturn(true); - when(repository.add(ArgumentMatchers.any(TaskRunningStatistics.class))).thenReturn(true); - Map> jobMap = new HashMap<>(1); - Set jobSet = new HashSet<>(1); - jobSet.add(TaskContext.from(TaskNode.builder().jobName("test_job").build().getTaskNodeValue())); - jobMap.put("test_job", jobSet); - when(runningService.getAllRunningTasks()).thenReturn(jobMap); - jobRunningStatisticJob.execute(null); - verify(repository).findLatestJobRunningStatistics(); - verify(repository).findLatestTaskRunningStatistics(); - verify(repository, times(3)).add(ArgumentMatchers.any(JobRunningStatistics.class)); - verify(repository, times(3)).add(ArgumentMatchers.any(TaskRunningStatistics.class)); - verify(runningService).getAllRunningTasks(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java deleted file mode 100755 index 53593f5f37..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/RegisteredJobStatisticJobTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobRegisterStatistics; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.Trigger; - -import java.util.Collections; -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class RegisteredJobStatisticJobTest { - - @Mock - private CloudJobConfigurationService configurationService; - - @Mock - private StatisticRdbRepository repository; - - private RegisteredJobStatisticJob registeredJobStatisticJob; - - @BeforeEach - void setUp() { - registeredJobStatisticJob = new RegisteredJobStatisticJob(); - registeredJobStatisticJob.setConfigurationService(configurationService); - registeredJobStatisticJob.setRepository(repository); - } - - @Test - void assertBuildJobDetail() { - assertThat(registeredJobStatisticJob.buildJobDetail().getKey().getName(), is(RegisteredJobStatisticJob.class.getSimpleName())); - } - - @Test - void assertBuildTrigger() { - Trigger trigger = registeredJobStatisticJob.buildTrigger(); - assertThat(trigger.getKey().getName(), is(RegisteredJobStatisticJob.class.getSimpleName() + "Trigger")); - } - - @Test - void assertGetDataMap() { - assertThat(registeredJobStatisticJob.getDataMap().get("configurationService"), is(configurationService)); - assertThat(registeredJobStatisticJob.getDataMap().get("repository"), is(repository)); - } - - @Test - void assertExecuteWhenRepositoryIsEmpty() { - Optional latestOne = Optional.empty(); - when(repository.findLatestJobRegisterStatistics()).thenReturn(latestOne); - when(repository.add(any(JobRegisterStatistics.class))).thenReturn(true); - when(configurationService.loadAll()).thenReturn(Collections.singletonList(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - registeredJobStatisticJob.execute(null); - verify(repository).findLatestJobRegisterStatistics(); - verify(repository).add(any(JobRegisterStatistics.class)); - verify(configurationService).loadAll(); - } - - @Test - void assertExecute() { - Optional latestOne = Optional.of(new JobRegisterStatistics(0, StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -3))); - when(repository.findLatestJobRegisterStatistics()).thenReturn(latestOne); - when(repository.add(any(JobRegisterStatistics.class))).thenReturn(true); - when(configurationService.loadAll()).thenReturn(Collections.singletonList(CloudJobConfigurationBuilder.createCloudJobConfiguration("test_job"))); - registeredJobStatisticJob.execute(null); - verify(repository).findLatestJobRegisterStatistics(); - verify(repository, times(3)).add(any(JobRegisterStatistics.class)); - verify(configurationService).loadAll(); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java deleted file mode 100755 index e4f340e160..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TaskResultStatisticJobTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.TaskResultMetaData; -import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtils; -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepository; -import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.quartz.Trigger; - -import java.util.Optional; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class TaskResultStatisticJobTest { - - private final StatisticInterval statisticInterval = StatisticInterval.MINUTE; - - private TaskResultMetaData sharedData; - - @Mock - private StatisticRdbRepository repository; - - private TaskResultStatisticJob taskResultStatisticJob; - - @BeforeEach - void setUp() { - taskResultStatisticJob = new TaskResultStatisticJob(); - sharedData = new TaskResultMetaData(); - taskResultStatisticJob.setStatisticInterval(statisticInterval); - taskResultStatisticJob.setSharedData(sharedData); - taskResultStatisticJob.setRepository(repository); - } - - @Test - void assertBuildJobDetail() { - assertThat(taskResultStatisticJob.buildJobDetail().getKey().getName(), is(TaskResultStatisticJob.class.getSimpleName() + "_" + statisticInterval)); - } - - @Test - void assertBuildTrigger() { - for (StatisticInterval each : StatisticInterval.values()) { - taskResultStatisticJob.setStatisticInterval(each); - Trigger trigger = taskResultStatisticJob.buildTrigger(); - assertThat(trigger.getKey().getName(), is(TaskResultStatisticJob.class.getSimpleName() + "Trigger" + "_" + each)); - } - } - - @Test - void assertGetDataMap() { - assertThat(taskResultStatisticJob.getDataMap().get("statisticInterval"), is(statisticInterval)); - assertThat(taskResultStatisticJob.getDataMap().get("sharedData"), is(sharedData)); - assertThat(taskResultStatisticJob.getDataMap().get("repository"), is(repository)); - } - - @Test - void assertExecuteWhenRepositoryIsEmpty() { - Optional latestOne = Optional.empty(); - for (StatisticInterval each : StatisticInterval.values()) { - taskResultStatisticJob.setStatisticInterval(each); - when(repository.findLatestTaskResultStatistics(each)).thenReturn(latestOne); - when(repository.add(any(TaskResultStatistics.class))).thenReturn(true); - taskResultStatisticJob.execute(null); - verify(repository).findLatestTaskResultStatistics(each); - } - verify(repository, times(3)).add(any(TaskResultStatistics.class)); - } - - @Test - void assertExecute() { - for (StatisticInterval each : StatisticInterval.values()) { - taskResultStatisticJob.setStatisticInterval(each); - Optional latestOne = Optional.of(new TaskResultStatistics(0, 0, each, StatisticTimeUtils.getStatisticTime(each, -3))); - when(repository.findLatestTaskResultStatistics(each)).thenReturn(latestOne); - when(repository.add(any(TaskResultStatistics.class))).thenReturn(true); - taskResultStatisticJob.execute(null); - verify(repository).findLatestTaskResultStatistics(each); - } - verify(repository, times(StatisticInterval.values().length * 3)).add(any(TaskResultStatistics.class)); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java deleted file mode 100755 index f8513315b2..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/job/TestStatisticJob.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.job; - -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.quartz.CronScheduleBuilder; -import org.quartz.JobBuilder; -import org.quartz.JobDetail; -import org.quartz.JobExecutionContext; -import org.quartz.Trigger; -import org.quartz.TriggerBuilder; - -import java.util.HashMap; -import java.util.Map; - -public class TestStatisticJob extends AbstractStatisticJob { - - @Override - public JobDetail buildJobDetail() { - return JobBuilder.newJob(this.getClass()).withIdentity(getJobName()).build(); - } - - @Override - public Trigger buildTrigger() { - return TriggerBuilder.newTrigger() - .withIdentity(getTriggerName()) - .withSchedule(CronScheduleBuilder.cronSchedule(StatisticInterval.MINUTE.getCron()) - .withMisfireHandlingInstructionDoNothing()) - .build(); - } - - @Override - public Map getDataMap() { - Map result = new HashMap<>(2); - result.put("key", "value"); - return result; - } - - @Override - public void execute(final JobExecutionContext context) { - System.out.println("do something..."); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java deleted file mode 100755 index b13a1463e1..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/util/StatisticTimeUtilsTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.statistics.util; - -import org.apache.shardingsphere.elasticjob.cloud.statistics.StatisticInterval; -import org.junit.jupiter.api.Test; - -import java.text.SimpleDateFormat; -import java.util.Date; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class StatisticTimeUtilsTest { - - @Test - void assertGetCurrentStatisticTime() { - assertThat(getTimeStr(StatisticTimeUtils.getCurrentStatisticTime(StatisticInterval.MINUTE), StatisticInterval.MINUTE), is(getTimeStr(getNow(), StatisticInterval.MINUTE))); - assertThat(getTimeStr(StatisticTimeUtils.getCurrentStatisticTime(StatisticInterval.HOUR), StatisticInterval.HOUR), is(getTimeStr(getNow(), StatisticInterval.HOUR))); - assertThat(getTimeStr(StatisticTimeUtils.getCurrentStatisticTime(StatisticInterval.DAY), StatisticInterval.DAY), is(getTimeStr(getNow(), StatisticInterval.DAY))); - } - - @Test - void assertGetStatisticTime() { - assertThat(getTimeStr(StatisticTimeUtils.getStatisticTime(StatisticInterval.MINUTE, -1), StatisticInterval.MINUTE), is(getTimeStr(getLastMinute(), StatisticInterval.MINUTE))); - assertThat(getTimeStr(StatisticTimeUtils.getStatisticTime(StatisticInterval.HOUR, -1), StatisticInterval.HOUR), is(getTimeStr(getLastHour(), StatisticInterval.HOUR))); - assertThat(getTimeStr(StatisticTimeUtils.getStatisticTime(StatisticInterval.DAY, -1), StatisticInterval.DAY), is(getTimeStr(getYesterday(), StatisticInterval.DAY))); - } - - private Date getNow() { - return new Date(); - } - - private Date getLastMinute() { - return new Date(getNow().getTime() - 60 * 1000); - } - - private Date getLastHour() { - return new Date(getNow().getTime() - 60 * 60 * 1000); - } - - private Date getYesterday() { - return new Date(getNow().getTime() - 24 * 60 * 60 * 1000); - } - - private String getTimeStr(final Date time, final StatisticInterval interval) { - switch (interval) { - case DAY: - return new SimpleDateFormat("yyyy-MM-dd").format(time) + " :00:00:00"; - case HOUR: - return new SimpleDateFormat("yyyy-MM-dd HH").format(time) + ":00:00"; - case MINUTE: - default: - return new SimpleDateFormat("yyyy-MM-dd HH:mm").format(time) + ":00"; - } - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java deleted file mode 100644 index 6a1f3591be..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/util/IOUtilsTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.elasticjob.cloud.scheduler.util; - -import org.junit.jupiter.api.Test; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.nio.charset.StandardCharsets; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -class IOUtilsTest { - - @Test - void assertToStringFromInputStream() throws Exception { - byte[] b = "toStringFromInputStream".getBytes(StandardCharsets.UTF_8); - InputStream in = new ByteArrayInputStream(b); - assertThat(IOUtils.toString(in, null), is("toStringFromInputStream")); - } - - @Test - void assertToStringFromInputStreamWithEncoding() throws Exception { - byte[] b = "toStringFromInputStream".getBytes(StandardCharsets.UTF_8); - InputStream in = new ByteArrayInputStream(b); - assertThat(IOUtils.toString(in, "UTF-8"), is("toStringFromInputStream")); - } - - @Test - void assertToStringFromReader() throws Exception { - byte[] b = "toStringFromReader".getBytes(StandardCharsets.UTF_8); - InputStream is = new ByteArrayInputStream(b); - Reader inr = new InputStreamReader(is, StandardCharsets.UTF_8); - assertThat(IOUtils.toString(inr), is("toStringFromReader")); - } -} diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/resources/logback-test.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/resources/logback-test.xml deleted file mode 100755 index 3d6a7e0c20..0000000000 --- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/resources/logback-test.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - ${log.context.name} - - - - ERROR - - - ${log.pattern} - - - - - - - - - - - diff --git a/elasticjob-cloud/pom.xml b/elasticjob-cloud/pom.xml deleted file mode 100644 index 0a44944cda..0000000000 --- a/elasticjob-cloud/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob - 3.1.0-SNAPSHOT - - elasticjob-cloud - pom - ${project.artifactId} - - - elasticjob-cloud-common - elasticjob-cloud-scheduler - elasticjob-cloud-executor - - diff --git a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml b/elasticjob-distribution/elasticjob-bin-distribution/pom.xml similarity index 92% rename from elasticjob-distribution/elasticjob-lite-distribution/pom.xml rename to elasticjob-distribution/elasticjob-bin-distribution/pom.xml index fa4034102b..ae91da3250 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/pom.xml +++ b/elasticjob-distribution/elasticjob-bin-distribution/pom.xml @@ -23,24 +23,24 @@ elasticjob-distribution 3.1.0-SNAPSHOT - elasticjob-lite-distribution + elasticjob-bin-distribution pom ${project.artifactId} org.apache.shardingsphere.elasticjob - elasticjob-lite-core + elasticjob-engine-core ${project.version} org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-namespace + elasticjob-engine-spring-namespace ${project.version} org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-boot-starter + elasticjob-engine-spring-boot-starter ${project.version} @@ -76,7 +76,7 @@ package - src/main/assembly/elasticjob-lite-binary-distribution.xml + src/main/assembly/elasticjob-binary-distribution.xml diff --git a/elasticjob-distribution/elasticjob-lite-distribution/src/main/assembly/elasticjob-lite-binary-distribution.xml b/elasticjob-distribution/elasticjob-bin-distribution/src/main/assembly/elasticjob-binary-distribution.xml similarity index 96% rename from elasticjob-distribution/elasticjob-lite-distribution/src/main/assembly/elasticjob-lite-binary-distribution.xml rename to elasticjob-distribution/elasticjob-bin-distribution/src/main/assembly/elasticjob-binary-distribution.xml index 7f8f075b8c..c7d9e70631 100644 --- a/elasticjob-distribution/elasticjob-lite-distribution/src/main/assembly/elasticjob-lite-binary-distribution.xml +++ b/elasticjob-distribution/elasticjob-bin-distribution/src/main/assembly/elasticjob-binary-distribution.xml @@ -22,7 +22,7 @@ tar.gz true - ${project.build.finalName}-lite-bin + ${project.build.finalName}-bin diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/src/main/release-docs/README.txt b/elasticjob-distribution/elasticjob-bin-distribution/src/main/release-docs/README.txt similarity index 85% rename from elasticjob-distribution/elasticjob-cloud-executor-distribution/src/main/release-docs/README.txt rename to elasticjob-distribution/elasticjob-bin-distribution/src/main/release-docs/README.txt index 1e75b341d9..834b98a53c 100644 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/src/main/release-docs/README.txt +++ b/elasticjob-distribution/elasticjob-bin-distribution/src/main/release-docs/README.txt @@ -1,7 +1,7 @@ Welcome to Apache ShardingSphere-ElasticJob =============================================================================== -ElasticJob is a distributed scheduling solution consisting of two separate projects, ElasticJob-Lite and ElasticJob-Cloud. +ElasticJob is a distributed scheduling solution. Through the functions of flexible scheduling, resource management and job management, it creates a distributed scheduling solution suitable for Internet scenarios, @@ -9,7 +9,7 @@ and provides a diversified job ecosystem through open architecture design. It uses a unified job API for each project. Developers only need code one time and can deploy at will. -ElasticJob-Cloud uses Mesos to manage and isolate resources. +ElasticJob is a lightweight, decentralized solution that provides distributed task sharding services. ElasticJob became an Apache ShardingSphere Sub project on May 28 2020. diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml deleted file mode 100644 index 8984517ce3..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-distribution - 3.1.0-SNAPSHOT - - elasticjob-cloud-executor-distribution - pom - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-executor - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-dingtalk - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-email - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-wechat - ${project.version} - - - - - - release - - - - maven-assembly-plugin - - - cloud-bin - - single - - package - - - src/main/assembly/elasticjob-cloud-binary-distribution.xml - - - - - - - net.nicoulaj.maven.plugins - checksum-maven-plugin - - - - - - diff --git a/elasticjob-distribution/elasticjob-cloud-executor-distribution/src/main/assembly/elasticjob-cloud-binary-distribution.xml b/elasticjob-distribution/elasticjob-cloud-executor-distribution/src/main/assembly/elasticjob-cloud-binary-distribution.xml deleted file mode 100644 index a7cf5bc794..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-executor-distribution/src/main/assembly/elasticjob-cloud-binary-distribution.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - cloud-executor-bin - - tar.gz - - true - ${project.build.finalName}-cloud-executor-bin - - - - ../../ - - LICENSE - NOTICE - - - - src/main/release-docs - - **/* - - . - - - - - - true - false - ./lib - - org.apache.shardingsphere.elasticjob:* - - - - diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/Dockerfile b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/Dockerfile deleted file mode 100644 index c6ac3cc503..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# -# 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. -# - -FROM java:8 -MAINTAINER ShardingSphere "dev@shardingsphere.apache.org" - -ARG APP_NAME -ENV LOCAL_PATH /opt/shardingsphere-elasticjob-cloud-scheduler - -ADD target/${APP_NAME}.tar.gz /opt -RUN mv /opt/${APP_NAME} ${LOCAL_PATH} - -ENTRYPOINT ${LOCAL_PATH}/bin/start.sh ${PORT} && tail -f ${LOCAL_PATH}/logs/stdout.log diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml deleted file mode 100644 index c0eb161d3f..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/pom.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-distribution - 3.1.0-SNAPSHOT - - elasticjob-cloud-scheduler-distribution - pom - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-infra-common - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-simple-executor - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-dataflow-executor - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-script-executor - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-common - ${project.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-scheduler - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-restful - ${project.parent.version} - - - org.apache.httpcomponents - httpclient - - - org.apache.httpcomponents - httpcore - - - - org.apache.commons - commons-lang3 - - - commons-codec - commons-codec - - - org.apache.mesos - mesos - - - com.netflix.fenzo - fenzo-core - - - org.apache.commons - commons-dbcp2 - - - org.slf4j - slf4j-api - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-classic - - - - - - release - - - - src/main/ - - resources/bin/* - assembly/* - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - resources/conf/*.properties - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml - - - - - - single - - package - - - - - net.nicoulaj.maven.plugins - checksum-maven-plugin - - - - - - docker - - - - com.spotify - dockerfile-maven-plugin - - apache/shardingsphere-elasticjob-cloud-scheduler - ${project.version} - - ${project.build.finalName}-cloud-scheduler-bin - - - - - cloud-scheduler-bin - - build - - - - - - - - - diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml deleted file mode 100644 index f6189e7937..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/assembly/elasticjob-cloud-scheduler-binary-distribution.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - cloud-scheduler-bin - - tar.gz - - true - ${project.build.finalName}-cloud-scheduler-bin - - - - src/main/resources/conf - conf - 0755 - 0644 - - - src/main/resources - - logback.xml - - conf - 0755 - 0644 - - - src/main/resources/bin - bin - 0755 - 0755 - - - src/main/release-docs - - **/* - - / - - - - - - lib - 0755 - - - diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE deleted file mode 100644 index c3bf5bae68..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/LICENSE +++ /dev/null @@ -1,281 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed 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. - -======================================================================= -Apache ShardingSphere Subcomponents: - -The Apache ShardingSphere project contains subcomponents with separate -copyright notices and license terms. Your use of the source code for these -subcomponents is subject to the terms and conditions of the following -licenses. - -======================================================================== -Apache 2.0 licenses -======================================================================== - -The following components are provided under the Apache License. See project link for details. -The text of each license is the standard Apache 2.0 license. - - audience-annotations 0.5.0: https://github.com/apache/yetus, Apache 2.0 - commons-codec 1.16.0: https://github.com/apache/commons-codec, Apache 2.0 - commons-dbcp2 2.11.1: https://github.com/apache/commons-dbcp, Apache 2.0 - commons-exec 1.3: http://commons.apache.org/proper/commons-exec, Apache 2.0 - commons-lang 2.6: https://github.com/apache/commons-lang, Apache 2.0 - commons-lang3 3.12.0: https://github.com/apache/commons-lang, Apache 2.0 - commons-logging 1.2: https://github.com/apache/commons-logging, Apache 2.0 - commons-pool2 2.8.1: https://github.com/apache/commons-pool, Apache 2.0 - curator-client 5.5.0: https://github.com/apache/curator, Apache 2.0 - curator-framework 5.5.0: https://github.com/apache/curator, Apache 2.0 - curator-recipes 5.5.0: https://github.com/apache/curator, Apache 2.0 - error_prone_annotations 2.3.4: https://github.com/google/error-prone, Apache 2.0 - failureaccess 1.0.1:https://github.com/google/guava, Apache 2.0 - fenzo-core 1.0.1: https://github.com/Netflix/Fenzo, Apache 2.0 - gson 2.10.1: https://github.com/google/gson, Apache 2.0 - guava 32.1.2-jre: https://github.com/google/guava, Apache 2.0 - HikariCP-java7 2.4.13: https://github.com/brettwooldridge/HikariCP, Apache 2.0 - httpclient 4.5.14: https://github.com/apache/httpcomponents-client, Apache 2.0 - httpcore 4.4.16: https://github.com/apache/httpcomponents-core, Apache 2.0 - jackson-annotations 2.4.0: https://github.com/FasterXML/jackson-annotations, Apache 2.0 - jackson-core 2.4.5: https://github.com/FasterXML/jackson-core, Apache 2.0 - jackson-databind 2.4.5: https://github.com/FasterXML/jackson-core, Apache 2.0 - listenablefuture 9999.0-empty-to-avoid-conflict-with-guava:https://github.com/google/guava, Apache 2.0 - log4j 1.2.17: http://logging.apache.org/log4j/1.2/, Apache 2.0 - log4j-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, Apache 2.0 - mesos 1.11.0: http://mesos.apache.org/, Apache 2.0 - netty-buffer 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-codec 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-codec-http 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-common 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-handler 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-resolver 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-transport 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-transport-native-epoll 4.1.99.Final: https://github.com/netty, Apache 2.0 - netty-transport-native-unix-common 4.1.99.Final: https://github.com/netty, Apache 2.0 - quartz 2.3.2: https://github.com/quartz-scheduler/quartz, Apache 2.0 - snakeyaml 2.2: https://bitbucket.org/snakeyaml/snakeyaml/src, Apache 2.0 - zookeeper 3.9.0: https://github.com/apache/zookeeper, Apache 2.0 - zookeeper-jute 3.9.0: https://github.com/apache/zookeeper, Apache 2.0 - -======================================================================== -EPL licenses -======================================================================== - -The following components are provided under the EPL License. See project link for details. -The text of each license is also included at licenses/LICENSE-[project].txt. - - jakarta.annotation-api 1.3.5: https://github.com/eclipse-ee4j/common-annotations-api, EPL 2.0 - jakarta.el 3.0.3: https://github.com/eclipse-ee4j/el-ri, EPL 2.0 - logback-classic 1.2.12: https://github.com/qos-ch/logback, EPL 1.0 - logback-core 1.2.12: https://github.com/qos-ch/logback, EPL 1.0 - mchange-commons-java 0.2.15: https://github.com/swaldman/mchange-commons-java/tree/mchange-commons-java-0.2.15, EPL 1.0 - -======================================================================== -MIT licenses -======================================================================== - -The following components are provided under the MIT License. See project link for details. -The text of each license is also included at licenses/LICENSE-[project].txt. - - checker-qual 2.11.1: https://github.com/typetools/checker-framework, MIT - jcl-over-slf4j 1.7.36: https://github.com/qos-ch/slf4j, MIT - jul-to-slf4j 1.7.36: https://github.com/qos-ch/slf4j, MIT - slf4j-api 1.7.36: https://github.com/qos-ch/slf4j, MIT diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/NOTICE b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/NOTICE deleted file mode 100644 index 5d8d43bffe..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/NOTICE +++ /dev/null @@ -1,487 +0,0 @@ -Apache ShardingSphere -Copyright 2018-2022 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -======================================================================== - -Apache Yetus NOTICE - -======================================================================== - -Apache Yetus -Copyright 2008-2020 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (https://www.apache.org/). - ---- -Additional licenses for the Apache Yetus Source/Website: ---- - - -See LICENSE for terms. - -======================================================================== - -Apache Commons Codec NOTICE - -======================================================================== - -Apache Commons Codec -Copyright 2002-2020 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (https://www.apache.org/). - -src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java -contains test data from http://aspell.net/test/orig/batch0.tab. -Copyright (C) 2002 Kevin Atkinson (kevina@gnu.org) - -=============================================================================== - -The content of package org.apache.commons.codec.language.bm has been translated -from the original php source code available at http://stevemorse.org/phoneticinfo.htm -with permission from the original authors. -Original source copyright: -Copyright (c) 2008 Alexander Beider & Stephen P. Morse. - -======================================================================== - -Apache Commons DBCP NOTICE - -======================================================================== - -Apache Commons DBCP -Copyright 2001-2019 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -======================================================================== - -Apache Commons Exec NOTICE - -======================================================================== - -Apache Commons Exec -Copyright 2005-2019 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -======================================================================== - -Apache Commons Lang NOTICE - -======================================================================== - -Apache Commons Lang -Copyright 2001-2020 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (https://www.apache.org/). - -======================================================================== - -Apache Commons Pool NOTICE - -======================================================================== - -Apache Commons Pool -Copyright 2001-2019 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (https://www.apache.org/). - -======================================================================== - -Apache Curator NOTICE - -======================================================================== - -Apache Curator -Copyright 2013-2014 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -======================================================================== - -Apache log4j NOTICE - -======================================================================== - -Apache log4j -Copyright 2010 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -======================================================================== - -Netty NOTICE - -======================================================================== - - The Netty Project - ================= - -Please visit the Netty web site for more information: - - * https://netty.io/ - -Copyright 2014 The Netty Project - -The Netty Project 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. - -Also, please refer to each LICENSE..txt file, which is located in -the 'license' directory of the distribution file, for the license terms of the -components that this product depends on. - -------------------------------------------------------------------------------- -This product contains the extensions to Java Collections Framework which has -been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene: - - * LICENSE: - * license/LICENSE.jsr166y.txt (Public Domain) - * HOMEPAGE: - * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/ - * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/ - -This product contains a modified version of Robert Harder's Public Domain -Base64 Encoder and Decoder, which can be obtained at: - - * LICENSE: - * license/LICENSE.base64.txt (Public Domain) - * HOMEPAGE: - * http://iharder.sourceforge.net/current/java/base64/ - -This product contains a modified portion of 'Webbit', an event based -WebSocket and HTTP server, which can be obtained at: - - * LICENSE: - * license/LICENSE.webbit.txt (BSD License) - * HOMEPAGE: - * https://github.com/joewalnes/webbit - -This product contains a modified portion of 'SLF4J', a simple logging -facade for Java, which can be obtained at: - - * LICENSE: - * license/LICENSE.slf4j.txt (MIT License) - * HOMEPAGE: - * http://www.slf4j.org/ - -This product contains a modified portion of 'Apache Harmony', an open source -Java SE, which can be obtained at: - - * NOTICE: - * license/NOTICE.harmony.txt - * LICENSE: - * license/LICENSE.harmony.txt (Apache License 2.0) - * HOMEPAGE: - * http://archive.apache.org/dist/harmony/ - -This product contains a modified portion of 'jbzip2', a Java bzip2 compression -and decompression library written by Matthew J. Francis. It can be obtained at: - - * LICENSE: - * license/LICENSE.jbzip2.txt (MIT License) - * HOMEPAGE: - * https://code.google.com/p/jbzip2/ - -This product contains a modified portion of 'libdivsufsort', a C API library to construct -the suffix array and the Burrows-Wheeler transformed string for any input string of -a constant-size alphabet written by Yuta Mori. It can be obtained at: - - * LICENSE: - * license/LICENSE.libdivsufsort.txt (MIT License) - * HOMEPAGE: - * https://github.com/y-256/libdivsufsort - -This product contains a modified portion of Nitsan Wakart's 'JCTools', Java Concurrency Tools for the JVM, - which can be obtained at: - - * LICENSE: - * license/LICENSE.jctools.txt (ASL2 License) - * HOMEPAGE: - * https://github.com/JCTools/JCTools - -This product optionally depends on 'JZlib', a re-implementation of zlib in -pure Java, which can be obtained at: - - * LICENSE: - * license/LICENSE.jzlib.txt (BSD style License) - * HOMEPAGE: - * http://www.jcraft.com/jzlib/ - -This product optionally depends on 'Compress-LZF', a Java library for encoding and -decoding data in LZF format, written by Tatu Saloranta. It can be obtained at: - - * LICENSE: - * license/LICENSE.compress-lzf.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/ning/compress - -This product optionally depends on 'lz4', a LZ4 Java compression -and decompression library written by Adrien Grand. It can be obtained at: - - * LICENSE: - * license/LICENSE.lz4.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/jpountz/lz4-java - -This product optionally depends on 'lzma-java', a LZMA Java compression -and decompression library, which can be obtained at: - - * LICENSE: - * license/LICENSE.lzma-java.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/jponge/lzma-java - -This product contains a modified portion of 'jfastlz', a Java port of FastLZ compression -and decompression library written by William Kinney. It can be obtained at: - - * LICENSE: - * license/LICENSE.jfastlz.txt (MIT License) - * HOMEPAGE: - * https://code.google.com/p/jfastlz/ - -This product contains a modified portion of and optionally depends on 'Protocol Buffers', Google's data -interchange format, which can be obtained at: - - * LICENSE: - * license/LICENSE.protobuf.txt (New BSD License) - * HOMEPAGE: - * https://github.com/google/protobuf - -This product optionally depends on 'Bouncy Castle Crypto APIs' to generate -a temporary self-signed X.509 certificate when the JVM does not provide the -equivalent functionality. It can be obtained at: - - * LICENSE: - * license/LICENSE.bouncycastle.txt (MIT License) - * HOMEPAGE: - * http://www.bouncycastle.org/ - -This product optionally depends on 'Snappy', a compression library produced -by Google Inc, which can be obtained at: - - * LICENSE: - * license/LICENSE.snappy.txt (New BSD License) - * HOMEPAGE: - * https://github.com/google/snappy - -This product optionally depends on 'JBoss Marshalling', an alternative Java -serialization API, which can be obtained at: - - * LICENSE: - * license/LICENSE.jboss-marshalling.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/jboss-remoting/jboss-marshalling - -This product optionally depends on 'Caliper', Google's micro- -benchmarking framework, which can be obtained at: - - * LICENSE: - * license/LICENSE.caliper.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/google/caliper - -This product optionally depends on 'Apache Commons Logging', a logging -framework, which can be obtained at: - - * LICENSE: - * license/LICENSE.commons-logging.txt (Apache License 2.0) - * HOMEPAGE: - * http://commons.apache.org/logging/ - -This product optionally depends on 'Apache Log4J', a logging framework, which -can be obtained at: - - * LICENSE: - * license/LICENSE.log4j.txt (Apache License 2.0) - * HOMEPAGE: - * http://logging.apache.org/log4j/ - -This product optionally depends on 'Aalto XML', an ultra-high performance -non-blocking XML processor, which can be obtained at: - - * LICENSE: - * license/LICENSE.aalto-xml.txt (Apache License 2.0) - * HOMEPAGE: - * http://wiki.fasterxml.com/AaltoHome - -This product contains a modified version of 'HPACK', a Java implementation of -the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at: - - * LICENSE: - * license/LICENSE.hpack.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/twitter/hpack - -This product contains a modified version of 'HPACK', a Java implementation of -the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at: - - * LICENSE: - * license/LICENSE.hyper-hpack.txt (MIT License) - * HOMEPAGE: - * https://github.com/python-hyper/hpack/ - -This product contains a modified version of 'HPACK', a Java implementation of -the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at: - - * LICENSE: - * license/LICENSE.nghttp2-hpack.txt (MIT License) - * HOMEPAGE: - * https://github.com/nghttp2/nghttp2/ - -This product contains a modified portion of 'Apache Commons Lang', a Java library -provides utilities for the java.lang API, which can be obtained at: - - * LICENSE: - * license/LICENSE.commons-lang.txt (Apache License 2.0) - * HOMEPAGE: - * https://commons.apache.org/proper/commons-lang/ - - -This product contains the Maven wrapper scripts from 'Maven Wrapper', that provides an easy way to ensure a user has everything necessary to run the Maven build. - - * LICENSE: - * license/LICENSE.mvn-wrapper.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/takari/maven-wrapper - -This product contains the dnsinfo.h header file, that provides a way to retrieve the system DNS configuration on MacOS. -This private header is also used by Apple's open source - mDNSResponder (https://opensource.apple.com/tarballs/mDNSResponder/). - - * LICENSE: - * license/LICENSE.dnsinfo.txt (Apache License 2.0) - * HOMEPAGE: - * http://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h - -======================================================================== - -Apache Tomcat NOTICE - -======================================================================== - -Apache Tomcat -Copyright 1999-2019 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (https://www.apache.org/). - -This software contains code derived from netty-native -developed by the Netty project -(https://netty.io, https://github.com/netty/netty-tcnative/) -and from finagle-native developed at Twitter -(https://github.com/twitter/finagle). - -This software contains code derived from jgroups-kubernetes -developed by the JGroups project (http://www.jgroups.org/). - -The Windows Installer is built with the Nullsoft -Scriptable Install System (NSIS), which is -open source software. The original software and -related information is available at -http://nsis.sourceforge.net. - -Java compilation software for JSP pages is provided by the Eclipse -JDT Core Batch Compiler component, which is open source software. -The original software and related information is available at -https://www.eclipse.org/jdt/core/. - -org.apache.tomcat.util.json.JSONParser.jj is a public domain javacc grammar -for JSON written by Robert Fischer. -https://github.com/RobertFischer/json-parser - -For portions of the Tomcat JNI OpenSSL API and the OpenSSL JSSE integration -The org.apache.tomcat.jni and the org.apache.tomcat.net.openssl packages -are derivative work originating from the Netty project and the finagle-native -project developed at Twitter -* Copyright 2014 The Netty Project -* Copyright 2014 Twitter - -For portions of the Tomcat cloud support -The org.apache.catalina.tribes.membership.cloud package contains derivative -work originating from the jgroups project. -https://github.com/jgroups-extras/jgroups-kubernetes -Copyright 2002-2018 Red Hat Inc. - -The original XML Schemas for Java EE Deployment Descriptors: - - javaee_5.xsd - - javaee_web_services_1_2.xsd - - javaee_web_services_client_1_2.xsd - - javaee_6.xsd - - javaee_web_services_1_3.xsd - - javaee_web_services_client_1_3.xsd - - jsp_2_2.xsd - - web-app_3_0.xsd - - web-common_3_0.xsd - - web-fragment_3_0.xsd - - javaee_7.xsd - - javaee_web_services_1_4.xsd - - javaee_web_services_client_1_4.xsd - - jsp_2_3.xsd - - web-app_3_1.xsd - - web-common_3_1.xsd - - web-fragment_3_1.xsd - - javaee_8.xsd - - web-app_4_0.xsd - - web-common_4_0.xsd - - web-fragment_4_0.xsd - -may be obtained from: -http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html - - -This product contains the Maven wrapper scripts from 'Maven Wrapper', that provides an easy way to ensure a user has everything necessary to run the Maven build. - - * LICENSE: - * license/LICENSE.mvn-wrapper.txt (Apache License 2.0) - * HOMEPAGE: - * https://github.com/takari/maven-wrapper - -======================================================================== - -Apache ZooKeeper NOTICE - -======================================================================== - -Apache ZooKeeper -Copyright 2009-2014 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). - -This product includes software components originally -developed for Airlift (https://github.com/airlift/airlift), -licensed under the Apache 2.0 license. The licensing terms -for Airlift code can be found at: -https://github.com/airlift/airlift/blob/master/LICENSE - -======================================================================== - -Apache Mesos NOTICE - -======================================================================== - -Apache Mesos -Copyright 2013, The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/README.txt b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/README.txt deleted file mode 100644 index 1e75b341d9..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/README.txt +++ /dev/null @@ -1,31 +0,0 @@ -Welcome to Apache ShardingSphere-ElasticJob -=============================================================================== - -ElasticJob is a distributed scheduling solution consisting of two separate projects, ElasticJob-Lite and ElasticJob-Cloud. - -Through the functions of flexible scheduling, resource management and job management, -it creates a distributed scheduling solution suitable for Internet scenarios, -and provides a diversified job ecosystem through open architecture design. -It uses a unified job API for each project. -Developers only need code one time and can deploy at will. - -ElasticJob-Cloud uses Mesos to manage and isolate resources. - -ElasticJob became an Apache ShardingSphere Sub project on May 28 2020. - -Getting Started -=============================================================================== -To help you get started, try the following links: - -Getting Started - https://shardingsphere.apache.org/elasticjob/current/en/quick-start/ - -We welcome contributions of all kinds, for details of how you can help - https://shardingsphere.apache.org/community/en/contribute/ - -Find the issue tracker from here - https://github.com/apache/shardingsphere-elasticjob/issues - -Please help us make Apache ShardingSphere-ElasticJob better - we appreciate any feedback you may have. - -Have fun! diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-checker-framework.txt b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-checker-framework.txt deleted file mode 100644 index 8037dfa6c6..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-checker-framework.txt +++ /dev/null @@ -1,417 +0,0 @@ -checker-qual License ---------------- - -The Checker Framework -Copyright 2004-present by the Checker Framework developers - - -Most of the Checker Framework is licensed under the GNU General Public -License, version 2 (GPL2), with the classpath exception. The text of this -license appears below. This is the same license used for OpenJDK. - -A few parts of the Checker Framework have more permissive licenses, notably -the parts that you might want to include with your own program. - - * The annotations and utility files are licensed under the MIT License. - (The text of this license also appears below.) This applies to the - checker-qual*.jar and all the files that appear in it: every file in a - qual/ directory, plus utility files FormatUtil.java, - I18nFormatUtil.java, NullnessUtil.java, Opt.java, PurityUnqualified.java, - RegexUtil.java, SignednessUtil.java, SignednessUtilExtra.java, and - UnitsTools.java. It also applies to the cleanroom implementations of - third-party annotations (in checker/src/testannotations/ and in - framework/src/main/java/org/jmlspecs/). - -The Checker Framework includes annotations for some libraries. Those in -.astub files use the MIT License. Those in https://github.com/typetools/jdk -(which appears in the annotated-jdk directory of file checker.jar) use the -GPL2 license. - -Some external libraries that are included with the Checker Framework -distribution have different licenses. Here are some examples. - - * javaparser is dual licensed under the LGPL or the Apache license -- you - may use it under whichever one you want. (The javaparser source code - contains a file with the text of the GPL, but it is not clear why, since - javaparser does not use the GPL.) See - https://github.com/typetools/stubparser . - - * Annotation Tools (https://github.com/typetools/annotation-tools) uses - the MIT license. - - * Libraries in plume-lib (https://github.com/plume-lib/) are licensed - under the MIT License. - -=========================================================================== - -The GNU General Public License (GPL) - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. This General Public License applies to -most of the Free Software Foundation's software and to any other program whose -authors commit to using it. (Some other Free Software Foundation software is -covered by the GNU Library General Public License instead.) You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom to -distribute copies of free software (and charge for this service if you wish), -that you receive source code or can get it if you want it, that you can change -the software or use pieces of it in new free programs; and that you know you -can do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny -you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the -software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for -a fee, you must give the recipients all the rights that you have. You must -make sure that they, too, receive or can get the source code. And you must -show them these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) -offer you this license which gives you legal permission to copy, distribute -and/or modify the software. - -Also, for each author's protection and ours, we want to make certain that -everyone understands that there is no warranty for this free software. If the -software is modified by someone else and passed on, we want its recipients to -know that what they have is not the original, so that any problems introduced -by others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We -wish to avoid the danger that redistributors of a free program will -individually obtain patent licenses, in effect making the program proprietary. -To prevent this, we have made it clear that any patent must be licensed for -everyone's free use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification -follow. - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms of -this General Public License. The "Program", below, refers to any such program -or work, and a "work based on the Program" means either the Program or any -derivative work under copyright law: that is to say, a work containing the -Program or a portion of it, either verbatim or with modifications and/or -translated into another language. (Hereinafter, translation is included -without limitation in the term "modification".) Each licensee is addressed as -"you". - -Activities other than copying, distribution and modification are not covered by -this License; they are outside its scope. The act of running the Program is -not restricted, and the output from the Program is covered only if its contents -constitute a work based on the Program (independent of having been made by -running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as -you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this License -and to the absence of any warranty; and give any other recipients of the -Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may -at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus -forming a work based on the Program, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all of -these conditions: - - a) You must cause the modified files to carry prominent notices stating - that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in whole or - in part contains or is derived from the Program or any part thereof, to be - licensed as a whole at no charge to all third parties under the terms of - this License. - - c) If the modified program normally reads commands interactively when run, - you must cause it, when started running for such interactive use in the - most ordinary way, to print or display an announcement including an - appropriate copyright notice and a notice that there is no warranty (or - else, saying that you provide a warranty) and that users may redistribute - the program under these conditions, and telling the user how to view a copy - of this License. (Exception: if the Program itself is interactive but does - not normally print such an announcement, your work based on the Program is - not required to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be reasonably -considered independent and separate works in themselves, then this License, and -its terms, do not apply to those sections when you distribute them as separate -works. But when you distribute the same sections as part of a whole which is a -work based on the Program, the distribution of the whole must be on the terms -of this License, whose permissions for other licensees extend to the entire -whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise the -right to control the distribution of derivative or collective works based on -the Program. - -In addition, mere aggregation of another work not based on the Program with the -Program (or with a work based on the Program) on a volume of a storage or -distribution medium does not bring the other work under the scope of this -License. - -3. You may copy and distribute the Program (or a work based on it, under -Section 2) in object code or executable form under the terms of Sections 1 and -2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source - code, which must be distributed under the terms of Sections 1 and 2 above - on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three years, to - give any third party, for a charge no more than your cost of physically - performing source distribution, a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of Sections 1 - and 2 above on a medium customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer to - distribute corresponding source code. (This alternative is allowed only - for noncommercial distribution and only if you received the program in - object code or executable form with such an offer, in accord with - Subsection b above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all -the source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and installation -of the executable. However, as a special exception, the source code -distributed need not include anything that is normally distributed (in either -source or binary form) with the major components (compiler, kernel, and so on) -of the operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the source -code from the same place counts as distribution of the source code, even though -third parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as -expressly provided under this License. Any attempt otherwise to copy, modify, -sublicense or distribute the Program is void, and will automatically terminate -your rights under this License. However, parties who have received copies, or -rights, from you under this License will not have their licenses terminated so -long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. -However, nothing else grants you permission to modify or distribute the Program -or its derivative works. These actions are prohibited by law if you do not -accept this License. Therefore, by modifying or distributing the Program (or -any work based on the Program), you indicate your acceptance of this License to -do so, and all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), -the recipient automatically receives a license from the original licensor to -copy, distribute or modify the Program subject to these terms and conditions. -You may not impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance by -third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), conditions -are imposed on you (whether by court order, agreement or otherwise) that -contradict the conditions of this License, they do not excuse you from the -conditions of this License. If you cannot distribute so as to satisfy -simultaneously your obligations under this License and any other pertinent -obligations, then as a consequence you may not distribute the Program at all. -For example, if a patent license would not permit royalty-free redistribution -of the Program by all those who receive copies directly or indirectly through -you, then the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and -the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or -other property right claims or to contest validity of any such claims; this -section has the sole purpose of protecting the integrity of the free software -distribution system, which is implemented by public license practices. Many -people have made generous contributions to the wide range of software -distributed through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing to -distribute software through any other system and a licensee cannot impose that -choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original -copyright holder who places the Program under this License may add an explicit -geographical distribution limitation excluding those countries, so that -distribution is permitted only in or among countries not thus excluded. In -such case, this License incorporates the limitation as if written in the body -of this License. - -9. The Free Software Foundation may publish revised and/or new versions of the -General Public License from time to time. Such new versions will be similar in -spirit to the present version, but may differ in detail to address new problems -or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any later -version", you have the option of following the terms and conditions either of -that version or of any later version published by the Free Software Foundation. -If the Program does not specify a version number of this License, you may -choose any version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software Foundation, -write to the Free Software Foundation; we sometimes make exceptions for this. -Our decision will be guided by the two goals of preserving the free status of -all derivatives of our free software and of promoting the sharing and reuse of -software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR -THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE -STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE -PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, -YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE -PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR -INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA -BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER -OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible -use to the public, the best way to achieve this is to make it free software -which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively convey the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - - One line to give the program's name and a brief idea of what it does. - - Copyright (C) - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., 59 - Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this when it -starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author Gnomovision comes - with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free - software, and you are welcome to redistribute it under certain conditions; - type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may be -called something other than 'show w' and 'show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the program, if necessary. Here -is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - 'Gnomovision' (which makes passes at compilers) written by James Hacker. - - signature of Ty Coon, 1 April 1989 - - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General Public -License instead of this License. - - -"CLASSPATH" EXCEPTION TO THE GPL - -Certain source files distributed by Oracle America and/or its affiliates are -subject to the following clarification and special exception to the GPL, but -only where Oracle has expressly included in the particular source file's header -the words "Oracle designates this particular file as subject to the "Classpath" -exception as provided by Oracle in the LICENSE file that accompanied this code." - - Linking this library statically or dynamically with other modules is making - a combined work based on this library. Thus, the terms and conditions of - the GNU General Public License cover the whole combination. - - As a special exception, the copyright holders of this library give you - permission to link this library with independent modules to produce an - executable, regardless of the license terms of these independent modules, - and to copy and distribute the resulting executable under terms of your - choice, provided that you also meet, for each linked independent module, - the terms and conditions of the license of that module. An independent - module is a module which is not derived from or based on this library. If - you modify this library, you may extend this exception to your version of - the library, but you are not obligated to do so. If you do not wish to do - so, delete this exception statement from your version. - -=========================================================================== - -MIT License: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -=========================================================================== \ No newline at end of file diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jcl-over-slf4j.txt b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jcl-over-slf4j.txt deleted file mode 100644 index 075d57ef7e..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jcl-over-slf4j.txt +++ /dev/null @@ -1,24 +0,0 @@ -jcl-over-slf4j License ---------------- - -Copyright (c) 2004-2017 QOS.ch - All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jul-to-slf4j.txt b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jul-to-slf4j.txt deleted file mode 100644 index 49bfdb9886..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-jul-to-slf4j.txt +++ /dev/null @@ -1,24 +0,0 @@ -jul-to-slf4j License ---------------- - -Copyright (c) 2004-2017 QOS.ch - All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-logback.txt b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-logback.txt deleted file mode 100644 index 1a6915c13c..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-logback.txt +++ /dev/null @@ -1,14 +0,0 @@ -Logback License ---------------- - -Logback: the reliable, generic, fast and flexible logging framework. -Copyright (C) 1999-2015, QOS.ch. All rights reserved. - -This program and the accompanying materials are dual-licensed under -either the terms of the Eclipse Public License v1.0 as published by -the Eclipse Foundation - - or (per the licensee's choosing) - -under the terms of the GNU Lesser General Public License version 2.1 -as published by the Free Software Foundation. diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-mchange-commons.txt b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-mchange-commons.txt deleted file mode 100644 index 3b9930575e..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-mchange-commons.txt +++ /dev/null @@ -1,245 +0,0 @@ -mchange-commons License ---------------- - -/* - * This library is free software; you can redistribute it and/or modify - * it under the terms of EITHER: - * - * 1) The GNU Lesser General Public License (LGPL), version 2.1, as - * published by the Free Software Foundation - * - * OR - * - * 2) The Eclipse Public License (EPL), version 1.0 - * - * You may choose which license to accept if you wish to redistribute - * or modify this work. You may offer derivatives of this work - * under the license you have chosen, or you may provide the same - * choice of license which you have been offered here. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * You should have received copies of both LGPL v2.1 and EPL v1.0 - * along with this software; see the files LICENSE-EPL and LICENSE-LGPL. - * If not, the text of these licenses are currently available at - * - * LGPL v2.1: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html - * EPL v1.0: http://www.eclipse.org/org/documents/epl-v10.php - */ - ---------------- - -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC -LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM -CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation - distributed under this Agreement, and - -b) in the case of each subsequent Contributor: - - i) changes to the Program, and - - ii) additions to the Program; - -where such changes and/or additions to the Program originate from and are -distributed by that particular Contributor. A Contribution 'originates' from -a Contributor if it was added to the Program by such Contributor itself or -anyone acting on such Contributor’s behalf. Contributions do not include -additionsto the Program which: (i) are separate modules of software distributed -in conjunction with the Program under their own license agreement, and (ii) are -not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents " mean patent claims licensable by a Contributor which are -necessarily infringed by the use or sale of its Contribution alone or when -combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, -including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, royalty-free copyright license to -reproduce, prepare derivative works of, publicly display, publicly perform, -distribute and sublicense the Contribution of such Contributor, if any, and such -derivative works, in source code and object code form. - -b) Subject to the terms of this Agreement, each Contributor hereby grants -Recipient a non-exclusive, worldwide, royalty-free patent license under -Licensed Patents to make, use, sell, offer to sell, import and otherwise -transfer the Contribution of such Contributor, if any, in source code and -object code form. This patent license shall apply to the combination of the -Contribution and the Program if, at the time the Contribution is added by the -Contributor, such addition of the Contribution causes such combination to be -covered by the Licensed Patents. The patent license shall not apply to any -other combinations which include the Contribution. No hardware per se is -licensed hereunder. - -c) Recipient understands that although each Contributor grants the licenses to -its Contributions set forth herein, no assurances are provided by any -Contributor that the Program does not infringe the patent or other intellectual -property rights of any other entity. Each Contributor disclaims any liability -to Recipient for claims brought by any other entity based on infringement of -intellectual property rights or otherwise. As a condition to exercising the -rights and licenses granted hereunder, each Recipient hereby assumes sole -responsibility to secure any other intellectual property rights needed, if any. -For example, if a third party patent license is required to allow Recipient to -distribute the Program, it is Recipient’s responsibility to acquire that -license before distributing the Program. - -d) Each Contributor represents that to its knowledge it has sufficient -copyright rights in its Contribution, if any, to grant the copyright license -set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under -its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and - -b) its license agreement: - - i) effectively disclaims on behalf of all Contributors all warranties and - conditions, express and implied, including warranties or conditions of - title and non-infringement, and implied warranties or conditions of - merchantability and fitness for a particular purpose; - - ii) effectively excludes on behalf of all Contributors all liability for - damages, including direct, indirect, special, incidental and - consequential damages, such as lost profits; - - iii) states that any provisions which differ from this Agreement are - offered by that Contributor alone and not by any other party; and - - iv) states that source code for the Program is available from such - Contributor, and informs licensees how to obtain it in a reasonable - manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and - -b) a copy of this Agreement must be included with each copy of the Program. - -Contributors may not remove or alter any copyright notices contained within -the Program. - -Each Contributor must identify itself as the originator of its Contribution, -if any, in a manner that reasonably allows subsequent Recipients to identify -the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with -respect to end users, business partners and the like. While this license is -intended to facilitate the commercial use of the Program, the Contributor who -includes the Program in a commercial product offering should do so in a manner -which does not create potential liability for other Contributors. Therefore, -if a Contributor includes the Program in a commercial product offering, such -Contributor ("Commercial Contributor") hereby agrees to defend and indemnify -every other Contributor ("Indemnified Contributor") against any losses, damages -and costs (collectively "Losses") arising from claims, lawsuits and other legal -actions brought by a third party against the Indemnified Contributor to the -extent caused by the acts or omissions of such Commercial Contributor in -connection with its distribution of the Program in a commercial product -offering. The obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. In order -to qualify, an Indemnified Contributor must: a) promptly notify the Commercial -Contributor in writing of such claim, and b) allow the Commercial Contributor -to control, and cooperate with the Commercial Contributor in, the defense and -any related settlement negotiations. The Indemnified Contributor may participate -in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product -offering, Product X. That Contributor is then a Commercial Contributor. If that -Commercial Contributor then makes performance claims, or offers warranties -related to Product X, those performance claims and warranties are such -Commercial Contributor’s responsibility alone. Under this section, the -Commercial Contributor would have to defend claims against the other -Contributors related to those performance claims and warranties, and if a court -requires any other Contributor to pay any damages as a result, the Commercial -Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR -IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, -NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each -Recipient is solely responsible for determining the appropriateness of using -and distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to the -risks and costs of program errors, compliance with applicable laws, damage to -or loss of data, programs or equipment, and unavailability or interruption of -operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY -CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST -PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS -GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable -law, it shall not affect the validity or enforceability of the remainder of the -terms of this Agreement, and without further action by the parties hereto, such -provision shall be reformed to the minimum extent necessary to make such -provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Program itself -(excluding combinations of the Program with other software or hardware) -infringes such Recipient’s patent(s), then such Recipient’s rights granted -under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient’s rights under this Agreement shall terminate if it fails to -comply with any of the material terms or conditions of this Agreement and does -not cure such failure in a reasonable period of time after becoming aware of -such noncompliance. If all Recipient’s rights under this Agreement terminate, -Recipient agrees to cease use and distribution of the Program as soon as -reasonably practicable. However, Recipient’s obligations under this Agreement -and any licenses granted by Recipient relating to the Program shall continue -and survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in -order to avoid inconsistency the Agreement is copyrighted and may only be -modified in the following manner. The Agreement Steward reserves the right to -publish new versions (including revisions) of this Agreement from time to time. -No one other than the Agreement Steward has the right to modify this Agreement. -The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation -may assign the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) may always -be distributed subject to the version of the Agreement under which it was -received. In addition, after a new version of the Agreement is published, -Contributor may elect to distribute the Program (including its Contributions) -under the new version. Except as expressly stated in Sections 2(a) and 2(b) -above, Recipient receives no rights or licenses to the intellectual property of -any Contributor under this Agreement, whether expressly, by implication, -estoppel or otherwise. All rights in the Program not expressly granted under -this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and the -intellectual property laws of the United States of America. No party to this -Agreement will bring a legal action under this Agreement more than one year -after the cause of action arose. Each party waives its rights to a jury trial -in any resulting litigation. diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-slf4j.txt b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-slf4j.txt deleted file mode 100644 index ee5909040a..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/release-docs/licenses/LICENSE-slf4j.txt +++ /dev/null @@ -1,24 +0,0 @@ -SLF4J License ---------------- - -Copyright (c) 2004-2017 QOS.ch - All rights reserved. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/dcos.sh b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/dcos.sh deleted file mode 100644 index 1758ef8ead..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/dcos.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# -# 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. -# - -cd `dirname $0` -cd .. -DEPLOY_DIR=`pwd` -LIB_DIR=${DEPLOY_DIR}/lib/* -CONTAINER_MAIN=org.apache.shardingsphere.elasticjob.cloud.scheduler.Bootstrap -JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64" - -java ${JAVA_OPTS} -classpath ${LIB_DIR}:. ${CONTAINER_MAIN} diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/start.sh b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/start.sh deleted file mode 100644 index bc2ffea63f..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/bin/start.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# -# 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. -# - -cd `dirname $0` -cd .. -DEPLOY_DIR=`pwd` -CONF_DIR=${DEPLOY_DIR}/conf -LIB_DIR=${DEPLOY_DIR}/lib/* -CONTAINER_MAIN=org.apache.shardingsphere.elasticjob.cloud.scheduler.Bootstrap -JAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64" - -source ${CONF_DIR}/elasticjob-cloud-scheduler.properties -if [ ${hostname} = "" ] || [ ${hostname} = "127.0.0.1" ] || [ ${hostname} = "localhost" ]; then - echo "Please config hostname in conf/elasticjob-cloud-scheduler.properties with a routable IP address." - exit; -fi -export LIBPROCESS_IP=${hostname} - -java ${JAVA_OPTS} -classpath ${CONF_DIR}:${LIB_DIR}:. ${CONTAINER_MAIN} diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/conf/elasticjob-cloud-scheduler.properties b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/conf/elasticjob-cloud-scheduler.properties deleted file mode 100644 index 6f78c07d8d..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/conf/elasticjob-cloud-scheduler.properties +++ /dev/null @@ -1,68 +0,0 @@ -# -# 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. -# - -# Routable IP address -hostname=127.0.0.1 - -# Username for mesos framework -user= - -# Mesos zookeeper address -mesos_url=zk://127.0.0.1:2181/mesos - -# Role for mesos framework - -#mesos_role= - -# ElasticJob-Cloud's zookeeper address -zk_servers=127.0.0.1:2181 - -# ElasticJob-Cloud's zookeeper namespace -zk_namespace=elasticjob-cloud - -# ElasticJob-Cloud's zookeeper digest -zk_digest= - -# Job rest API port -http_port=8899 - -# Max size of job accumulated -job_state_queue_size=10000 - -# Event trace rdb config - -#event_trace_rdb_driver=com.mysql.jdbc.Driver - -#event_trace_rdb_url=jdbc:mysql://localhost:3306/elastic_job_cloud_log - -#event_trace_rdb_username=root - -#event_trace_rdb_password= - -# Task reconciliation interval - -#reconcile_interval_minutes=-1 - -# Enable/Disable mesos partition aware feature - -# enable_partition_aware=false - -# Auth username -auth_username=root - -# Auth password -auth_password=pwd diff --git a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/logback.xml b/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/logback.xml deleted file mode 100644 index 3a56e58217..0000000000 --- a/elasticjob-distribution/elasticjob-cloud-scheduler-distribution/src/main/resources/logback.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - ${log.context.name} - - - - ${log.pattern} - - - - - ${log.directory}${log.context.name}-log.%d{yyyy-MM-dd}.log - ${log.maxHistory} - - - ${log.pattern} - - - - - - - 0 - ${log.async.queue.size} - - - - - - ${log.error.log.level} - - - ${log.directory}${log.context.name}-error.%d{yyyy-MM-dd}.log - ${log.maxHistory} - - - ${log.pattern} - - - - - - - - - - - - - diff --git a/elasticjob-distribution/elasticjob-lite-distribution/src/main/release-docs/README.txt b/elasticjob-distribution/elasticjob-lite-distribution/src/main/release-docs/README.txt deleted file mode 100644 index ce277655cf..0000000000 --- a/elasticjob-distribution/elasticjob-lite-distribution/src/main/release-docs/README.txt +++ /dev/null @@ -1,31 +0,0 @@ -Welcome to Apache ShardingSphere-ElasticJob -=============================================================================== - -ElasticJob is a distributed scheduling solution consisting of two separate projects, ElasticJob-Lite and ElasticJob-Cloud. - -Through the functions of flexible scheduling, resource management and job management, -it creates a distributed scheduling solution suitable for Internet scenarios, -and provides a diversified job ecosystem through open architecture design. -It uses a unified job API for each project. -Developers only need code one time and can deploy at will. - -ElasticJob-Lite is a lightweight, decentralized solution that provides distributed task sharding services. - -ElasticJob became an Apache ShardingSphere Sub project on May 28 2020. - -Getting Started -=============================================================================== -To help you get started, try the following links: - -Getting Started - https://shardingsphere.apache.org/elasticjob/current/en/quick-start/ - -We welcome contributions of all kinds, for details of how you can help - https://shardingsphere.apache.org/community/en/contribute/ - -Find the issue tracker from here - https://github.com/apache/shardingsphere-elasticjob/issues - -Please help us make Apache ShardingSphere-ElasticJob better - we appreciate any feedback you may have. - -Have fun! diff --git a/elasticjob-distribution/pom.xml b/elasticjob-distribution/pom.xml index eba35b5202..ea0183ef0f 100644 --- a/elasticjob-distribution/pom.xml +++ b/elasticjob-distribution/pom.xml @@ -29,9 +29,7 @@ elasticjob-src-distribution - elasticjob-lite-distribution - elasticjob-cloud-executor-distribution - elasticjob-cloud-scheduler-distribution + elasticjob-bin-distribution diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java index 3e1a286039..cef09d3fd9 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java @@ -44,8 +44,6 @@ public final class JobStatusTraceEvent implements JobEvent { private final String slaveId; - private final Source source; - private final String executionType; private final String shardingItems; @@ -59,8 +57,4 @@ public final class JobStatusTraceEvent implements JobEvent { public enum State { TASK_STAGING, TASK_RUNNING, TASK_FINISHED, TASK_KILLED, TASK_LOST, TASK_FAILED, TASK_ERROR, TASK_DROPPED, TASK_GONE, TASK_GONE_BY_OPERATOR, TASK_UNREACHABLE, TASK_UNKNOWN } - - public enum Source { - CLOUD_SCHEDULER, CLOUD_EXECUTOR, LITE_EXECUTOR - } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml index 6c61d95ceb..bd9617984c 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index be6f2d310c..18f05eb349 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -21,7 +21,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.tracing.exception.WrapException; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType; @@ -353,12 +352,11 @@ public boolean addJobStatusTraceEvent(final JobStatusTraceEvent jobStatusTraceEv preparedStatement.setString(3, originalTaskId); preparedStatement.setString(4, jobStatusTraceEvent.getTaskId()); preparedStatement.setString(5, jobStatusTraceEvent.getSlaveId()); - preparedStatement.setString(6, jobStatusTraceEvent.getSource().toString()); - preparedStatement.setString(7, jobStatusTraceEvent.getExecutionType()); - preparedStatement.setString(8, jobStatusTraceEvent.getShardingItems()); - preparedStatement.setString(9, jobStatusTraceEvent.getState().toString()); - preparedStatement.setString(10, truncateString(jobStatusTraceEvent.getMessage())); - preparedStatement.setTimestamp(11, new Timestamp(jobStatusTraceEvent.getCreationTime().getTime())); + preparedStatement.setString(6, jobStatusTraceEvent.getExecutionType()); + preparedStatement.setString(7, jobStatusTraceEvent.getShardingItems()); + preparedStatement.setString(8, jobStatusTraceEvent.getState().toString()); + preparedStatement.setString(9, truncateString(jobStatusTraceEvent.getMessage())); + preparedStatement.setTimestamp(10, new Timestamp(jobStatusTraceEvent.getCreationTime().getTime())); preparedStatement.execute(); result = true; } catch (final SQLException ex) { @@ -399,8 +397,8 @@ List getJobStatusTraceEvents(final String taskId) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), - resultSet.getString(5), Source.valueOf(resultSet.getString(6)), resultSet.getString(7), resultSet.getString(8), - State.valueOf(resultSet.getString(9)), resultSet.getString(10), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(resultSet.getString(11))); + resultSet.getString(5), resultSet.getString(6), resultSet.getString(7), + State.valueOf(resultSet.getString(8)), resultSet.getString(9), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(resultSet.getString(10))); result.add(jobStatusTraceEvent); } } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/DB2.properties b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/DB2.properties index 61dcf4fdf4..5a5529287a 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/DB2.properties +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/DB2.properties @@ -23,9 +23,9 @@ JOB_EXECUTION_LOG.INSERT_FAILURE=INSERT INTO JOB_EXECUTION_LOG (id, job_name, ta JOB_EXECUTION_LOG.UPDATE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ? WHERE id = ? JOB_EXECUTION_LOG.UPDATE_FAILURE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ?, failure_cause = ? WHERE id = ? -JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, source VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) +JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) TASK_ID_STATE_INDEX.INDEX.CREATE=CREATE INDEX TASK_ID_STATE_INDEX ON JOB_STATUS_TRACE_LOG (task_id(128), state) -JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) JOB_STATUS_TRACE_LOG.SELECT=SELECT * FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID=SELECT * FROM (SELECT ROWNUMBER() OVER() AS ROW, A.* FROM JOB_STATUS_TRACE_LOG A WHERE A.TASK_ID = '4' AND A.STATE= 'TASK_STAGING') AS B WHERE B.ROW = 1 diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/H2.properties b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/H2.properties index c4a6e44a33..12da9d9b77 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/H2.properties +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/H2.properties @@ -23,9 +23,9 @@ JOB_EXECUTION_LOG.INSERT_FAILURE=INSERT INTO JOB_EXECUTION_LOG (id, job_name, ta JOB_EXECUTION_LOG.UPDATE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ? WHERE id = ? JOB_EXECUTION_LOG.UPDATE_FAILURE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ?, failure_cause = ? WHERE id = ? -JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE IF NOT EXISTS JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, source VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) +JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE IF NOT EXISTS JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) TASK_ID_STATE_INDEX.INDEX.CREATE=CREATE INDEX IF NOT EXISTS TASK_ID_STATE_INDEX ON JOB_STATUS_TRACE_LOG (task_id, state) -JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) JOB_STATUS_TRACE_LOG.SELECT=SELECT * FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID=SELECT original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? and state= 'TASK_STAGING' LIMIT 1 diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/MySQL.properties b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/MySQL.properties index 7b5cc534da..6fc885a0bb 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/MySQL.properties +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/MySQL.properties @@ -47,7 +47,6 @@ JOB_STATUS_TRACE_LOG.TABLE.CREATE= CREATE TABLE \ original_task_id VARCHAR (255) NOT NULL, \ task_id VARCHAR (255) NOT NULL, \ slave_id VARCHAR (50) NOT NULL, \ - source VARCHAR (50) NOT NULL, \ execution_type VARCHAR (20) NOT NULL, \ sharding_item VARCHAR (100) NOT NULL, \ state VARCHAR (20) NOT NULL, \ @@ -58,6 +57,6 @@ JOB_STATUS_TRACE_LOG.TABLE.CREATE= CREATE TABLE \ TASK_ID_STATE_INDEX.INDEX.CREATE=CREATE INDEX TASK_ID_STATE_INDEX ON JOB_STATUS_TRACE_LOG (task_id(128), state) -JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) JOB_STATUS_TRACE_LOG.SELECT=SELECT id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID=SELECT original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? and state= 'TASK_STAGING' LIMIT 1 diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/Oracle.properties b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/Oracle.properties index 5952f0904d..be0257b995 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/Oracle.properties +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/Oracle.properties @@ -23,9 +23,9 @@ JOB_EXECUTION_LOG.INSERT_FAILURE=INSERT INTO JOB_EXECUTION_LOG (id, job_name, ta JOB_EXECUTION_LOG.UPDATE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ? WHERE id = ? JOB_EXECUTION_LOG.UPDATE_FAILURE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ?, failure_cause = ? WHERE id = ? -JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, source VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) +JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) TASK_ID_STATE_INDEX.INDEX.CREATE=CREATE INDEX TASK_ID_STATE_INDEX ON JOB_STATUS_TRACE_LOG (task_id, state) -JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) JOB_STATUS_TRACE_LOG.SELECT=SELECT * FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID=SELECT original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? and state= 'TASK_STAGING' and ROWNUM = 1 diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/PostgreSQL.properties b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/PostgreSQL.properties index 815b6b9f6d..5b55fa1631 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/PostgreSQL.properties +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/PostgreSQL.properties @@ -23,9 +23,9 @@ JOB_EXECUTION_LOG.INSERT_FAILURE=INSERT INTO JOB_EXECUTION_LOG (id, job_name, ta JOB_EXECUTION_LOG.UPDATE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ? WHERE id = ? JOB_EXECUTION_LOG.UPDATE_FAILURE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ?, failure_cause = ? WHERE id = ? -JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, source VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) +JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) TASK_ID_STATE_INDEX.INDEX.CREATE=CREATE INDEX TASK_ID_STATE_INDEX ON JOB_STATUS_TRACE_LOG (task_id, state) -JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) JOB_STATUS_TRACE_LOG.SELECT=SELECT * FROM JOB_STATUS_TRACE_LOG WHERE task_id=? JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID=SELECT original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id=? and state='TASK_STAGING' LIMIT 1 diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQL92.properties b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQL92.properties index 1d0f5c1c23..8eb2c74137 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQL92.properties +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQL92.properties @@ -23,9 +23,9 @@ JOB_EXECUTION_LOG.INSERT_FAILURE=INSERT INTO JOB_EXECUTION_LOG (id, job_name, ta JOB_EXECUTION_LOG.UPDATE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ? WHERE id = ? JOB_EXECUTION_LOG.UPDATE_FAILURE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ?, failure_cause = ? WHERE id = ? -JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id CHARACTER(40) NOT NULL, job_name CHARACTER(100) NOT NULL, original_task_id CHARACTER(255) NOT NULL, task_id CHARACTER(255) NOT NULL, slave_id CHARACTER(50) NOT NULL, source CHARACTER(50) NOT NULL, execution_type CHARACTER(20) NOT NULL, sharding_item CHARACTER(100) NOT NULL, state CHARACTER(20) NOT NULL, message CHARACTER VARYING(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) +JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id CHARACTER(40) NOT NULL, job_name CHARACTER(100) NOT NULL, original_task_id CHARACTER(255) NOT NULL, task_id CHARACTER(255) NOT NULL, slave_id CHARACTER(50) NOT NULL, execution_type CHARACTER(20) NOT NULL, sharding_item CHARACTER(100) NOT NULL, state CHARACTER(20) NOT NULL, message CHARACTER VARYING(4000) NULL, creation_time TIMESTAMP NULL, PRIMARY KEY (id)) TASK_ID_STATE_INDEX.INDEX.CREATE=CREATE INDEX TASK_ID_STATE_INDEX ON JOB_STATUS_TRACE_LOG (task_id, state) -JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) JOB_STATUS_TRACE_LOG.SELECT=SELECT * FROM JOB_STATUS_TRACE_LOG WHERE task_id=? JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID=SELECT original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id=? and state='TASK_STAGING' LIMIT 1 diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQLServer.properties b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQLServer.properties index 30f3e92642..637e0f1d29 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQLServer.properties +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQLServer.properties @@ -23,9 +23,9 @@ JOB_EXECUTION_LOG.INSERT_FAILURE=INSERT INTO JOB_EXECUTION_LOG (id, job_name, ta JOB_EXECUTION_LOG.UPDATE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ? WHERE id = ? JOB_EXECUTION_LOG.UPDATE_FAILURE=UPDATE JOB_EXECUTION_LOG SET is_success = ?, complete_time = ?, failure_cause = ? WHERE id = ? -JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, source VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time DATETIME NULL, PRIMARY KEY (id)) +JOB_STATUS_TRACE_LOG.TABLE.CREATE=CREATE TABLE JOB_STATUS_TRACE_LOG (id VARCHAR(40) NOT NULL, job_name VARCHAR(100) NOT NULL, original_task_id VARCHAR(255) NOT NULL, task_id VARCHAR(255) NOT NULL, slave_id VARCHAR(50) NOT NULL, execution_type VARCHAR(20) NOT NULL, sharding_item VARCHAR(100) NOT NULL, state VARCHAR(20) NOT NULL, message VARCHAR(4000) NULL, creation_time DATETIME NULL, PRIMARY KEY (id)) TASK_ID_STATE_INDEX.INDEX.CREATE=CREATE INDEX TASK_ID_STATE_INDEX ON JOB_STATUS_TRACE_LOG (task_id, state) -JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, source, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +JOB_STATUS_TRACE_LOG.INSERT=INSERT INTO JOB_STATUS_TRACE_LOG (id, job_name, original_task_id, task_id, slave_id, execution_type, sharding_item, state, message, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) JOB_STATUS_TRACE_LOG.SELECT=SELECT * FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID=SELECT TOP 1 original_task_id FROM JOB_STATUS_TRACE_LOG WHERE task_id = ? and state = 'TASK_STAGING' diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index f16ecee1f5..5c4213c872 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -23,7 +23,6 @@ import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; import org.junit.jupiter.api.BeforeEach; @@ -77,7 +76,7 @@ void assertPostJobExecutionEvent() { @Test void assertPostJobStatusTraceEvent() { - JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(JOB_NAME, "fake_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "READY", "0", State.TASK_RUNNING, "message is empty."); + JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(JOB_NAME, "fake_task_id", "fake_slave_id", "READY", "0", State.TASK_RUNNING, "message is empty."); jobTracingEventBus.post(jobStatusTraceEvent); verify(repository, atMost(1)).addJobStatusTraceEvent(jobStatusTraceEvent); } diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index 9f1b09c64f..13d9968fe1 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -20,7 +20,6 @@ import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -65,13 +64,13 @@ void assertAddJobExecutionEvent() { @Test void assertAddJobStatusTraceEvent() { assertTrue(storage.addJobStatusTraceEvent( - new JobStatusTraceEvent("test_job", "fake_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "READY", "0", State.TASK_RUNNING, "message is empty."))); + new JobStatusTraceEvent("test_job", "fake_task_id", "fake_slave_id", "READY", "0", State.TASK_RUNNING, "message is empty."))); } @Test void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failover_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "FAILOVER", "0", State.TASK_STAGING, "message is empty."); + "test_job", "fake_failover_task_id", "fake_slave_id", "FAILOVER", "0", State.TASK_STAGING, "message is empty."); jobStatusTraceEvent.setOriginalTaskId("original_fake_failover_task_id"); assertThat(storage.getJobStatusTraceEvents("fake_failover_task_id").size(), is(0)); storage.addJobStatusTraceEvent(jobStatusTraceEvent); @@ -81,11 +80,11 @@ void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { @Test void assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState() { JobStatusTraceEvent stagingJobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failed_failover_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "FAILOVER", "0", State.TASK_STAGING, "message is empty."); + "test_job", "fake_failed_failover_task_id", "fake_slave_id", "FAILOVER", "0", State.TASK_STAGING, "message is empty."); stagingJobStatusTraceEvent.setOriginalTaskId("original_fake_failed_failover_task_id"); storage.addJobStatusTraceEvent(stagingJobStatusTraceEvent); JobStatusTraceEvent failedJobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failed_failover_task_id", "fake_slave_id", Source.LITE_EXECUTOR, "FAILOVER", "0", State.TASK_FAILED, "message is empty."); + "test_job", "fake_failed_failover_task_id", "fake_slave_id", "FAILOVER", "0", State.TASK_FAILED, "message is empty."); storage.addJobStatusTraceEvent(failedJobStatusTraceEvent); List jobStatusTraceEvents = storage.getJobStatusTraceEvents("fake_failed_failover_task_id"); assertThat(jobStatusTraceEvents.size(), is(2)); diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml index 0af2535c61..1438462bef 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml +++ b/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-engine/elasticjob-engine-core/pom.xml similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/pom.xml rename to elasticjob-engine/elasticjob-engine-core/pom.xml index 63085747c5..26d0432ba6 100644 --- a/elasticjob-lite/elasticjob-lite-core/pom.xml +++ b/elasticjob-engine/elasticjob-engine-core/pom.xml @@ -20,10 +20,10 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-lite + elasticjob-engine 3.1.0-SNAPSHOT - elasticjob-lite-core + elasticjob-engine-core ${project.artifactId} diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/JobBootstrap.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/JobBootstrap.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java index 97bb0b93ff..c734833fc1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/JobBootstrap.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.bootstrap; +package org.apache.shardingsphere.elasticjob.engine.api.bootstrap; /** * Job bootstrap. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrap.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrap.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java index 664d1ebd1d..499f5ffdbc 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrap.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.internal.annotation.JobAnnotationBuilder; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.internal.annotation.JobAnnotationBuilder; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/ScheduleJobBootstrap.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/ScheduleJobBootstrap.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java index d185ff8614..a45116f23c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/ScheduleJobBootstrap.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.internal.annotation.JobAnnotationBuilder; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.internal.annotation.JobAnnotationBuilder; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java index e5f287fffd..0ef6456c45 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.listener; +package org.apache.shardingsphere.elasticjob.engine.api.listener; import lombok.Setter; import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService; +import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeService; import java.util.Set; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistry.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistry.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java index dbabebe193..1ae7873074 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistry.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.registry; +package org.apache.shardingsphere.elasticjob.engine.api.registry; import lombok.RequiredArgsConstructor; @@ -25,9 +25,9 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilder.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilder.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java index eaefe0a05e..991c7d3542 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilder.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.annotation; +package org.apache.shardingsphere.elasticjob.engine.internal.annotation; import com.google.common.base.Preconditions; import com.google.common.base.Strings; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java index 9e54cfb6d4..a436932d86 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.config; +package org.apache.shardingsphere.elasticjob.engine.internal.config; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; /** * Configuration node. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java index 8b89be15d5..745a3f4801 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.config; +package org.apache.shardingsphere.elasticjob.engine.internal.config; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.env.TimeService; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java index 7a49da2eff..6139485344 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.config; +package org.apache.shardingsphere.elasticjob.engine.internal.config; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java index 09d79d52f2..94ec7762c5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.election; +package org.apache.shardingsphere.elasticjob.engine.internal.election; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerNode; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerNode; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java index b77b8f4ccd..df9bdb97bd 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.election; +package org.apache.shardingsphere.elasticjob.engine.internal.election; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; /** * Leader path node. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java index 948e278d8a..f83dff2640 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.election; +package org.apache.shardingsphere.elasticjob.engine.internal.election; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java index afee2a8fb1..aec6e44787 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.failover; +package org.apache.shardingsphere.elasticjob.engine.internal.failover; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationNode; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationNode; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java index 521ac762a7..b09863920c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.failover; +package org.apache.shardingsphere.elasticjob.engine.internal.failover; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderNode; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingNode; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderNode; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingNode; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; /** * Failover node. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java index 54c1edad84..8af02351e6 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.failover; +package org.apache.shardingsphere.elasticjob.engine.internal.failover; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingNode; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingNode; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java index 44ede09707..897ad134ef 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; +package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java index f08aae5791..c5a082e429 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; +package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; /** * Guarantee node. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java index 56f3d82dfc..768f567f22 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; +package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java index a873a7b44c..fc21857837 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.instance; +package org.apache.shardingsphere.elasticjob.engine.internal.instance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; /** * Instance node. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java index 8caf814a6d..47251c5157 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.instance; +package org.apache.shardingsphere.elasticjob.engine.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.internal.trigger.TriggerNode; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.trigger.TriggerNode; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.LinkedList; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java index 3534b9322c..acd85f7c4f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.instance; +package org.apache.shardingsphere.elasticjob.engine.internal.instance; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.SchedulerFacade; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.SchedulerFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/AbstractListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/AbstractListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java index c80740bc31..f719094edf 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/AbstractListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.listener; +package org.apache.shardingsphere.elasticjob.engine.internal.listener; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java similarity index 79% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java index 69d743d8b9..729fa38e14 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.listener; +package org.apache.shardingsphere.elasticjob.engine.internal.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.config.RescheduleListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.election.ElectionListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.ShutdownListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.MonitorExecutionListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.internal.trigger.TriggerListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.config.RescheduleListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.election.ElectionListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.ShutdownListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.MonitorExecutionListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.trigger.TriggerListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Collection; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java index 27ebff8828..56a69af4f8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.listener; +package org.apache.shardingsphere.elasticjob.engine.internal.listener; import org.apache.curator.utils.ThreadUtils; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListener.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java similarity index 81% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListener.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java index fd2c1ca01c..0077d815e1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListener.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.listener; +package org.apache.shardingsphere.elasticjob.engine.internal.listener; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java index b3e410c7fb..6015797693 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.reconcile; +package org.apache.shardingsphere.elasticjob.engine.internal.reconcile; import com.google.common.util.concurrent.AbstractScheduledService; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.concurrent.TimeUnit; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistry.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistry.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java index 24f800bcb1..9ac7482eda 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistry.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.ListenerNotifierManager; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerNotifierManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Map; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleController.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleController.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java index 0967a37bf9..9f63fde606 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleController.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import com.google.common.base.Preconditions; import com.google.common.base.Strings; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java index 92fd4a89da..bda4e794fd 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduler.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import com.google.common.base.Preconditions; import com.google.common.base.Strings; @@ -29,11 +29,11 @@ import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListenerFactory; import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService; -import org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProviderFactory; -import org.apache.shardingsphere.elasticjob.lite.internal.setup.SetUpFacade; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeService; +import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProviderFactory; +import org.apache.shardingsphere.elasticjob.engine.internal.setup.SetUpFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.quartz.JobBuilder; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobShutdownHookPlugin.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobShutdownHookPlugin.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java index 2692fb65d5..13a6decf6e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobShutdownHookPlugin.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.quartz.Scheduler; import org.quartz.SchedulerException; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListener.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListener.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java index 4ec70d968d..f233baa568 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListener.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; import org.quartz.Trigger; import org.quartz.listeners.TriggerListenerSupport; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java index 4b786f8804..cb3821adb1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import lombok.Setter; import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacade.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacade.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java index 59d0364194..7e790c346a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacade.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java @@ -15,27 +15,26 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionContextService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.executor.JobFacade; import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionContextService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.Source; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import java.util.Collection; @@ -164,7 +163,7 @@ public void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { public void postJobStatusTraceEvent(final String taskId, final State state, final String message) { TaskContext taskContext = TaskContext.from(taskId); jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), - taskContext.getSlaveId(), Source.LITE_EXECUTOR, taskContext.getType().name(), taskContext.getMetaInfo().getShardingItems().toString(), state, message)); + taskContext.getSlaveId(), taskContext.getType().name(), taskContext.getMetaInfo().getShardingItems().toString(), state, message)); if (!Strings.isNullOrEmpty(message)) { log.trace(message); } diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacade.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacade.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java index 7e4f1705c4..4868ede3be 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacade.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java index 683e0b8c53..912d3bc68d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.server; +package org.apache.shardingsphere.elasticjob.engine.internal.server; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import java.util.Objects; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java index 5c652a96bf..864a0ea030 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.server; +package org.apache.shardingsphere.elasticjob.engine.internal.server; import com.google.common.base.Strings; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Collection; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerStatus.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerStatus.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java index 781da1988d..63124f6b2d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerStatus.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.server; +package org.apache.shardingsphere.elasticjob.engine.internal.server; /** * Server status. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProvider.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProvider.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java index d78591fd3d..8974b3138f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProvider.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.setup; +package org.apache.shardingsphere.elasticjob.engine.internal.setup; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProvider.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProvider.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java index 08f613c4a0..cccca5c2e5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProvider.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.setup; +package org.apache.shardingsphere.elasticjob.engine.internal.setup; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactory.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactory.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java index 387b08eed8..1bf8afe819 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactory.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.setup; +package org.apache.shardingsphere.elasticjob.engine.internal.setup; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java index e2b820ae68..6e1356c19d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacade.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.setup; +package org.apache.shardingsphere.elasticjob.engine.internal.setup; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.ListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.reconcile.ReconcileService; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.reconcile.ReconcileService; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Collection; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java index 4d78942646..d980f68886 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.ShardingItemParameters; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java index df9cb44a9b..da48bc6305 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java index bcf123a6d8..9d984e5f7b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationNode; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationNode; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java index 2fe522ce42..a3e8ddc5e5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationNode; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerNode; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationNode; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerNode; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java index 9be7cb0389..ed4a96557f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderNode; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderNode; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; /** * Sharding node. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java index 26bcecfe6c..92787552ab 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -24,14 +24,14 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategyFactory; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java index e330962ef9..48f1f48dc5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.snapshot; +package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; import com.google.common.base.Preconditions; import lombok.extern.slf4j.Slf4j; import org.apache.curator.framework.recipes.cache.ChildData; import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.shardingsphere.elasticjob.lite.internal.util.SensitiveInfoUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.util.SensitiveInfoUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePath.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePath.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java index 749b87269b..10c643ea1b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePath.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.storage; +package org.apache.shardingsphere.elasticjob.engine.internal.storage; import lombok.RequiredArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java index 6d40df3bac..17f3429d8d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.storage; +package org.apache.shardingsphere.elasticjob.engine.internal.storage; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.ListenerNotifierManager; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerNotifierManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManager.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManager.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java index 2f0ff73002..3acc24bc6e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManager.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.trigger; +package org.apache.shardingsphere.elasticjob.engine.internal.trigger; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerNode.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerNode.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java index a42df1bf02..d962d05b40 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerNode.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.trigger; +package org.apache.shardingsphere.elasticjob.engine.internal.trigger; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; /** * Trigger node. diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerService.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerService.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java index 0c1a2eeb37..f05502b9cd 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerService.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.trigger; +package org.apache.shardingsphere.elasticjob.engine.internal.trigger; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtils.java b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtils.java rename to elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java index 53b2dc5fbb..cc41d7a012 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtils.java +++ b/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.util; +package org.apache.shardingsphere.elasticjob.engine.internal.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java index 0ff75c46cb..c0f67881bb 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java index 04b047e48b..80da4538ef 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.listener; +package org.apache.shardingsphere.elasticjob.engine.api.listener; import com.google.common.collect.Sets; import org.apache.shardingsphere.elasticjob.infra.env.TimeService; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.ElasticJobListenerCaller; -import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.TestDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.ElasticJobListenerCaller; +import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeService; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/ElasticJobListenerCaller.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/ElasticJobListenerCaller.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java index 4f5b61e880..d0adda6526 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/ElasticJobListenerCaller.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.engine.api.listener.fixture; public interface ElasticJobListenerCaller { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/TestDistributeOnceElasticJobListener.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java index 6150d6531d..971b0b2f39 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/TestDistributeOnceElasticJobListener.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.engine.api.listener.fixture; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; public final class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/TestElasticJobListener.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/TestElasticJobListener.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java index 885435b403..c2c66a9213 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/fixture/TestElasticJobListener.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.engine.api.listener.fixture; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java index 881c14a7a3..41e1ab8cb7 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/registry/JobInstanceRegistryTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.api.registry; +package org.apache.shardingsphere.elasticjob.engine.api.registry; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/EmbedTestingServer.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/EmbedTestingServer.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java index 4690721404..18f305d9a9 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/EmbedTestingServer.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.fixture; +package org.apache.shardingsphere.elasticjob.engine.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/LiteYamlConstants.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/LiteYamlConstants.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java index fe592c5676..9cedba22bf 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/LiteYamlConstants.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.fixture; +package org.apache.shardingsphere.elasticjob.engine.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java index c196079398..ed0ad4dcfb 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/executor/ClassedFooJobExecutor.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.fixture.executor; +package org.apache.shardingsphere.elasticjob.engine.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.executor.JobFacade; import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.FooJob; public final class ClassedFooJobExecutor implements ClassedJobItemExecutor { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationSimpleJob.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationSimpleJob.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java index 52b34d5285..31f8549d9b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationSimpleJob.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.fixture.job; +package org.apache.shardingsphere.elasticjob.engine.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationUnShardingJob.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationUnShardingJob.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java index db1b3c48ad..e235c59449 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/AnnotationUnShardingJob.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.fixture.job; +package org.apache.shardingsphere.elasticjob.engine.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/DetailedFooJob.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/DetailedFooJob.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java index 950b2d0031..48ccb4a117 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/DetailedFooJob.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.fixture.job; +package org.apache.shardingsphere.elasticjob.engine.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/FooJob.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/FooJob.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java index 29c095be1a..09f90f1bc5 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/fixture/job/FooJob.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.fixture.job; +package org.apache.shardingsphere.elasticjob.engine.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java similarity index 84% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java index 0a6aa35986..88f98ed8bb 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/BaseIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate; +package org.apache.shardingsphere.elasticjob.engine.integrate; import lombok.AccessLevel; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java index 977c0289b0..195df83243 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.disable; +package org.apache.shardingsphere.elasticjob.engine.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.lite.integrate.BaseIntegrateTest; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.engine.integrate.BaseIntegrateTest; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.hamcrest.core.IsNull; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java index 220dde4cdb..0bcbfe302c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.disable; +package org.apache.shardingsphere.elasticjob.engine.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java index 0b2a3e2cf8..139f83bace 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.disable; +package org.apache.shardingsphere.elasticjob.engine.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java index 2698f08ed4..347f7667a3 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.enable; +package org.apache.shardingsphere.elasticjob.engine.integrate.enable; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.integrate.BaseIntegrateTest; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.integrate.BaseIntegrateTest; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; import org.junit.jupiter.api.BeforeEach; import static org.hamcrest.CoreMatchers.is; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java index 375812ead9..97ca2809b1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.enable; +package org.apache.shardingsphere.elasticjob.engine.integrate.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java index 26f26d4045..8c2def4db7 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.enable; +package org.apache.shardingsphere.elasticjob.engine.integrate.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/listener/TestDistributeOnceElasticJobListener.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/listener/TestDistributeOnceElasticJobListener.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java index 5bcb7f8b9d..834056f851 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/listener/TestDistributeOnceElasticJobListener.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.listener; +package org.apache.shardingsphere.elasticjob.engine.integrate.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; public class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/listener/TestElasticJobListener.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/listener/TestElasticJobListener.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java index 3b24daf6f9..b45e1fbeb1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/listener/TestElasticJobListener.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.integrate.listener; +package org.apache.shardingsphere.elasticjob.engine.integrate.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java index acdabbf6d4..d9ebaaf0d6 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/JobAnnotationBuilderTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.annotation; +package org.apache.shardingsphere.elasticjob.engine.internal.annotation; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.AnnotationSimpleJob; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java similarity index 82% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java index a3d878e000..9eae55a220 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/BaseAnnotationTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java @@ -15,20 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.engine.internal.annotation.integrate; import lombok.AccessLevel; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.lite.internal.annotation.JobAnnotationBuilder; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.internal.annotation.JobAnnotationBuilder; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java index bd1ae65a87..80fcf37d95 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.engine.internal.annotation.integrate; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationUnShardingJob; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.AnnotationUnShardingJob; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java index 82333eaafd..919d855e1f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.engine.internal.annotation.integrate; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.AnnotationSimpleJob; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java index 6bab8143d3..e86dd45811 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationNodeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.config; +package org.apache.shardingsphere.elasticjob.engine.internal.config; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java index 51167d7eb0..0963268060 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.config; +package org.apache.shardingsphere.elasticjob.engine.internal.config; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -23,9 +23,9 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -84,7 +84,7 @@ void assertLoadFromCacheButNull() { void assertSetUpJobConfigurationJobConfigurationForJobConflict() { assertThrows(JobConfigurationException.class, () -> { when(jobNodeStorage.isJobRootNodeExisted()).thenReturn(true); - when(jobNodeStorage.getJobRootNodeData()).thenReturn("org.apache.shardingsphere.elasticjob.lite.api.script.api.ScriptJob"); + when(jobNodeStorage.getJobRootNodeData()).thenReturn("org.apache.shardingsphere.elasticjob.engine.api.script.api.ScriptJob"); try { configService.setUpJobConfiguration(null, JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); } finally { diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java index ee04859410..a46473049d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.config; +package org.apache.shardingsphere.elasticjob.engine.internal.config; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.junit.jupiter.api.BeforeEach; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java index 25f524fd23..f4b7b86aed 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/ElectionListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.election; +package org.apache.shardingsphere.elasticjob.engine.internal.election; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java index 9fd5b56eca..adc4857455 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderNodeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.election; +package org.apache.shardingsphere.elasticjob.engine.internal.election; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java index f00e72ac14..f5a95a8eef 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.election; +package org.apache.shardingsphere.elasticjob.engine.internal.election; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService.LeaderElectionExecutionCallback; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService.LeaderElectionExecutionCallback; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java index db4acd39f9..2962561f0a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java @@ -15,20 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.failover; +package org.apache.shardingsphere.elasticjob.engine.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java index c2fde69823..ad7fe3abdf 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverNodeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.failover; +package org.apache.shardingsphere.elasticjob.engine.internal.failover; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java index b204338ec6..ff6531c1ca 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.failover; +package org.apache.shardingsphere.elasticjob.engine.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java index e5f8ea2585..f0c9ecc69b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; +package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java index aa260748a5..6478383955 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeNodeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; +package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java index 33aa82743a..e9c9925ac1 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/guarantee/GuaranteeServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.guarantee; +package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java index 14eac7dc9f..814dd850fe 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceNodeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.instance; +package org.apache.shardingsphere.elasticjob.engine.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java index 3c811b6ddc..9d6934fcc3 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/InstanceServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.instance; +package org.apache.shardingsphere.elasticjob.engine.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java index 4d17553c95..f8b372fc49 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/instance/ShutdownListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.instance; +package org.apache.shardingsphere.elasticjob.engine.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.SchedulerFacade; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.SchedulerFacade; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java similarity index 79% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java index a2deec2d5c..a4faecfd72 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.listener; +package org.apache.shardingsphere.elasticjob.engine.internal.listener; -import org.apache.shardingsphere.elasticjob.lite.internal.config.RescheduleListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.election.ElectionListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.ShutdownListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.MonitorExecutionListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.internal.trigger.TriggerListenerManager; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.config.RescheduleListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.election.ElectionListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.ShutdownListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.MonitorExecutionListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.internal.trigger.TriggerListenerManager; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java index 8affd3481b..5004bdf367 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/ListenerNotifierManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.listener; +package org.apache.shardingsphere.elasticjob.engine.internal.listener; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java index 65efcea0ea..59bc43c88d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/listener/RegistryCenterConnectionStateListenerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.listener; +package org.apache.shardingsphere.elasticjob.engine.internal.listener; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener.State; import org.junit.jupiter.api.BeforeEach; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java index 16fb642e2c..e739004deb 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/reconcile/ReconcileServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.reconcile; +package org.apache.shardingsphere.elasticjob.engine.internal.reconcile; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java index df3bca64e4..cf90da4558 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobRegistryTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java index 92b0dfa0f5..954411397c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java index 36ee33a689..83f7cd8856 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobTriggerListenerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java index 5ac6645d49..a038e08b6a 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacadeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java @@ -15,20 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.ElasticJobListenerCaller; -import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.TestElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionContextService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.ElasticJobListenerCaller; +import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionContextService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java index 8ab368ac3c..20808cdc9f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/SchedulerFacadeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.schedule; +package org.apache.shardingsphere.elasticjob.engine.internal.schedule; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java index 1f6ca05d20..e5c65f3b3c 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNodeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.server; +package org.apache.shardingsphere.elasticjob.engine.internal.server; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java index 9884d74f2a..8b73f171e7 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.server; +package org.apache.shardingsphere.elasticjob.engine.internal.server; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java similarity index 84% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java index 856bbde327..8677c40555 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/DefaultJobClassNameProviderTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.setup; +package org.apache.shardingsphere.elasticjob.engine.internal.setup; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.FooJob; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledForJreRange; import org.junit.jupiter.api.condition.JRE; @@ -32,7 +32,7 @@ class DefaultJobClassNameProviderTest { void assertGetOrdinaryClassJobName() { JobClassNameProvider jobClassNameProvider = new DefaultJobClassNameProvider(); String result = jobClassNameProvider.getJobClassName(new DetailedFooJob()); - assertThat(result, is("org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob")); + assertThat(result, is("org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob")); } // TODO OpenJDK 21 breaks this unit test. @@ -43,6 +43,6 @@ void assertGetLambdaJobName() { FooJob lambdaFooJob = shardingContext -> { }; String result = jobClassNameProvider.getJobClassName(lambdaFooJob); - assertThat(result, is("org.apache.shardingsphere.elasticjob.lite.internal.setup.DefaultJobClassNameProviderTest$$Lambda$")); + assertThat(result, is("org.apache.shardingsphere.elasticjob.engine.internal.setup.DefaultJobClassNameProviderTest$$Lambda$")); } } diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java index 065fa6917d..9abcb65459 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.setup; +package org.apache.shardingsphere.elasticjob.engine.internal.setup; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java similarity index 82% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java index 4670b369e2..9a75384159 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/setup/SetUpFacadeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.setup; +package org.apache.shardingsphere.elasticjob.engine.internal.setup; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.ListenerManager; -import org.apache.shardingsphere.elasticjob.lite.internal.reconcile.ReconcileService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerManager; +import org.apache.shardingsphere.elasticjob.engine.internal.reconcile.ReconcileService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java index e01d8046b5..e9c592c709 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java index 20e42e249c..b994a17350 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java index 6f5bf035b8..5b7b87069f 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; -import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.junit.jupiter.api.BeforeEach; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java index 6485aa912f..7a2c29e56d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java index eedd44ff3d..b017950f6d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingNodeTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java index 8128d82700..f41bc8dadf 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.sharding; +package org.apache.shardingsphere.elasticjob.engine.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.lite.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java similarity index 87% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java index a0dda8cf0c..d515d6837d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/BaseSnapshotServiceTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.snapshot; +package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; import lombok.AccessLevel; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java index 6f3ea3b677..418081d3d6 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceDisableTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.snapshot; +package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java index 33fdbf4a00..e366fd6847 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SnapshotServiceEnableTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.snapshot; +package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; -import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SocketUtils.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SocketUtils.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java index 0c0f44d70a..39ec76d93e 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/snapshot/SocketUtils.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.snapshot; +package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java index 07f7535cd5..ab920776c8 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodePathTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.storage; +package org.apache.shardingsphere.elasticjob.engine.internal.storage; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java index 8383bc3af6..3d32f5b7ff 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorageTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.storage; +package org.apache.shardingsphere.elasticjob.engine.internal.storage; -import org.apache.shardingsphere.elasticjob.lite.internal.listener.ListenerNotifierManager; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerNotifierManager; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; import org.apache.shardingsphere.elasticjob.reg.exception.RegException; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java index fc2769f53b..0f17628c27 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/trigger/TriggerListenerManagerTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.trigger; +package org.apache.shardingsphere.elasticjob.engine.internal.trigger; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.junit.jupiter.api.BeforeEach; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java index cc20f40761..cc1771b949 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtilsTest.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.internal.util; +package org.apache.shardingsphere.elasticjob.engine.internal.util; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/ReflectionUtils.java b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/ReflectionUtils.java rename to elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java index 9221ca3977..fe4639b48d 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/ReflectionUtils.java +++ b/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.util; +package org.apache.shardingsphere.elasticjob.engine.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 90% rename from elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor index c9b362b6a6..7302c9a357 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor +++ b/elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.fixture.executor.ClassedFooJobExecutor +org.apache.shardingsphere.elasticjob.engine.fixture.executor.ClassedFooJobExecutor diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 72% rename from elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index 85a546554c..cc9b221927 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -15,7 +15,7 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.TestDistributeOnceElasticJobListener -org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.TestElasticJobListener -org.apache.shardingsphere.elasticjob.lite.integrate.listener.TestDistributeOnceElasticJobListener -org.apache.shardingsphere.elasticjob.lite.integrate.listener.TestElasticJobListener +org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestDistributeOnceElasticJobListener +org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestElasticJobListener +org.apache.shardingsphere.elasticjob.engine.integrate.listener.TestDistributeOnceElasticJobListener +org.apache.shardingsphere.elasticjob.engine.integrate.listener.TestElasticJobListener diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/resources/logback-test.xml b/elasticjob-engine/elasticjob-engine-core/src/test/resources/logback-test.xml similarity index 89% rename from elasticjob-lite/elasticjob-lite-core/src/test/resources/logback-test.xml rename to elasticjob-engine/elasticjob-engine-core/src/test/resources/logback-test.xml index 473355d513..d7b1eb9c5b 100644 --- a/elasticjob-lite/elasticjob-lite-core/src/test/resources/logback-test.xml +++ b/elasticjob-engine/elasticjob-engine-core/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + @@ -36,7 +36,7 @@ - + diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml b/elasticjob-engine/elasticjob-engine-lifecycle/pom.xml similarity index 93% rename from elasticjob-lite/elasticjob-lite-lifecycle/pom.xml rename to elasticjob-engine/elasticjob-engine-lifecycle/pom.xml index 851d254315..e8c4bc7040 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/pom.xml +++ b/elasticjob-engine/elasticjob-engine-lifecycle/pom.xml @@ -20,16 +20,16 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-lite + elasticjob-engine 3.1.0-SNAPSHOT - elasticjob-lite-lifecycle + elasticjob-engine-lifecycle ${project.artifactId} org.apache.shardingsphere.elasticjob - elasticjob-lite-core + elasticjob-engine-core ${project.parent.version} diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactory.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java similarity index 84% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactory.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java index b1a842bbc6..bb9677832a 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactory.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.operate.JobOperateAPIImpl; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.operate.ShardingOperateAPIImpl; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.reg.RegistryCenterFactory; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.settings.JobConfigurationAPIImpl; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics.JobStatisticsAPIImpl; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics.ServerStatisticsAPIImpl; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics.ShardingStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate.JobOperateAPIImpl; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate.ShardingOperateAPIImpl; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.reg.RegistryCenterFactory; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.settings.JobConfigurationAPIImpl; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics.JobStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics.ServerStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics.ShardingStatisticsAPIImpl; /** * Job API factory. diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobConfigurationAPI.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobConfigurationAPI.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java index 968349ff01..f6f383c942 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobConfigurationAPI.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobOperateAPI.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobOperateAPI.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java index db41739734..d5826335bc 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobOperateAPI.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; import java.io.IOException; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobStatisticsAPI.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobStatisticsAPI.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java index 2b23e125a1..17f3549f7b 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobStatisticsAPI.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.JobBriefInfo; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.JobBriefInfo; import java.util.Collection; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ServerStatisticsAPI.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ServerStatisticsAPI.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java index 6e0dcbccb8..4f36052c8f 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ServerStatisticsAPI.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ServerBriefInfo; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ServerBriefInfo; import java.util.Collection; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ShardingOperateAPI.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ShardingOperateAPI.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java index c4589a0851..8bbf8dde34 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ShardingOperateAPI.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; /** * Sharding operate API. diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ShardingStatisticsAPI.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ShardingStatisticsAPI.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java index ab5400a7f9..e1cdb61dd2 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/ShardingStatisticsAPI.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ShardingInfo; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ShardingInfo; import java.util.Collection; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/JobBriefInfo.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/JobBriefInfo.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java index fcb4bee26e..0b269ce8ae 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/JobBriefInfo.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; import lombok.Getter; import lombok.Setter; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ServerBriefInfo.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ServerBriefInfo.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java index 6c2d799a32..eb03255faf 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ServerBriefInfo.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingInfo.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingInfo.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java index 1c3e137b4b..111e16f981 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingInfo.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; import lombok.Getter; import lombok.Setter; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImpl.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImpl.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java index 78125b334b..09f519ee84 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImpl.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; import com.google.common.base.Preconditions; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.lite.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobOperateAPI; +import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.io.IOException; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImpl.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImpl.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java index 4ed208fd74..be8f6e498f 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImpl.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingOperateAPI; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactory.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactory.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java index 79058cc763..8789f26d88 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactory.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.reg; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.reg; import com.google.common.base.Strings; import com.google.common.hash.HashCode; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImpl.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java index 9de0be0803..3bc737b54b 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImpl.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.settings; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.settings; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImpl.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index 746f3d5ea1..99a02d05fb 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobStatisticsAPI; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.JobBriefInfo; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.JobBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java index deb7987985..6b0eab5ac9 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ServerStatisticsAPI; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ServerBriefInfo; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ServerBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java index 46a316e6ab..93cd8803a6 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingStatisticsAPI; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ShardingInfo; +import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ShardingInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java index 500a5112f8..7f370328b7 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/AbstractEmbedZookeeperBaseTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle; +package org.apache.shardingsphere.elasticjob.engine.lifecycle; import lombok.extern.slf4j.Slf4j; import org.apache.curator.framework.CuratorFramework; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java index 8b45d0d486..59726e7508 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/api/JobAPIFactoryTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.api; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.AbstractEmbedZookeeperBaseTest; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.AbstractEmbedZookeeperBaseTest; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java index 99dd3e909f..e4b2803e77 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/domain/ShardingStatusTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/LifecycleYamlConstants.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/LifecycleYamlConstants.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java index aaa5a0697d..c8a0f6a9e5 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/fixture/LifecycleYamlConstants.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java index 379173e34d..2462a71886 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/JobOperateAPIImplTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobOperateAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java index a516b9fcac..92fefd9d98 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/operate/ShardingOperateAPIImplTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingOperateAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java index 223a7cba7e..bd8e9d245b 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/reg/RegistryCenterFactoryTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.reg; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.reg; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.AbstractEmbedZookeeperBaseTest; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.AbstractEmbedZookeeperBaseTest; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java index 65367010a8..7184da3d0b 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImplTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.settings; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.settings; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture.LifecycleYamlConstants; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.fixture.LifecycleYamlConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; import org.junit.jupiter.api.BeforeEach; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java index f2aa7cb123..4085ec6b44 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobStatisticsAPI; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.JobBriefInfo; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.fixture.LifecycleYamlConstants; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.JobBriefInfo; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.fixture.LifecycleYamlConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java index fdbddc3e5f..a502c2a96a 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ServerStatisticsAPI; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ServerBriefInfo; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ServerBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java index 7388011c50..98a60d2b71 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.ShardingStatisticsAPI; -import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.ShardingInfo; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI; +import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ShardingInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/resources/logback-test.xml b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/resources/logback-test.xml similarity index 94% rename from elasticjob-lite/elasticjob-lite-lifecycle/src/test/resources/logback-test.xml rename to elasticjob-engine/elasticjob-engine-lifecycle/src/test/resources/logback-test.xml index c1392af83b..5c47f5f36c 100644 --- a/elasticjob-lite/elasticjob-lite-lifecycle/src/test/resources/logback-test.xml +++ b/elasticjob-engine/elasticjob-engine-lifecycle/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/README.md b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/README.md similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/README.md rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/README.md index 1ef000c9a7..a113684e3d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/README.md +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/README.md @@ -1,4 +1,4 @@ -# ElasticJob-Lite Spring Boot Starter +# ElasticJob Spring Boot Starter ## Getting Started @@ -7,7 +7,7 @@ ```xml org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-boot-starter + elasticjob-engine-spring-boot-starter ${latest.version} ``` @@ -52,7 +52,7 @@ elasticjob: type: RDB regCenter: serverLists: localhost:6181 - namespace: elasticjob-lite-springboot + namespace: elasticjob-engine-springboot jobs: classed: org.apache.shardingsphere.elasticjob.simple.job.SimpleJob: diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/pom.xml similarity index 93% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/pom.xml index 0a953fbd01..eeab8a741c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/pom.xml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/pom.xml @@ -20,16 +20,16 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-lite-spring + elasticjob-engine-spring 3.1.0-SNAPSHOT - elasticjob-lite-spring-boot-starter + elasticjob-engine-spring-boot-starter ${project.artifactId} org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-core + elasticjob-engine-spring-core ${project.parent.version} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobBootstrapConfiguration.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobBootstrapConfiguration.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java index e362b6eedc..096537171b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; import com.google.common.base.Preconditions; import com.google.common.base.Strings; @@ -23,9 +23,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing.TracingProperties; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.springframework.beans.factory.BeanCreationException; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationProperties.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationProperties.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java index 102c44396f..93ff44cc31 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationProperties.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; import lombok.Getter; import lombok.Setter; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobLiteAutoConfiguration.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java similarity index 81% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobLiteAutoConfiguration.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java index cf71ed77b3..5adc514479 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobLiteAutoConfiguration.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ElasticJobRegistryCenterConfiguration; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.snapshot.ElasticJobSnapshotServiceConfiguration; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing.ElasticJobTracingConfiguration; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ElasticJobRegistryCenterConfiguration; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot.ElasticJobSnapshotServiceConfiguration; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing.ElasticJobTracingConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -28,7 +28,7 @@ import org.springframework.context.annotation.Import; /** - * ElasticJob-Lite auto configuration. + * ElasticJob auto configuration. */ @Configuration(proxyBeanMethods = false) @AutoConfigureAfter(DataSourceAutoConfiguration.class) diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobProperties.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobProperties.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java index 66eee47f80..75c3cc508c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobProperties.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; import lombok.Getter; import lombok.Setter; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ScheduleJobBootstrapStartupRunner.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ScheduleJobBootstrapStartupRunner.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java index 07f996b9c2..fd4768481e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ScheduleJobBootstrapStartupRunner.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; import org.springframework.boot.CommandLineRunner; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java index e75008b647..ed980afe1d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperProperties.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperProperties.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java index 1f421a1d21..6af78fa634 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperProperties.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg; import lombok.Getter; import lombok.Setter; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java index 8a295ebf36..809b4dacbb 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.snapshot; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot; -import org.apache.shardingsphere.elasticjob.lite.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/SnapshotServiceProperties.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/SnapshotServiceProperties.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java index cf8254c292..61bd7550eb 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/SnapshotServiceProperties.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.snapshot; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot; import lombok.Getter; import lombok.Setter; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java index 85dfa738b5..1536b584f9 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing; import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingProperties.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingProperties.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java index 54a1634079..333b8bce2f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingProperties.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing; import lombok.Getter; import lombok.Setter; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json similarity index 77% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index c4e4e38e1a..99940422d8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -19,7 +19,7 @@ "groups": [ { "name": "elasticjob.reg-center", - "type": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties", + "type": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties", "description": "Registry Center configurations." }, { @@ -36,52 +36,52 @@ "name": "elasticjob.reg-center.server-lists", "type": "java.lang.String", "description": "Include IP addresses and ports. Multiple IP address split by comma.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.namespace", "type": "java.lang.String", "description": "Namespace.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.base-sleep-time-milliseconds", "type": "java.lang.Integer", "defaultValue": 1000, "description": "Base sleep time milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.max-sleep-time-milliseconds", "type": "java.lang.Integer", "defaultValue": 3000, "description": "Max sleep time milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.max-retries", "type": "java.lang.Integer", "defaultValue": 3, "description": "Max retry times.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.session-timeout-milliseconds", "type": "java.lang.Integer", "description": "Session timeout milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.connection-timeout-milliseconds", "type": "java.lang.Integer", "description": "Connection timeout milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.digest", "type": "java.lang.String", "description": "Zookeeper digest.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.tracing.type", @@ -102,13 +102,13 @@ }, { "name": "elasticjob.jobs", - "type": "java.util.Map" + "type": "java.util.Map" }, { "name": "elasticjob.dump.port", "type": "java.lang.Integer", "description": "A port for configuring SnapshotService.", - "sourceType": "org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.snapshot.SnapshotServiceProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot.SnapshotServiceProperties" }, { "name": "elasticjob.dump.enabled", diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring.factories b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.factories similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring.factories rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.factories index 8738478744..318d6fed79 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring.factories +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -15,4 +15,4 @@ # limitations under the License. # org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobLiteAutoConfiguration + org.apache.shardingsphere.elasticjob.engine.spring.boot.job.ElasticJobLiteAutoConfiguration diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring.provides b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.provides similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring.provides rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.provides index d5f5ef5058..8d0b5bb9b2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring.provides +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.provides @@ -15,4 +15,4 @@ # limitations under the License. # -provides: elasticjob-lite-spring-boot-starter +provides: elasticjob-engine-spring-boot-starter diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 89% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index de1aa72835..c38136983e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.spring.boot.job.ElasticJobLiteAutoConfiguration +org.apache.shardingsphere.elasticjob.engine.spring.boot.job.ElasticJobLiteAutoConfiguration diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java index a886f0ea2e..6c68a8a875 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobConfigurationPropertiesTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java similarity index 81% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java index 6eceee06dd..91bf473921 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl.AnnotationCustomJob; -import org.apache.shardingsphere.elasticjob.lite.spring.core.scanner.ElasticJobScan; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.AnnotationCustomJob; +import org.apache.shardingsphere.elasticjob.engine.spring.core.scanner.ElasticJobScan; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -38,7 +38,7 @@ @SpringBootTest @ActiveProfiles("elasticjob") -@ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl") +@ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl") class ElasticJobSpringBootScannerTest { @Autowired diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java index 1c6a51f731..0e72713573 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/ElasticJobSpringBootTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl.CustomTestJob; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.ZookeeperProperties; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing.TracingProperties; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.CustomTestJob; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; @@ -74,7 +74,7 @@ void assertZookeeperProperties() { assertNotNull(applicationContext); ZookeeperProperties actual = applicationContext.getBean(ZookeeperProperties.class); assertThat(actual.getServerLists(), is(EmbedTestingServer.getConnectionString())); - assertThat(actual.getNamespace(), is("elasticjob-lite-spring-boot-starter")); + assertThat(actual.getNamespace(), is("elasticjob-engine-spring-boot-starter")); } @Test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/CustomClassedJobExecutor.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/CustomClassedJobExecutor.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java index 49ca7ba2c0..0c81737e2d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/CustomClassedJobExecutor.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.executor; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.executor.JobFacade; import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.CustomJob; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.CustomJob; public final class CustomClassedJobExecutor implements ClassedJobItemExecutor { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/PrintJobExecutor.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/PrintJobExecutor.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java index a2829f9b50..077d6da747 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/PrintJobExecutor.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.executor; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/PrintJobProperties.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/PrintJobProperties.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java index 0be583838b..ad60a48e02 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/executor/PrintJobProperties.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.executor; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor; public final class PrintJobProperties { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java index 9dcc7a16b6..e226e5ea9e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/EmbedTestingServer.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/CustomJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/CustomJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java index 7c43a619cb..fbfc1669e2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/CustomJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java index 139f4cb425..d388dfdf7f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.CustomJob; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.CustomJob; import org.springframework.transaction.annotation.Transactional; @Slf4j diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/CustomTestJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/CustomTestJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java index a1ad7113a5..de81b265e2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/job/impl/CustomTestJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.CustomJob; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.repository.BarRepository; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.CustomJob; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository.BarRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/listener/LogElasticJobListener.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/listener/LogElasticJobListener.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java index e213f8ca44..30025e94c2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/listener/LogElasticJobListener.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.listener; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/listener/NoopElasticJobListener.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/listener/NoopElasticJobListener.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java index 2b9e2d9ff8..0e36c9d612 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/fixture/listener/NoopElasticJobListener.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.listener; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/repository/BarRepository.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/repository/BarRepository.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java index fd519dd6ff..31510b3eda 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/repository/BarRepository.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.repository; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository; /** * Bar Repository. diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/repository/impl/BarRepositoryImpl.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/repository/impl/BarRepositoryImpl.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java index c70cba1f9a..79713c53a6 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/job/repository/impl/BarRepositoryImpl.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.job.repository.impl; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository.impl; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.repository.BarRepository; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository.BarRepository; import org.springframework.stereotype.Repository; @Repository diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java index 08740cd844..133df34a5f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ZookeeperPropertiesTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java index 1d267b5c19..ab1ee55647 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.reg.snapshot; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot; -import org.apache.shardingsphere.elasticjob.lite.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java index 98c32dd087..96832e8f73 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/boot/tracing/TracingConfigurationTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.boot.tracing; +package org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing; -import org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 89% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor index b3895f3e60..bd40a8b132 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.spring.boot.job.executor.CustomClassedJobExecutor +org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor.CustomClassedJobExecutor diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor index b8f15da2fc..aeb4830459 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.spring.boot.job.executor.PrintJobExecutor +org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor.PrintJobExecutor diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 79% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index 387e63be30..3627b025a3 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.listener.NoopElasticJobListener -org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.listener.LogElasticJobListener +org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener.NoopElasticJobListener +org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener.LogElasticJobListener diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-elasticjob.yml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-elasticjob.yml similarity index 85% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-elasticjob.yml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-elasticjob.yml index 98b41fe145..4c213ec878 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-elasticjob.yml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-elasticjob.yml @@ -28,10 +28,10 @@ elasticjob: excludeJobNames: [customTestJob] regCenter: serverLists: localhost:18181 - namespace: elasticjob-lite-spring-boot-starter + namespace: elasticjob-engine-spring-boot-starter jobs: customTestJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl.CustomTestJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.CustomTestJob jobBootstrapBeanName: customTestJobBean shardingTotalCount: 3 jobListenerTypes: @@ -46,7 +46,7 @@ elasticjob: defaultBeanNameClassJob: cron: 0/5 * * * * ? timeZome: GMT+08:00 - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.spring.boot.job.fixture.job.impl.CustomTestJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.CustomTestJob shardingTotalCount: 3 defaultBeanNameTypeJob: cron: 0/5 * * * * ? diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-snapshot.yml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-snapshot.yml similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-snapshot.yml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-snapshot.yml index 64469a2044..97aec15057 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-snapshot.yml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-snapshot.yml @@ -20,4 +20,4 @@ elasticjob: port: 0 regCenter: serverLists: localhost:18181 - namespace: elasticjob-lite-spring-boot-starter + namespace: elasticjob-engine-spring-boot-starter diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-tracing.yml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-tracing.yml similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-tracing.yml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-tracing.yml index 3dbb97cd9f..fb344f6025 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/application-tracing.yml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-tracing.yml @@ -18,4 +18,4 @@ elasticjob: regCenter: serverLists: localhost:18181 - namespace: elasticjob-lite-spring-boot-starter + namespace: elasticjob-engine-spring-boot-starter diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/logback-test.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-boot-starter/src/test/resources/logback-test.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/logback-test.xml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/pom.xml similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/pom.xml index e26680449f..73be5f0aab 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/pom.xml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/pom.xml @@ -20,16 +20,16 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-lite-spring + elasticjob-engine-spring 3.1.0-SNAPSHOT - elasticjob-lite-spring-core + elasticjob-engine-spring-core ${project.artifactId} org.apache.shardingsphere.elasticjob - elasticjob-lite-core + elasticjob-engine-core ${project.parent.version} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ClassPathJobScanner.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ClassPathJobScanner.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java index 727033c6bd..2d0b5c77dd 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ClassPathJobScanner.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.RuntimeBeanReference; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScan.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScan.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java index 614ad22b44..0df4f06e6b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScan.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; import org.springframework.context.annotation.Import; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScanRegistrar.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScanRegistrar.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java index 656586f0ec..d0d3d18cec 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/ElasticJobScanRegistrar.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/JobScannerConfiguration.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/JobScannerConfiguration.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java index 2c6f64ac8b..7f4404da6f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/scanner/JobScannerConfiguration.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/SpringProxyJobClassNameProvider.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/SpringProxyJobClassNameProvider.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java index f8039f94f1..88b66090a9 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/SpringProxyJobClassNameProvider.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.setup; +package org.apache.shardingsphere.elasticjob.engine.spring.core.setup; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProvider; -import org.apache.shardingsphere.elasticjob.lite.spring.core.util.AopTargetUtils; +import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider; +import org.apache.shardingsphere.elasticjob.engine.spring.core.util.AopTargetUtils; import org.springframework.aop.support.AopUtils; /** diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtils.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtils.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java index cacb9ca84a..d019d51de9 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtils.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.util; +package org.apache.shardingsphere.elasticjob.engine.spring.core.util; import java.lang.reflect.Field; import lombok.AccessLevel; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProvider b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider similarity index 89% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProvider rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider index a46bdde70d..2971f53f21 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProvider +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.spring.core.setup.SpringProxyJobClassNameProvider +org.apache.shardingsphere.elasticjob.engine.spring.core.setup.SpringProxyJobClassNameProvider diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java similarity index 87% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java index 4ba75a964d..97325cd185 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/setup/JobClassNameProviderFactoryTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.setup; +package org.apache.shardingsphere.elasticjob.engine.spring.core.setup; -import org.apache.shardingsphere.elasticjob.lite.internal.setup.JobClassNameProviderFactory; +import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProviderFactory; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java similarity index 96% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java index 68b411779a..3d4c6e56be 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/AopTargetUtilsTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.util; +package org.apache.shardingsphere.elasticjob.engine.spring.core.util; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.junit.jupiter.api.Test; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/TargetJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/TargetJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java index d563b10463..6f2aa795e0 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/core/util/TargetJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.core.util; +package org.apache.shardingsphere.elasticjob.engine.spring.core.util; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/resources/META-INF/logback-test.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/resources/META-INF/logback-test.xml similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-core/src/test/resources/META-INF/logback-test.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/resources/META-INF/logback-test.xml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/pom.xml similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/pom.xml index 3ccecc9151..250a0191e0 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/pom.xml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/pom.xml @@ -20,16 +20,16 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-lite-spring + elasticjob-engine-spring 3.1.0-SNAPSHOT - elasticjob-lite-spring-namespace + elasticjob-engine-spring-namespace ${project.artifactId} org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-core + elasticjob-engine-spring-core ${project.parent.version} diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/ElasticJobNamespaceHandler.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java similarity index 70% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/ElasticJobNamespaceHandler.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java index 7ae7ae49c9..b2328008e8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/ElasticJobNamespaceHandler.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner.parser.JobScannerBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.job.parser.JobBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.reg.parser.ZookeeperBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot.parser.SnapshotBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.tracing.parser.TracingBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.parser.JobScannerBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.parser.JobBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.parser.ZookeeperBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.parser.SnapshotBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.parser.TracingBeanDefinitionParser; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; /** diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/parser/JobBeanDefinitionParser.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/parser/JobBeanDefinitionParser.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java index 001543bef1..d1dbe0b900 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/parser/JobBeanDefinitionParser.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job.parser; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.parser; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.job.tag.JobBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.tag.JobBeanDefinitionTag; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/tag/JobBeanDefinitionTag.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java similarity index 97% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/tag/JobBeanDefinitionTag.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java index 0441e679cf..fffccdeea9 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/tag/JobBeanDefinitionTag.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job.tag; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java index c6126cd154..0cb29198f9 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.reg.parser; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.parser; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.reg.tag.ZookeeperBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.tag.ZookeeperBeanDefinitionTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java index e3b33de084..f46f41cbf7 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.reg.tag; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java index e387570a3e..e257727606 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner.parser; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.parser; -import org.apache.shardingsphere.elasticjob.lite.spring.core.scanner.JobScannerConfiguration; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner.tag.JobScannerBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.engine.spring.core.scanner.JobScannerConfiguration; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.tag.JobScannerBeanDefinitionTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java index 9b8d9429b8..37d28431a1 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner.tag; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java index b4ed6136a9..9bae04e155 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot.parser; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.parser; -import org.apache.shardingsphere.elasticjob.lite.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot.tag.SnapshotBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.tag.SnapshotBeanDefinitionTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java index 95f96f0b27..30eb33a4f7 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot.tag; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java index ab20ed09dc..8645f3c519 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.tracing.parser; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.parser; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.tracing.tag.TracingBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.tag.TracingBeanDefinitionTag; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java index 9619f574e4..a288cdf20e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.tracing.tag; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/spring.handlers b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.handlers similarity index 91% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/spring.handlers rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.handlers index 02bc19da7c..58639891d2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/spring.handlers +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.handlers @@ -15,4 +15,4 @@ # limitations under the License. # -http\://shardingsphere.apache.org/schema/elasticjob=org.apache.shardingsphere.elasticjob.lite.spring.namespace.ElasticJobNamespaceHandler +http\://shardingsphere.apache.org/schema/elasticjob=org.apache.shardingsphere.elasticjob.engine.spring.namespace.ElasticJobNamespaceHandler diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/spring.schemas b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.schemas similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/main/resources/META-INF/spring.schemas rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.schemas diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/aspect/SimpleAspect.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java similarity index 92% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/aspect/SimpleAspect.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java index 5cdd7cb41f..1672fca67e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/aspect/SimpleAspect.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.aspect; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.aspect; import org.aspectj.lang.JoinPoint; import org.springframework.stereotype.Component; @@ -30,7 +30,7 @@ public class SimpleAspect { /** * Aspect. */ - @Pointcut("execution(* org.apache.shardingsphere.elasticjob.lite.spring.fixture..*(..))") + @Pointcut("execution(* org.apache.shardingsphere.elasticjob.engine.spring.fixture..*(..))") public void aspect() { } diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/DataflowElasticJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/DataflowElasticJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java index 3e41aac522..138d758315 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/DataflowElasticJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/FooSimpleElasticJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/FooSimpleElasticJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java index 785be9b4ed..d9b8570f1d 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/FooSimpleElasticJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java index 861c8463a6..089cba9534 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.annotation; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.annotation; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java index 21e40a0bac..c0bb9892b8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref; import lombok.Getter; import lombok.Setter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.service.FooService; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service.FooService; import java.util.Collections; import java.util.List; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java index 1029dd4964..5964c53d23 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref; import lombok.Getter; import lombok.Setter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.service.FooService; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service.FooService; public class RefFooSimpleElasticJob implements SimpleJob { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleCglibListener.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleCglibListener.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java index a7e16c09d9..6dc2dc8fe7 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleCglibListener.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java index 6083b0cb9b..a656454b23 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleListener.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleListener.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java index 9dc3f36b55..000a8f9952 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleListener.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleOnceListener.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java similarity index 88% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleOnceListener.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java index e9e31d7ed0..7df627eb7b 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.service.FooService; +import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service.FooService; import org.springframework.beans.factory.annotation.Autowired; import static org.hamcrest.CoreMatchers.is; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/service/FooService.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/service/FooService.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java index cd21af3ed7..1a35de7581 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/service/FooService.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.service; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service; public interface FooService { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/service/FooServiceImpl.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java similarity index 91% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/service/FooServiceImpl.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java index ee0b936683..a9e0d05df3 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/fixture/service/FooServiceImpl.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.service; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service; public class FooServiceImpl implements FooService { diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java index a4d4cc0e59..eb10c0b6aa 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.DataflowElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.DataflowElasticJob; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.FooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java similarity index 84% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index 048a6d0399..d672a55ef6 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.DataflowElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.DataflowElasticJob; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.FooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java index 5736f9bd05..de4b47314f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java index a6337d6684..97d17f80c5 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java index 79268621b3..2f64a6ae1f 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java index 6d56e8c7d1..19ebb96870 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java index d1cf6cb007..24c81dfafa 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithListenerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 60f42adce4..21b729cc81 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index 6e6a9bfcd2..61f4d5e9b3 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java index 7bea1a7f1a..7016acd6f4 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java index 8ca6c8bc24..98ab3a44ba 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java index 6bc59585b5..7053ac2cbd 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java index d2cdbb655d..f650ec78e1 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java index 783e0d3769..6c1ff0f1b6 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java index d5c792dc7a..87f41f7a95 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java similarity index 84% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index c678eb7173..eac01a5da4 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java similarity index 85% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index 4078ae4e5f..a5850543df 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java index 63a5063daa..d779191235 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java similarity index 84% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index a25ed76a3f..82fabe7955 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/JobScannerTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java similarity index 93% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/JobScannerTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java index d61d106bfa..ce2b34530c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/scanner/JobScannerTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.scanner; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java similarity index 82% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java index e8cac52388..7b1da87381 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot; -import org.apache.shardingsphere.elasticjob.lite.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java similarity index 86% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java index 4c1bd1e954..108c37aa7e 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot; -import org.apache.shardingsphere.elasticjob.lite.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SocketUtils.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SocketUtils.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java index 7434c87f98..8ceec037f1 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/snapshot/SocketUtils.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.snapshot; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot; import java.io.BufferedReader; import java.io.BufferedWriter; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java index d78924878d..74fce8e4a2 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.test; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.TestExecutionListeners; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java similarity index 98% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java index 86bf93bc17..efbdb9da1c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/namespace/test/EmbedZookeeperTestExecutionListener.java +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.spring.namespace.test; +package org.apache.shardingsphere.elasticjob.engine.spring.namespace.test; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/base.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/base.xml similarity index 95% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/base.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/base.xml index d02d4ad5d6..d9c1ff679c 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/base.xml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/base.xml @@ -40,5 +40,5 @@ - + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml index 8d961436f3..4248c702e8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml @@ -26,8 +26,8 @@ "> - - + + - - + + - + - + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml index 1ed98e0f32..a5a0c18358 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml @@ -26,8 +26,8 @@ "> - - + + - + - - + + - + - - + + - - + + - - + + - - + + - + - + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/withJobType.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobType.xml similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/withJobType.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobType.xml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/withListener.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListener.xml similarity index 94% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/withListener.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListener.xml index 7e90891935..44aaecfcf8 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/job/withListener.xml +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListener.xml @@ -26,8 +26,8 @@ "> - - + + - + - - + + - + - - + + - - + + - + diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 66% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index c8c5667836..b8e125cef7 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -15,7 +15,7 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener.SimpleCglibListener -org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener.SimpleJdkDynamicProxyListener -org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener.SimpleListener -org.apache.shardingsphere.elasticjob.lite.spring.namespace.fixture.listener.SimpleOnceListener +org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleCglibListener +org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleJdkDynamicProxyListener +org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleListener +org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleOnceListener diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/conf/job/conf.properties b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/job/conf.properties similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/conf/job/conf.properties rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/job/conf.properties index 18714eab62..55154f9077 100644 --- a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/conf/job/conf.properties +++ b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/job/conf.properties @@ -16,7 +16,7 @@ # regCenter.serverLists=localhost:3181 -regCenter.namespace=elasticjob-lite-spring-test +regCenter.namespace=elasticjob-engine-spring-test regCenter.baseSleepTimeMilliseconds=1000 regCenter.maxSleepTimeMilliseconds=3000 regCenter.maxRetries=3 @@ -39,5 +39,5 @@ dataflowJob.overwrite=true dataflowJob.streamingProcess=true # need absolute path -#script.scriptCommandLine=your_path/elasticjob-lite/elasticjob-lite-spring/src/test/resources/script/demo.sh +#script.scriptCommandLine=your_path/elasticjob/elasticjob-engine-spring/src/test/resources/script/demo.sh script.scriptCommandLine=echo test diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/conf/reg/conf.properties b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/reg/conf.properties similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/conf/reg/conf.properties rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/reg/conf.properties diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/logback-test.xml b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/logback-test.xml rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/logback-test.xml diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/script/demo.bat b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.bat similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/script/demo.bat rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.bat diff --git a/elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/script/demo.sh b/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.sh similarity index 100% rename from elasticjob-lite/elasticjob-lite-spring/elasticjob-lite-spring-namespace/src/test/resources/script/demo.sh rename to elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.sh diff --git a/elasticjob-lite/elasticjob-lite-spring/pom.xml b/elasticjob-engine/elasticjob-engine-spring/pom.xml similarity index 90% rename from elasticjob-lite/elasticjob-lite-spring/pom.xml rename to elasticjob-engine/elasticjob-engine-spring/pom.xml index a90634102b..afcdbaa6d0 100644 --- a/elasticjob-lite/elasticjob-lite-spring/pom.xml +++ b/elasticjob-engine/elasticjob-engine-spring/pom.xml @@ -20,17 +20,17 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-lite + elasticjob-engine 3.1.0-SNAPSHOT - elasticjob-lite-spring + elasticjob-engine-spring pom ${project.artifactId} - elasticjob-lite-spring-core - elasticjob-lite-spring-boot-starter - elasticjob-lite-spring-namespace + elasticjob-engine-spring-core + elasticjob-engine-spring-boot-starter + elasticjob-engine-spring-namespace diff --git a/elasticjob-lite/pom.xml b/elasticjob-engine/pom.xml similarity index 87% rename from elasticjob-lite/pom.xml rename to elasticjob-engine/pom.xml index 025f6a9ec9..02df86a012 100644 --- a/elasticjob-lite/pom.xml +++ b/elasticjob-engine/pom.xml @@ -23,13 +23,13 @@ elasticjob 3.1.0-SNAPSHOT - elasticjob-lite + elasticjob-engine pom ${project.artifactId} - elasticjob-lite-core - elasticjob-lite-spring - elasticjob-lite-lifecycle + elasticjob-engine-core + elasticjob-engine-spring + elasticjob-engine-lifecycle diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/resources/logback-test.xml b/elasticjob-infra/elasticjob-infra-common/src/test/resources/logback-test.xml index e261679817..c79142ad07 100644 --- a/elasticjob-infra/elasticjob-infra-common/src/test/resources/logback-test.xml +++ b/elasticjob-infra/elasticjob-infra-common/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/logback-test.xml b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/logback-test.xml index f216020279..287aa7dde9 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/logback-test.xml +++ b/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/examples/elasticjob-example-cloud/pom.xml b/examples/elasticjob-example-cloud/pom.xml deleted file mode 100755 index 90215b2ded..0000000000 --- a/examples/elasticjob-example-cloud/pom.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-example - ${revision} - - elasticjob-example-cloud - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-example-jobs - ${project.parent.version} - - - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-executor - - - - org.slf4j - slf4j-api - - - org.slf4j - jcl-over-slf4j - - - org.slf4j - log4j-over-slf4j - - - ch.qos.logback - logback-classic - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - src/main/resources/assembly/assembly.xml - - - - - package - - single - - - - - - - diff --git a/examples/elasticjob-example-cloud/src/README.txt b/examples/elasticjob-example-cloud/src/README.txt deleted file mode 100755 index f1dba6e3f0..0000000000 --- a/examples/elasticjob-example-cloud/src/README.txt +++ /dev/null @@ -1,41 +0,0 @@ -部署步骤 -启动Zookeeper, Mesos Master/Agent 以及 ElasticJob-Cloud Scheduler。 - -将打包之后的作业tar.gz文件放至网络可访问的位置,如:ftp或http。打包的tar.gz文件中Main方法需要调用 ElasticJob-Cloud 提供的JobBootstrap.execute方法。 - -使用curl命令调用RESTful API注册作业。 - -RESTful API: ElasticJob-Cloud 提供作业及应用注册/注销RESTful API,可通过curl操作。 - -a.注册应用 -curl -l -H "Content-type: application/json" -X POST -d '{"appName":"foo_app","appURL":"http://app_host:8080/yourJobs.gz","cpuCount":0.1,"memoryMB":64.0,"bootstrapScript":"bin/start.sh","appCacheEnable":true}' http://elastic_job_cloud_host:8899/api/app - -b. 注册作业 -注册的作业可用Java和Spring两种启动方式,作业启动在开发指南中有说明,这里只举例说明两种方式如何注册。 -1. Java启动方式作业注册 -curl -l -H "Content-type: application/json" -X POST -d '{"jobName":"foo_job","jobClass":"yourJobClass","jobExecutionType":"TRANSIENT","cron":"0/5 * * * * ?","shardingTotalCount":5,"cpuCount":0.1,"memoryMB":64.0,"appName":"foo_app","failover":true,"misfire":true}' http://elastic_job_cloud_host:8899/api/job/register - -2. Spring启动方式作业注册 -curl -l -H "Content-type: application/json" -X POST -d '{"jobName":"foo_job","beanName":"yourBeanName","applicationContext":"applicationContext.xml","jobExecutionType":"TRANSIENT","cron":"0/5 * * * * ?","shardingTotalCount":5,"cpuCount":0.1,"memoryMB":64.0,"appName":"foo_app","failover":true,"misfire":true}' http://elastic_job_cloud_host:8899/api/job/register - -参数详细配置请见:http://elasticjob.io/elastic-job/elastic-job-cloud/02-guide/cloud-restful-api/ - - -注册demo作业的快捷命令: - -1. 注册APP: -curl -l -H "Content-type: application/json" -X POST -d '{"appName":"exampleApp","appURL":"http://localhost:8080/elasticjob-example-cloud-2.1.4.tar.gz","cpuCount":0.1,"memoryMB":64.0,"bootstrapScript":"bin/start.sh","appCacheEnable":true}' http://localhost:8899/api/app - -2. Java启动方式作业注册: - -curl -l -H "Content-type: application/json" -X POST -d '{"jobName":"test_job_simple","appName":"exampleApp","jobExecutionType":"TRANSIENT","jobClass":"org.apache.shardingsphere.elasticjob.lite.example.job.simple.JavaSimpleJob","cron":"0/10 * * * * ?","shardingTotalCount":1,"cpuCount":0.1,"memoryMB":64.0}' http://localhost:8899/api/job/register - -curl -l -H "Content-type: application/json" -X POST -d '{"jobName":"test_job_dataflow","appName":"exampleApp","jobExecutionType":"DAEMON","jobClass":"org.apache.shardingsphere.elasticjob.lite.example.job.dataflow.JavaDataflowJob","cron":"0/10 * * * * ?","shardingTotalCount":3,"cpuCount":0.1,"memoryMB":64.0}' http://localhost:8899/api/job/register - -curl -l -H "Content-type: application/json" -X POST -d '{"jobName":"test_job_script","appName":"exampleApp","jobExecutionType":"TRANSIENT","cron":"0/10 * * * * ?","shardingTotalCount":3,"cpuCount":0.1,"memoryMB":64.0, scriptCommandLine="script/demo.sh"}' http://localhost:8899/api/job/register - -3. Spring启动方式作业注册: - -curl -l -H "Content-type: application/json" -X POST -d '{"jobName":"test_job_simple_spring","appName":"exampleApp","jobExecutionType":"TRANSIENT","jobClass":"org.apache.shardingsphere.elasticjob.lite.example.job.simple.SpringSimpleJob","beanName":"springSimpleJob","applicationContext":"classpath:META-INF/applicationContext.xml","cron":"0/10 * * * * ?","shardingTotalCount":1,"cpuCount":0.1,"memoryMB":64.0}' http://localhost:8899/api/job/register - -curl -l -H "Content-type: application/json" -X POST -d '{"jobName":"test_job_dataflow_spring","appName":"exampleApp","jobExecutionType":"DAEMON","jobClass":"org.apache.shardingsphere.elasticjob.lite.example.job.dataflow.SpringDataflowJob","beanName":"springDataflowJob","applicationContext":"classpath:META-INF/applicationContext.xml","cron":"0/10 * * * * ?","shardingTotalCount":3,"cpuCount":0.1,"memoryMB":64.0}' http://localhost:8899/api/job/register diff --git a/examples/elasticjob-example-cloud/src/main/java/org/apache/shardingsphere/elasticjob/cloud/example/CloudJobMain.java b/examples/elasticjob-example-cloud/src/main/java/org/apache/shardingsphere/elasticjob/cloud/example/CloudJobMain.java deleted file mode 100755 index 2ec07d20b1..0000000000 --- a/examples/elasticjob-example-cloud/src/main/java/org/apache/shardingsphere/elasticjob/cloud/example/CloudJobMain.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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.elasticjob.cloud.example; - -import org.apache.shardingsphere.elasticjob.cloud.api.JobBootstrap; - -public final class CloudJobMain { - - // CHECKSTYLE:OFF - public static void main(final String[] args) { - // CHECKSTYLE:ON - JobBootstrap.execute("SCRIPT"); - } -} diff --git a/examples/elasticjob-example-cloud/src/main/resources/META-INF/applicationContext.xml b/examples/elasticjob-example-cloud/src/main/resources/META-INF/applicationContext.xml deleted file mode 100755 index aacc4344de..0000000000 --- a/examples/elasticjob-example-cloud/src/main/resources/META-INF/applicationContext.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/examples/elasticjob-example-cloud/src/main/resources/assembly/assembly.xml b/examples/elasticjob-example-cloud/src/main/resources/assembly/assembly.xml deleted file mode 100755 index 188c0fcd7f..0000000000 --- a/examples/elasticjob-example-cloud/src/main/resources/assembly/assembly.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - tar.gz - - false - - - src/main/resources/bin - bin - 0755 - - - src/main/resources/script - script - 0755 - - - - - - lib - 0644 - - - diff --git a/examples/elasticjob-example-cloud/src/main/resources/bin/start.sh b/examples/elasticjob-example-cloud/src/main/resources/bin/start.sh deleted file mode 100755 index 04ee0427ae..0000000000 --- a/examples/elasticjob-example-cloud/src/main/resources/bin/start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -java -classpath lib/*:. org.apache.shardingsphere.elasticjob.cloud.example.CloudJobMain diff --git a/examples/elasticjob-example-cloud/src/main/resources/logback.xml b/examples/elasticjob-example-cloud/src/main/resources/logback.xml deleted file mode 100755 index 601a5eaae6..0000000000 --- a/examples/elasticjob-example-cloud/src/main/resources/logback.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - ${log.context.name} - - - - ${log.pattern} - - - - - - - - - - - diff --git a/examples/elasticjob-example-cloud/src/main/resources/script/demo.sh b/examples/elasticjob-example-cloud/src/main/resources/script/demo.sh deleted file mode 100755 index 7c67ff77af..0000000000 --- a/examples/elasticjob-example-cloud/src/main/resources/script/demo.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo sharding execution context is $* \ No newline at end of file diff --git a/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/EmbedZookeeperServer.java b/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/EmbedZookeeperServer.java similarity index 96% rename from examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/EmbedZookeeperServer.java rename to examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/EmbedZookeeperServer.java index 88b0bcbf1a..7e62108643 100644 --- a/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/EmbedZookeeperServer.java +++ b/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/EmbedZookeeperServer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example; +package org.apache.shardingsphere.elasticjob.engine.example; import org.apache.curator.test.TestingServer; diff --git a/examples/elasticjob-example-jobs/pom.xml b/examples/elasticjob-example-jobs/pom.xml index 2b0a083ff9..473ff3a193 100644 --- a/examples/elasticjob-example-jobs/pom.xml +++ b/examples/elasticjob-example-jobs/pom.xml @@ -31,7 +31,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-lite-core + elasticjob-engine-core diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/entity/Foo.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/entity/Foo.java index 67c8ffd71c..30a8cc1877 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/entity/Foo.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/entity/Foo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.fixture.entity; +package org.apache.shardingsphere.elasticjob.engine.example.fixture.entity; import java.io.Serializable; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepository.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepository.java index b9c069ca24..40ce742dc9 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepository.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepository.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.fixture.repository; +package org.apache.shardingsphere.elasticjob.engine.example.fixture.repository; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; import org.springframework.stereotype.Repository; import java.util.ArrayList; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepositoryFactory.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepositoryFactory.java index ae5d75e388..3aac7be913 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepositoryFactory.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepositoryFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.fixture.repository; +package org.apache.shardingsphere.elasticjob.engine.example.fixture.repository; public final class FooRepositoryFactory { diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java index b8ffe468e4..7cde78a4e3 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job.dataflow; +package org.apache.shardingsphere.elasticjob.engine.example.job.dataflow; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepositoryFactory; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepositoryFactory; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java index d322116d17..113ca2b921 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job.dataflow; +package org.apache.shardingsphere.elasticjob.engine.example.job.dataflow; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; import javax.annotation.Resource; import java.text.SimpleDateFormat; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaOccurErrorJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaOccurErrorJob.java index 796b23b2ca..6800716cde 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaOccurErrorJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaOccurErrorJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job.simple; +package org.apache.shardingsphere.elasticjob.engine.example.job.simple; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java index 68a711b47d..4559ca7b82 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job.simple; +package org.apache.shardingsphere.elasticjob.engine.example.job.simple; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepositoryFactory; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepositoryFactory; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java index d4eba69deb..5cc613497a 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job.simple; +package org.apache.shardingsphere.elasticjob.engine.example.job.simple; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.lite.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; import javax.annotation.Resource; import java.text.SimpleDateFormat; diff --git a/examples/elasticjob-example-lite-java/pom.xml b/examples/elasticjob-example-lite-java/pom.xml index de24c3a4dd..24f214bce6 100644 --- a/examples/elasticjob-example-lite-java/pom.xml +++ b/examples/elasticjob-example-lite-java/pom.xml @@ -57,7 +57,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-lite-core + elasticjob-engine-core diff --git a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java index 19d3a82b33..5f68554367 100644 --- a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java +++ b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example; +package org.apache.shardingsphere.elasticjob.engine.example; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -24,11 +24,11 @@ import org.apache.shardingsphere.elasticjob.error.handler.email.EmailPropertiesConstants; import org.apache.shardingsphere.elasticjob.error.handler.wechat.WechatPropertiesConstants; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.lite.example.job.dataflow.JavaDataflowJob; -import org.apache.shardingsphere.elasticjob.lite.example.job.simple.JavaOccurErrorJob; -import org.apache.shardingsphere.elasticjob.lite.example.job.simple.JavaSimpleJob; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.example.job.dataflow.JavaDataflowJob; +import org.apache.shardingsphere.elasticjob.engine.example.job.simple.JavaOccurErrorJob; +import org.apache.shardingsphere.elasticjob.engine.example.job.simple.JavaSimpleJob; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/examples/elasticjob-example-lite-spring/pom.xml b/examples/elasticjob-example-lite-spring/pom.xml index af99f8e427..6c01294512 100644 --- a/examples/elasticjob-example-lite-spring/pom.xml +++ b/examples/elasticjob-example-lite-spring/pom.xml @@ -57,7 +57,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-namespace + elasticjob-engine-spring-namespace diff --git a/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringMain.java b/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringMain.java index 6f67e9fc72..ccbbaf638f 100644 --- a/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringMain.java +++ b/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringMain.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example; +package org.apache.shardingsphere.elasticjob.engine.example; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml b/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml index a934b475a2..e937ea9bd1 100644 --- a/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml +++ b/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml @@ -27,7 +27,7 @@ http://shardingsphere.apache.org/schema/elasticjob http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd "> - + - - + + - + @@ -87,7 +87,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/examples/elasticjob-example-lite-springboot/pom.xml b/examples/elasticjob-example-lite-springboot/pom.xml index ea7ee63be3..009b9b6535 100644 --- a/examples/elasticjob-example-lite-springboot/pom.xml +++ b/examples/elasticjob-example-lite-springboot/pom.xml @@ -46,7 +46,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-boot-starter + elasticjob-engine-spring-boot-starter ${project.version} diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringBootMain.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/SpringBootMain.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringBootMain.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/SpringBootMain.java index 0cbdca2ce9..36904fd31c 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringBootMain.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/SpringBootMain.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example; +package org.apache.shardingsphere.elasticjob.engine.example; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/controller/OneOffJobController.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/controller/OneOffJobController.java similarity index 93% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/controller/OneOffJobController.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/controller/OneOffJobController.java index 40a435ca04..aed8e8af8b 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/controller/OneOffJobController.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/controller/OneOffJobController.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.controller; +package org.apache.shardingsphere.elasticjob.engine.example.controller; import javax.annotation.Resource; -import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.GetMapping; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/entity/Foo.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/entity/Foo.java similarity index 96% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/entity/Foo.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/entity/Foo.java index e999960088..c51f0be5ed 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/entity/Foo.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/entity/Foo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.entity; +package org.apache.shardingsphere.elasticjob.engine.example.entity; import java.io.Serializable; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootDataflowJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootDataflowJob.java similarity index 90% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootDataflowJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootDataflowJob.java index 337777e780..5da6e447ad 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootDataflowJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootDataflowJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job; +package org.apache.shardingsphere.elasticjob.engine.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.lite.example.entity.Foo; -import org.apache.shardingsphere.elasticjob.lite.example.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.engine.example.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.repository.FooRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeDingtalkJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeDingtalkJob.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeDingtalkJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeDingtalkJob.java index 6669cf2070..3317492a8b 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeDingtalkJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeDingtalkJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job; +package org.apache.shardingsphere.elasticjob.engine.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeEmailJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeEmailJob.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeEmailJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeEmailJob.java index 4687e69dd3..575689075b 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeEmailJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeEmailJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job; +package org.apache.shardingsphere.elasticjob.engine.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeWechatJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeWechatJob.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeWechatJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeWechatJob.java index 965d443b89..41a08980d4 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootOccurErrorNoticeWechatJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeWechatJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job; +package org.apache.shardingsphere.elasticjob.engine.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootSimpleJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootSimpleJob.java similarity index 89% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootSimpleJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootSimpleJob.java index 8208d5cb85..cc15b3fb61 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/SpringBootSimpleJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootSimpleJob.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.job; +package org.apache.shardingsphere.elasticjob.engine.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.lite.example.entity.Foo; -import org.apache.shardingsphere.elasticjob.lite.example.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.engine.example.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.repository.FooRepository; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/repository/FooRepository.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/repository/FooRepository.java similarity index 93% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/repository/FooRepository.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/repository/FooRepository.java index 507db9d5bb..6dfe994a7a 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/repository/FooRepository.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/repository/FooRepository.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.lite.example.repository; +package org.apache.shardingsphere.elasticjob.engine.example.repository; -import org.apache.shardingsphere.elasticjob.lite.example.entity.Foo; +import org.apache.shardingsphere.elasticjob.engine.example.entity.Foo; import org.springframework.stereotype.Repository; import java.util.ArrayList; diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml index d487f0ad7f..11c5c0b6df 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml +++ b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml @@ -7,15 +7,15 @@ elasticjob: type: RDB regCenter: serverLists: localhost:6181 - namespace: elasticjob-lite-springboot + namespace: elasticjob-engine-springboot jobs: simpleJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootSimpleJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob cron: 0/5 * * * * ? shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou dataflowJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootDataflowJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootDataflowJob cron: 0/5 * * * * ? shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou @@ -32,7 +32,7 @@ elasticjob: props: script.command.line: "echo Manual SCRIPT Job: " occurErrorNoticeDingtalkJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootOccurErrorNoticeDingtalkJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootOccurErrorNoticeDingtalkJob overwrite: true shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou @@ -46,7 +46,7 @@ elasticjob: connectTimeout: 3000 readTimeout: 5000 occurErrorNoticeWechatJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootOccurErrorNoticeWechatJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootOccurErrorNoticeWechatJob overwrite: true shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou @@ -58,7 +58,7 @@ elasticjob: connectTimeout: 3000 readTimeout: 5000 occurErrorNoticeEmailJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.lite.example.job.SpringBootOccurErrorNoticeEmailJob + elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootOccurErrorNoticeEmailJob overwrite: true shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou diff --git a/examples/pom.xml b/examples/pom.xml index f9dc6511a2..64eb64f03b 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -33,12 +33,10 @@ elasticjob-example-lite-java elasticjob-example-lite-spring elasticjob-example-lite-springboot - - elasticjob-example-cloud - 3.0.4 + 3.1.0-SNAPSHOT 1.8 5.1.0 4.3.4.RELEASE @@ -55,7 +53,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-lite-core + elasticjob-engine-core ${revision} @@ -65,13 +63,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-lite-spring-namespace - ${revision} - - - - org.apache.shardingsphere.elasticjob - elasticjob-cloud-executor + elasticjob-engine-spring-namespace ${revision} diff --git a/pom.xml b/pom.xml index 8c6b9c4e1f..073e3406f0 100644 --- a/pom.xml +++ b/pom.xml @@ -33,9 +33,7 @@ elasticjob-api elasticjob-infra - - elasticjob-lite - elasticjob-cloud + elasticjob-engine elasticjob-distribution elasticjob-ecosystem @@ -73,9 +71,6 @@ 4.0.3 1.6.0 - 1.11.0 - 1.0.1 - 1.18.30 8.0.16 @@ -254,16 +249,6 @@ import - - org.apache.mesos - mesos - ${mesos.version} - - - com.netflix.fenzo - fenzo-core - ${fenzo.version} - org.apache.commons commons-dbcp2 From aff58de04fce648ad8db80ba03163d1b414fc6b8 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 14 Oct 2023 23:15:12 +0800 Subject: [PATCH 054/178] Reduce folder name (#2290) --- {elasticjob-api => api}/pom.xml | 0 .../elasticjob/annotation/ElasticJobConfiguration.java | 0 .../elasticjob/annotation/ElasticJobProp.java | 0 .../shardingsphere/elasticjob/api/ElasticJob.java | 0 .../elasticjob/api/JobConfiguration.java | 0 .../elasticjob/api/JobExtraConfiguration.java | 0 .../elasticjob/api/JobExtraConfigurationFactory.java | 0 .../shardingsphere/elasticjob/api/ShardingContext.java | 0 .../annotation/ElasticJobConfigurationTest.java | 0 .../annotation/SimpleTracingConfigurationFactory.java | 0 .../elasticjob/annotation/job/CustomJob.java | 0 .../elasticjob/annotation/job/impl/SimpleTestJob.java | 0 .../elasticjob/api/JobConfigurationTest.java | 0 .../bin}/pom.xml | 0 .../main/assembly/elasticjob-binary-distribution.xml | 0 .../bin}/src/main/release-docs/README.txt | 0 {elasticjob-distribution => distribution}/pom.xml | 4 ++-- .../src}/pom.xml | 0 .../src}/src/main/assembly/source-distribution.xml | 0 .../error-handler}/pom.xml | 4 ++-- .../error-handler/spi}/pom.xml | 0 .../elasticjob/error/handler/JobErrorHandler.java | 0 .../handler/JobErrorHandlerPropertiesValidator.java | 0 .../error-handler/type/dingtalk}/pom.xml | 0 .../handler/dingtalk/DingtalkJobErrorHandler.java | 0 .../DingtalkJobErrorHandlerPropertiesValidator.java | 0 .../handler/dingtalk/DingtalkPropertiesConstants.java | 0 ...dingsphere.elasticjob.error.handler.JobErrorHandler | 0 ...ob.error.handler.JobErrorHandlerPropertiesValidator | 0 ...DingtalkJobErrorHandlerPropertiesValidatorTest.java | 0 .../handler/dingtalk/DingtalkJobErrorHandlerTest.java | 0 .../dingtalk/fixture/DingtalkInternalController.java | 0 ...dingsphere.elasticjob.error.handler.JobErrorHandler | 0 .../type/dingtalk}/src/test/resources/logback-test.xml | 0 .../error-handler/type/email}/pom.xml | 0 .../error/handler/email/EmailJobErrorHandler.java | 0 .../email/EmailJobErrorHandlerPropertiesValidator.java | 0 .../error/handler/email/EmailPropertiesConstants.java | 0 ...dingsphere.elasticjob.error.handler.JobErrorHandler | 0 ...ob.error.handler.JobErrorHandlerPropertiesValidator | 0 .../EmailJobErrorHandlerPropertiesValidatorTest.java | 0 .../error/handler/email/EmailJobErrorHandlerTest.java | 0 .../type/email}/src/test/resources/logback-test.xml | 0 .../error-handler/type/general}/pom.xml | 0 .../error/handler/JobErrorHandlerFactory.java | 0 .../error/handler/JobErrorHandlerReloadable.java | 0 .../error/handler/general/IgnoreJobErrorHandler.java | 0 .../error/handler/general/LogJobErrorHandler.java | 0 .../error/handler/general/ThrowJobErrorHandler.java | 0 ...dingsphere.elasticjob.error.handler.JobErrorHandler | 0 ....shardingsphere.elasticjob.infra.context.Reloadable | 0 .../error/handler/JobErrorHandlerFactoryTest.java | 0 .../error/handler/JobErrorHandlerReloadableTest.java | 0 .../handler/general/IgnoreJobErrorHandlerTest.java | 0 .../error/handler/general/LogJobErrorHandlerTest.java | 0 .../handler/general/ThrowJobErrorHandlerTest.java | 0 ...dingsphere.elasticjob.error.handler.JobErrorHandler | 0 .../type/general}/src/test/resources/logback-test.xml | 0 .../error-handler/type}/pom.xml | 8 ++++---- .../error-handler/type/wechat}/pom.xml | 0 .../error/handler/wechat/WechatJobErrorHandler.java | 0 .../WechatJobErrorHandlerPropertiesValidator.java | 0 .../handler/wechat/WechatPropertiesConstants.java | 0 ...dingsphere.elasticjob.error.handler.JobErrorHandler | 0 ...ob.error.handler.JobErrorHandlerPropertiesValidator | 0 .../WechatJobErrorHandlerPropertiesValidatorTest.java | 0 .../handler/wechat/WechatJobErrorHandlerTest.java | 0 .../wechat/fixture/WechatInternalController.java | 0 ...dingsphere.elasticjob.error.handler.JobErrorHandler | 0 .../type/wechat}/src/test/resources/logback-test.xml | 0 .../executor/kernel}/pom.xml | 0 .../elasticjob/executor/ElasticJobExecutor.java | 0 .../shardingsphere/elasticjob/executor/JobFacade.java | 0 .../elasticjob/executor/context/ExecutorContext.java | 0 .../elasticjob/executor/item/JobItemExecutor.java | 0 .../executor/item/JobItemExecutorFactory.java | 0 .../executor/item/impl/ClassedJobItemExecutor.java | 0 .../executor/item/impl/TypedJobItemExecutor.java | 0 .../elasticjob/executor/ElasticJobExecutorTest.java | 0 .../fixture/executor/ClassedFooJobExecutor.java | 0 .../executor/fixture/executor/TypedFooJobExecutor.java | 0 .../executor/fixture/job/DetailedFooJob.java | 0 .../elasticjob/executor/fixture/job/FailedJob.java | 0 .../elasticjob/executor/fixture/job/FooJob.java | 0 .../executor/item/JobItemExecutorFactoryTest.java | 0 ...lasticjob.executor.item.impl.ClassedJobItemExecutor | 0 ....elasticjob.executor.item.impl.TypedJobItemExecutor | 0 .../elasticjob-executor => ecosystem/executor}/pom.xml | 4 ++-- .../executor/type/dataflow}/pom.xml | 0 .../dataflow/executor/DataflowJobExecutor.java | 0 .../elasticjob/dataflow/job/DataflowJob.java | 0 .../dataflow/props/DataflowJobProperties.java | 0 ...lasticjob.executor.item.impl.ClassedJobItemExecutor | 0 .../dataflow/executor/DataflowJobExecutorTest.java | 0 .../executor/type/http}/pom.xml | 0 .../elasticjob/http/executor/HttpJobExecutor.java | 0 .../shardingsphere/elasticjob/http/pojo/HttpParam.java | 0 .../elasticjob/http/props/HttpJobProperties.java | 0 ....elasticjob.executor.item.impl.TypedJobItemExecutor | 0 .../elasticjob/http/executor/HttpJobExecutorTest.java | 0 .../http/executor/fixture/InternalController.java | 0 .../executor/type}/pom.xml | 8 ++++---- .../executor/type/script}/pom.xml | 0 .../elasticjob/script/executor/ScriptJobExecutor.java | 0 .../elasticjob/script/props/ScriptJobProperties.java | 0 ....elasticjob.executor.item.impl.TypedJobItemExecutor | 0 .../elasticjob/script/ScriptJobExecutorTest.java | 0 .../executor/type/simple}/pom.xml | 0 .../elasticjob/simple/executor/SimpleJobExecutor.java | 0 .../elasticjob/simple/job/SimpleJob.java | 0 ...lasticjob.executor.item.impl.ClassedJobItemExecutor | 0 .../simple/executor/SimpleJobExecutorTest.java | 0 .../elasticjob/simple/job/FooSimpleJob.java | 0 {elasticjob-ecosystem => ecosystem}/pom.xml | 6 +++--- .../tracing/api}/pom.xml | 0 .../elasticjob/tracing/JobTracingEventBus.java | 0 .../elasticjob/tracing/api/TracingConfiguration.java | 0 .../tracing/api/TracingStorageConfiguration.java | 0 .../elasticjob/tracing/event/JobEvent.java | 0 .../elasticjob/tracing/event/JobExecutionEvent.java | 0 .../elasticjob/tracing/event/JobStatusTraceEvent.java | 0 .../exception/TracingConfigurationException.java | 0 .../TracingStorageConverterNotFoundException.java | 0 .../exception/TracingStorageUnavailableException.java | 0 .../elasticjob/tracing/exception/WrapException.java | 0 .../elasticjob/tracing/listener/TracingListener.java | 0 .../tracing/listener/TracingListenerConfiguration.java | 0 .../tracing/listener/TracingListenerFactory.java | 0 .../tracing/storage/TracingStorageConverter.java | 0 .../storage/TracingStorageConverterFactory.java | 0 .../tracing/yaml/YamlTracingConfiguration.java | 0 .../yaml/YamlTracingConfigurationConverter.java | 0 .../tracing/yaml/YamlTracingStorageConfiguration.java | 0 ...ticjob.infra.yaml.config.YamlConfigurationConverter | 0 .../elasticjob/tracing/JobTracingEventBusTest.java | 0 .../tracing/event/JobExecutionEventTest.java | 0 .../elasticjob/tracing/fixture/JobEventCaller.java | 0 .../tracing/fixture/JobEventCallerConfiguration.java | 0 .../tracing/fixture/JobEventCallerConverter.java | 0 .../fixture/TestTracingFailureConfiguration.java | 0 .../tracing/fixture/TestTracingListener.java | 0 .../fixture/TestTracingListenerConfiguration.java | 0 .../tracing/listener/TracingListenerFactoryTest.java | 0 .../storage/TracingStorageConverterFactoryTest.java | 0 .../tracing/yaml/YamlJobEventCallerConfiguration.java | 0 .../yaml/YamlJobEventCallerConfigurationConverter.java | 0 .../yaml/YamlTracingConfigurationConverterTest.java | 0 ...ticjob.infra.yaml.config.YamlConfigurationConverter | 0 ...icjob.tracing.listener.TracingListenerConfiguration | 0 ....elasticjob.tracing.storage.TracingStorageConverter | 0 .../tracing/api}/src/test/resources/logback-test.xml | 0 .../elasticjob-tracing => ecosystem/tracing}/pom.xml | 4 ++-- .../tracing/rdb}/pom.xml | 0 .../rdb/datasource/DataSourceConfiguration.java | 0 .../tracing/rdb/datasource/DataSourceRegistry.java | 0 .../datasource/DataSourceTracingStorageConverter.java | 0 .../tracing/rdb/datasource/JDBCParameterDecorator.java | 0 .../tracing/rdb/listener/RDBTracingListener.java | 0 .../rdb/listener/RDBTracingListenerConfiguration.java | 0 .../tracing/rdb/storage/RDBJobEventStorage.java | 0 .../tracing/rdb/storage/RDBStorageSQLMapper.java | 0 .../elasticjob/tracing/rdb/type/DatabaseType.java | 0 .../tracing/rdb/type/impl/DB2DatabaseType.java | 0 .../tracing/rdb/type/impl/DefaultDatabaseType.java | 0 .../tracing/rdb/type/impl/H2DatabaseType.java | 0 .../tracing/rdb/type/impl/MySQLDatabaseType.java | 0 .../tracing/rdb/type/impl/OracleDatabaseType.java | 0 .../tracing/rdb/type/impl/PostgreSQLDatabaseType.java | 0 .../tracing/rdb/type/impl/SQLServerDatabaseType.java | 0 .../tracing/rdb/yaml/YamlDataSourceConfiguration.java | 0 .../rdb/yaml/YamlDataSourceConfigurationConverter.java | 0 ...ticjob.infra.yaml.config.YamlConfigurationConverter | 0 ...icjob.tracing.listener.TracingListenerConfiguration | 0 ...dingsphere.elasticjob.tracing.rdb.type.DatabaseType | 0 ....elasticjob.tracing.storage.TracingStorageConverter | 0 .../src/main/resources/META-INF/sql/DB2.properties | 0 .../rdb}/src/main/resources/META-INF/sql/H2.properties | 0 .../src/main/resources/META-INF/sql/MySQL.properties | 0 .../src/main/resources/META-INF/sql/Oracle.properties | 0 .../main/resources/META-INF/sql/PostgreSQL.properties | 0 .../src/main/resources/META-INF/sql/SQL92.properties | 0 .../main/resources/META-INF/sql/SQLServer.properties | 0 .../rdb/datasource/DataSourceConfigurationTest.java | 0 .../tracing/rdb/datasource/DataSourceRegistryTest.java | 0 .../DataSourceTracingStorageConverterTest.java | 0 .../listener/RDBTracingListenerConfigurationTest.java | 0 .../tracing/rdb/listener/RDBTracingListenerTest.java | 0 .../tracing/rdb/storage/RDBJobEventStorageTest.java | 0 .../yaml/YamlDataSourceConfigurationConverterTest.java | 0 .../tracing/rdb}/src/test/resources/logback-test.xml | 0 .../elasticjob-engine-core => engine/core}/pom.xml | 0 .../elasticjob/engine/api/bootstrap/JobBootstrap.java | 0 .../engine/api/bootstrap/impl/OneOffJobBootstrap.java | 0 .../api/bootstrap/impl/ScheduleJobBootstrap.java | 0 .../AbstractDistributeOnceElasticJobListener.java | 0 .../engine/api/registry/JobInstanceRegistry.java | 0 .../internal/annotation/JobAnnotationBuilder.java | 0 .../engine/internal/config/ConfigurationNode.java | 0 .../engine/internal/config/ConfigurationService.java | 0 .../internal/config/RescheduleListenerManager.java | 0 .../internal/election/ElectionListenerManager.java | 0 .../engine/internal/election/LeaderNode.java | 0 .../engine/internal/election/LeaderService.java | 0 .../internal/failover/FailoverListenerManager.java | 0 .../engine/internal/failover/FailoverNode.java | 0 .../engine/internal/failover/FailoverService.java | 0 .../internal/guarantee/GuaranteeListenerManager.java | 0 .../engine/internal/guarantee/GuaranteeNode.java | 0 .../engine/internal/guarantee/GuaranteeService.java | 0 .../engine/internal/instance/InstanceNode.java | 0 .../engine/internal/instance/InstanceService.java | 0 .../internal/instance/ShutdownListenerManager.java | 0 .../internal/listener/AbstractListenerManager.java | 0 .../engine/internal/listener/ListenerManager.java | 0 .../internal/listener/ListenerNotifierManager.java | 0 .../RegistryCenterConnectionStateListener.java | 0 .../engine/internal/reconcile/ReconcileService.java | 0 .../engine/internal/schedule/JobRegistry.java | 0 .../internal/schedule/JobScheduleController.java | 0 .../engine/internal/schedule/JobScheduler.java | 0 .../internal/schedule/JobShutdownHookPlugin.java | 0 .../engine/internal/schedule/JobTriggerListener.java | 0 .../elasticjob/engine/internal/schedule/LiteJob.java | 0 .../engine/internal/schedule/LiteJobFacade.java | 0 .../engine/internal/schedule/SchedulerFacade.java | 0 .../elasticjob/engine/internal/server/ServerNode.java | 0 .../engine/internal/server/ServerService.java | 0 .../engine/internal/server/ServerStatus.java | 0 .../internal/setup/DefaultJobClassNameProvider.java | 0 .../engine/internal/setup/JobClassNameProvider.java | 0 .../internal/setup/JobClassNameProviderFactory.java | 0 .../elasticjob/engine/internal/setup/SetUpFacade.java | 0 .../internal/sharding/ExecutionContextService.java | 0 .../engine/internal/sharding/ExecutionService.java | 0 .../sharding/MonitorExecutionListenerManager.java | 0 .../internal/sharding/ShardingListenerManager.java | 0 .../engine/internal/sharding/ShardingNode.java | 0 .../engine/internal/sharding/ShardingService.java | 0 .../engine/internal/snapshot/SnapshotService.java | 0 .../engine/internal/storage/JobNodePath.java | 0 .../engine/internal/storage/JobNodeStorage.java | 0 .../internal/trigger/TriggerListenerManager.java | 0 .../engine/internal/trigger/TriggerNode.java | 0 .../engine/internal/trigger/TriggerService.java | 0 .../engine/internal/util/SensitiveInfoUtils.java | 0 .../api/bootstrap/impl/OneOffJobBootstrapTest.java | 0 .../listener/DistributeOnceElasticJobListenerTest.java | 0 .../api/listener/fixture/ElasticJobListenerCaller.java | 0 .../fixture/TestDistributeOnceElasticJobListener.java | 0 .../api/listener/fixture/TestElasticJobListener.java | 0 .../engine/api/registry/JobInstanceRegistryTest.java | 0 .../elasticjob/engine/fixture/EmbedTestingServer.java | 0 .../elasticjob/engine/fixture/LiteYamlConstants.java | 0 .../engine/fixture/executor/ClassedFooJobExecutor.java | 0 .../engine/fixture/job/AnnotationSimpleJob.java | 0 .../engine/fixture/job/AnnotationUnShardingJob.java | 0 .../elasticjob/engine/fixture/job/DetailedFooJob.java | 0 .../elasticjob/engine/fixture/job/FooJob.java | 0 .../elasticjob/engine/integrate/BaseIntegrateTest.java | 0 .../integrate/disable/DisabledJobIntegrateTest.java | 0 .../disable/OneOffDisabledJobIntegrateTest.java | 0 .../disable/ScheduleDisabledJobIntegrateTest.java | 0 .../integrate/enable/EnabledJobIntegrateTest.java | 0 .../enable/OneOffEnabledJobIntegrateTest.java | 0 .../enable/ScheduleEnabledJobIntegrateTest.java | 0 .../listener/TestDistributeOnceElasticJobListener.java | 0 .../integrate/listener/TestElasticJobListener.java | 0 .../internal/annotation/JobAnnotationBuilderTest.java | 0 .../annotation/integrate/BaseAnnotationTest.java | 0 .../annotation/integrate/OneOffEnabledJobTest.java | 0 .../annotation/integrate/ScheduleEnabledJobTest.java | 0 .../engine/internal/config/ConfigurationNodeTest.java | 0 .../internal/config/ConfigurationServiceTest.java | 0 .../internal/config/RescheduleListenerManagerTest.java | 0 .../internal/election/ElectionListenerManagerTest.java | 0 .../engine/internal/election/LeaderNodeTest.java | 0 .../engine/internal/election/LeaderServiceTest.java | 0 .../internal/failover/FailoverListenerManagerTest.java | 0 .../engine/internal/failover/FailoverNodeTest.java | 0 .../engine/internal/failover/FailoverServiceTest.java | 0 .../guarantee/GuaranteeListenerManagerTest.java | 0 .../engine/internal/guarantee/GuaranteeNodeTest.java | 0 .../internal/guarantee/GuaranteeServiceTest.java | 0 .../engine/internal/instance/InstanceNodeTest.java | 0 .../engine/internal/instance/InstanceServiceTest.java | 0 .../internal/instance/ShutdownListenerManagerTest.java | 0 .../engine/internal/listener/ListenerManagerTest.java | 0 .../internal/listener/ListenerNotifierManagerTest.java | 0 .../RegistryCenterConnectionStateListenerTest.java | 0 .../internal/reconcile/ReconcileServiceTest.java | 0 .../engine/internal/schedule/JobRegistryTest.java | 0 .../internal/schedule/JobScheduleControllerTest.java | 0 .../internal/schedule/JobTriggerListenerTest.java | 0 .../engine/internal/schedule/LiteJobFacadeTest.java | 0 .../engine/internal/schedule/SchedulerFacadeTest.java | 0 .../engine/internal/server/ServerNodeTest.java | 0 .../engine/internal/server/ServerServiceTest.java | 0 .../setup/DefaultJobClassNameProviderTest.java | 0 .../setup/JobClassNameProviderFactoryTest.java | 0 .../engine/internal/setup/SetUpFacadeTest.java | 0 .../internal/sharding/ExecutionContextServiceTest.java | 0 .../engine/internal/sharding/ExecutionServiceTest.java | 0 .../sharding/MonitorExecutionListenerManagerTest.java | 0 .../internal/sharding/ShardingListenerManagerTest.java | 0 .../engine/internal/sharding/ShardingNodeTest.java | 0 .../engine/internal/sharding/ShardingServiceTest.java | 0 .../internal/snapshot/BaseSnapshotServiceTest.java | 0 .../internal/snapshot/SnapshotServiceDisableTest.java | 0 .../internal/snapshot/SnapshotServiceEnableTest.java | 0 .../engine/internal/snapshot/SocketUtils.java | 0 .../engine/internal/storage/JobNodePathTest.java | 0 .../engine/internal/storage/JobNodeStorageTest.java | 0 .../internal/trigger/TriggerListenerManagerTest.java | 0 .../engine/internal/util/SensitiveInfoUtilsTest.java | 0 .../elasticjob/engine/util/ReflectionUtils.java | 0 ...lasticjob.executor.item.impl.ClassedJobItemExecutor | 0 ...sphere.elasticjob.infra.listener.ElasticJobListener | 0 .../core}/src/test/resources/logback-test.xml | 0 .../lifecycle}/pom.xml | 0 .../elasticjob/engine/lifecycle/api/JobAPIFactory.java | 0 .../engine/lifecycle/api/JobConfigurationAPI.java | 0 .../elasticjob/engine/lifecycle/api/JobOperateAPI.java | 0 .../engine/lifecycle/api/JobStatisticsAPI.java | 0 .../engine/lifecycle/api/ServerStatisticsAPI.java | 0 .../engine/lifecycle/api/ShardingOperateAPI.java | 0 .../engine/lifecycle/api/ShardingStatisticsAPI.java | 0 .../engine/lifecycle/domain/JobBriefInfo.java | 0 .../engine/lifecycle/domain/ServerBriefInfo.java | 0 .../engine/lifecycle/domain/ShardingInfo.java | 0 .../lifecycle/internal/operate/JobOperateAPIImpl.java | 0 .../internal/operate/ShardingOperateAPIImpl.java | 0 .../lifecycle/internal/reg/RegistryCenterFactory.java | 0 .../internal/settings/JobConfigurationAPIImpl.java | 0 .../internal/statistics/JobStatisticsAPIImpl.java | 0 .../internal/statistics/ServerStatisticsAPIImpl.java | 0 .../internal/statistics/ShardingStatisticsAPIImpl.java | 0 .../lifecycle/AbstractEmbedZookeeperBaseTest.java | 0 .../engine/lifecycle/api/JobAPIFactoryTest.java | 0 .../engine/lifecycle/domain/ShardingStatusTest.java | 0 .../lifecycle/fixture/LifecycleYamlConstants.java | 0 .../internal/operate/JobOperateAPIImplTest.java | 0 .../internal/operate/ShardingOperateAPIImplTest.java | 0 .../internal/reg/RegistryCenterFactoryTest.java | 0 .../internal/settings/JobConfigurationAPIImplTest.java | 0 .../internal/statistics/JobStatisticsAPIImplTest.java | 0 .../statistics/ServerStatisticsAPIImplTest.java | 0 .../statistics/ShardingStatisticsAPIImplTest.java | 0 .../lifecycle}/src/test/resources/logback-test.xml | 0 {elasticjob-engine => engine}/pom.xml | 6 +++--- .../spring/boot-starter}/README.md | 0 .../spring/boot-starter}/pom.xml | 0 .../boot/job/ElasticJobBootstrapConfiguration.java | 0 .../boot/job/ElasticJobConfigurationProperties.java | 0 .../boot/job/ElasticJobLiteAutoConfiguration.java | 0 .../engine/spring/boot/job/ElasticJobProperties.java | 0 .../boot/job/ScheduleJobBootstrapStartupRunner.java | 0 .../reg/ElasticJobRegistryCenterConfiguration.java | 0 .../engine/spring/boot/reg/ZookeeperProperties.java | 0 .../ElasticJobSnapshotServiceConfiguration.java | 0 .../boot/reg/snapshot/SnapshotServiceProperties.java | 0 .../boot/tracing/ElasticJobTracingConfiguration.java | 0 .../engine/spring/boot/tracing/TracingProperties.java | 0 .../additional-spring-configuration-metadata.json | 0 .../src/main/resources/META-INF/spring.factories | 0 .../src/main/resources/META-INF/spring.provides | 0 ...mework.boot.autoconfigure.AutoConfiguration.imports | 0 .../job/ElasticJobConfigurationPropertiesTest.java | 0 .../boot/job/ElasticJobSpringBootScannerTest.java | 0 .../spring/boot/job/ElasticJobSpringBootTest.java | 0 .../boot/job/executor/CustomClassedJobExecutor.java | 0 .../spring/boot/job/executor/PrintJobExecutor.java | 0 .../spring/boot/job/executor/PrintJobProperties.java | 0 .../spring/boot/job/fixture/EmbedTestingServer.java | 0 .../engine/spring/boot/job/fixture/job/CustomJob.java | 0 .../boot/job/fixture/job/impl/AnnotationCustomJob.java | 0 .../boot/job/fixture/job/impl/CustomTestJob.java | 0 .../job/fixture/listener/LogElasticJobListener.java | 0 .../job/fixture/listener/NoopElasticJobListener.java | 0 .../spring/boot/job/repository/BarRepository.java | 0 .../boot/job/repository/impl/BarRepositoryImpl.java | 0 .../spring/boot/reg/ZookeeperPropertiesTest.java | 0 .../ElasticJobSnapshotServiceConfigurationTest.java | 0 .../spring/boot/tracing/TracingConfigurationTest.java | 0 ...lasticjob.executor.item.impl.ClassedJobItemExecutor | 0 ....elasticjob.executor.item.impl.TypedJobItemExecutor | 0 ...sphere.elasticjob.infra.listener.ElasticJobListener | 0 .../src/test/resources/application-elasticjob.yml | 0 .../src/test/resources/application-snapshot.yml | 0 .../src/test/resources/application-tracing.yml | 0 .../boot-starter}/src/test/resources/logback-test.xml | 0 .../spring/core}/pom.xml | 0 .../spring/core/scanner/ClassPathJobScanner.java | 0 .../engine/spring/core/scanner/ElasticJobScan.java | 0 .../spring/core/scanner/ElasticJobScanRegistrar.java | 0 .../spring/core/scanner/JobScannerConfiguration.java | 0 .../core/setup/SpringProxyJobClassNameProvider.java | 0 .../engine/spring/core/util/AopTargetUtils.java | 0 ...asticjob.engine.internal.setup.JobClassNameProvider | 0 .../core/setup/JobClassNameProviderFactoryTest.java | 0 .../engine/spring/core/util/AopTargetUtilsTest.java | 0 .../elasticjob/engine/spring/core/util/TargetJob.java | 0 .../core}/src/test/resources/META-INF/logback-test.xml | 0 .../spring/namespace}/pom.xml | 0 .../spring/namespace/ElasticJobNamespaceHandler.java | 0 .../namespace/job/parser/JobBeanDefinitionParser.java | 0 .../spring/namespace/job/tag/JobBeanDefinitionTag.java | 0 .../reg/parser/ZookeeperBeanDefinitionParser.java | 0 .../namespace/reg/tag/ZookeeperBeanDefinitionTag.java | 0 .../scanner/parser/JobScannerBeanDefinitionParser.java | 0 .../scanner/tag/JobScannerBeanDefinitionTag.java | 0 .../snapshot/parser/SnapshotBeanDefinitionParser.java | 0 .../snapshot/tag/SnapshotBeanDefinitionTag.java | 0 .../tracing/parser/TracingBeanDefinitionParser.java | 0 .../tracing/tag/TracingBeanDefinitionTag.java | 0 .../main/resources/META-INF/namespace/elasticjob.xsd | 0 .../src/main/resources/META-INF/spring.handlers | 0 .../src/main/resources/META-INF/spring.schemas | 0 .../spring/namespace/fixture/aspect/SimpleAspect.java | 0 .../namespace/fixture/job/DataflowElasticJob.java | 0 .../namespace/fixture/job/FooSimpleElasticJob.java | 0 .../fixture/job/annotation/AnnotationSimpleJob.java | 0 .../fixture/job/ref/RefFooDataflowElasticJob.java | 0 .../fixture/job/ref/RefFooSimpleElasticJob.java | 0 .../fixture/listener/SimpleCglibListener.java | 0 .../listener/SimpleJdkDynamicProxyListener.java | 0 .../namespace/fixture/listener/SimpleListener.java | 0 .../namespace/fixture/listener/SimpleOnceListener.java | 0 .../spring/namespace/fixture/service/FooService.java | 0 .../namespace/fixture/service/FooServiceImpl.java | 0 .../namespace/job/AbstractJobSpringIntegrateTest.java | 0 .../job/AbstractOneOffJobSpringIntegrateTest.java | 0 .../job/JobSpringNamespaceWithEventTraceRdbTest.java | 0 .../job/JobSpringNamespaceWithJobHandlerTest.java | 0 .../JobSpringNamespaceWithListenerAndCglibTest.java | 0 ...ingNamespaceWithListenerAndJdkDynamicProxyTest.java | 0 .../job/JobSpringNamespaceWithListenerTest.java | 0 .../namespace/job/JobSpringNamespaceWithRefTest.java | 0 .../namespace/job/JobSpringNamespaceWithTypeTest.java | 0 .../job/JobSpringNamespaceWithoutListenerTest.java | 0 .../OneOffJobSpringNamespaceWithEventTraceRdbTest.java | 0 .../OneOffJobSpringNamespaceWithJobHandlerTest.java | 0 ...eOffJobSpringNamespaceWithListenerAndCglibTest.java | 0 ...ingNamespaceWithListenerAndJdkDynamicProxyTest.java | 0 .../job/OneOffJobSpringNamespaceWithListenerTest.java | 0 .../job/OneOffJobSpringNamespaceWithRefTest.java | 0 .../job/OneOffJobSpringNamespaceWithTypeTest.java | 0 .../OneOffJobSpringNamespaceWithoutListenerTest.java | 0 .../scanner/AbstractJobSpringIntegrateTest.java | 0 .../spring/namespace/scanner/JobScannerTest.java | 0 .../snapshot/SnapshotSpringNamespaceDisableTest.java | 0 .../snapshot/SnapshotSpringNamespaceEnableTest.java | 0 .../engine/spring/namespace/snapshot/SocketUtils.java | 0 ...bstractZookeeperJUnitJupiterSpringContextTests.java | 0 .../test/EmbedZookeeperTestExecutionListener.java | 0 .../src/test/resources/META-INF/job/base.xml | 0 .../resources/META-INF/job/oneOffWithEventTraceRdb.xml | 0 .../resources/META-INF/job/oneOffWithJobHandler.xml | 0 .../test/resources/META-INF/job/oneOffWithJobRef.xml | 0 .../test/resources/META-INF/job/oneOffWithJobType.xml | 0 .../test/resources/META-INF/job/oneOffWithListener.xml | 0 .../META-INF/job/oneOffWithListenerAndCglib.xml | 0 .../job/oneOffWithListenerAndJdkDynamicProxy.xml | 0 .../resources/META-INF/job/oneOffWithoutListener.xml | 0 .../test/resources/META-INF/job/withEventTraceRdb.xml | 0 .../src/test/resources/META-INF/job/withJobHandler.xml | 0 .../src/test/resources/META-INF/job/withJobRef.xml | 0 .../src/test/resources/META-INF/job/withJobType.xml | 0 .../src/test/resources/META-INF/job/withListener.xml | 0 .../resources/META-INF/job/withListenerAndCglib.xml | 0 .../META-INF/job/withListenerAndJdkDynamicProxy.xml | 0 .../test/resources/META-INF/job/withoutListener.xml | 0 .../src/test/resources/META-INF/reg/regContext.xml | 0 .../resources/META-INF/scanner/jobScannerContext.xml | 0 ...sphere.elasticjob.infra.listener.ElasticJobListener | 0 .../resources/META-INF/snapshot/snapshotDisabled.xml | 0 .../resources/META-INF/snapshot/snapshotEnabled.xml | 0 .../src/test/resources/conf/job/conf.properties | 0 .../src/test/resources/conf/reg/conf.properties | 0 .../namespace}/src/test/resources/logback-test.xml | 0 .../namespace}/src/test/resources/script/demo.bat | 0 .../namespace}/src/test/resources/script/demo.sh | 0 .../elasticjob-engine-spring => engine/spring}/pom.xml | 6 +++--- .../elasticjob-infra-common => infra/common}/pom.xml | 0 .../elasticjob/infra/concurrent/BlockUtils.java | 0 .../infra/concurrent/ElasticJobExecutorService.java | 0 .../infra/concurrent/ExecutorServiceReloadable.java | 0 .../elasticjob/infra/context/ExecutionType.java | 0 .../elasticjob/infra/context/Reloadable.java | 0 .../infra/context/ReloadablePostProcessor.java | 0 .../infra/context/ShardingItemParameters.java | 0 .../elasticjob/infra/context/TaskContext.java | 0 .../elasticjob/infra/env/HostException.java | 0 .../shardingsphere/elasticjob/infra/env/IpUtils.java | 0 .../elasticjob/infra/env/TimeService.java | 0 .../elasticjob/infra/exception/ExceptionUtils.java | 0 .../infra/exception/JobConfigurationException.java | 0 .../exception/JobExecutionEnvironmentException.java | 0 .../infra/exception/JobExecutionException.java | 0 .../infra/exception/JobStatisticException.java | 0 .../elasticjob/infra/exception/JobSystemException.java | 0 .../elasticjob/infra/handler/sharding/JobInstance.java | 0 .../infra/handler/sharding/JobShardingStrategy.java | 0 .../handler/sharding/JobShardingStrategyFactory.java | 0 .../impl/AverageAllocationJobShardingStrategy.java | 0 .../impl/OdevitySortByNameJobShardingStrategy.java | 0 .../impl/RoundRobinByNameJobShardingStrategy.java | 0 .../handler/threadpool/JobExecutorServiceHandler.java | 0 .../threadpool/JobExecutorServiceHandlerFactory.java | 0 .../impl/AbstractJobExecutorServiceHandler.java | 0 .../impl/CPUUsageJobExecutorServiceHandler.java | 0 .../impl/SingleThreadJobExecutorServiceHandler.java | 0 .../elasticjob/infra/json/GsonFactory.java | 0 .../elasticjob/infra/listener/ElasticJobListener.java | 0 .../infra/listener/ElasticJobListenerFactory.java | 0 .../elasticjob/infra/listener/ShardingContexts.java | 0 .../elasticjob/infra/pojo/JobConfigurationPOJO.java | 0 .../elasticjob/infra/spi/ElasticJobServiceLoader.java | 0 .../elasticjob/infra/spi/SPIPostProcessor.java | 0 .../shardingsphere/elasticjob/infra/spi/TypedSPI.java | 0 .../exception/ServiceLoaderInstantiationException.java | 0 .../infra/validator/JobPropertiesValidateRule.java | 0 .../infra/validator/JobPropertiesValidator.java | 0 .../elasticjob/infra/yaml/YamlEngine.java | 0 .../infra/yaml/config/YamlConfiguration.java | 0 .../infra/yaml/config/YamlConfigurationConverter.java | 0 .../yaml/config/YamlConfigurationConverterFactory.java | 0 .../YamlConfigurationConverterNotFoundException.java | 0 .../yaml/representer/DefaultYamlTupleProcessor.java | 0 .../yaml/representer/ElasticJobYamlRepresenter.java | 0 ....shardingsphere.elasticjob.infra.context.Reloadable | 0 ...asticjob.infra.handler.sharding.JobShardingStrategy | 0 ....infra.handler.threadpool.JobExecutorServiceHandler | 0 .../concurrent/ElasticJobExecutorServiceTest.java | 0 .../concurrent/ExecutorServiceReloadableTest.java | 0 .../infra/context/ShardingItemParametersTest.java | 0 .../elasticjob/infra/context/TaskContextTest.java | 0 .../elasticjob/infra/context/fixture/TaskNode.java | 0 .../elasticjob/infra/env/HostExceptionTest.java | 0 .../elasticjob/infra/env/IpUtilsTest.java | 0 .../elasticjob/infra/env/TimeServiceTest.java | 0 .../elasticjob/infra/exception/ExceptionUtilsTest.java | 0 .../infra/exception/JobConfigurationExceptionTest.java | 0 .../JobExecutionEnvironmentExceptionTest.java | 0 .../infra/exception/JobStatisticExceptionTest.java | 0 .../infra/exception/JobSystemExceptionTest.java | 0 .../infra/handler/sharding/JobInstanceTest.java | 0 .../sharding/JobShardingStrategyFactoryTest.java | 0 .../impl/AverageAllocationJobShardingStrategyTest.java | 0 .../impl/OdevitySortByNameJobShardingStrategyTest.java | 0 .../RotateServerByNameJobShardingStrategyTest.java | 0 .../JobExecutorServiceHandlerFactoryTest.java | 0 .../impl/CPUUsageJobExecutorServiceHandlerTest.java | 0 .../SingleThreadJobExecutorServiceHandlerTest.java | 0 .../elasticjob/infra/json/GsonFactoryTest.java | 0 .../infra/listener/ElasticJobListenerFactoryTest.java | 0 .../infra/listener/ShardingContextsTest.java | 0 .../infra/listener/fixture/FooElasticJobListener.java | 0 .../infra/pojo/JobConfigurationPOJOTest.java | 0 .../infra/spi/ElasticJobServiceLoaderTest.java | 0 .../elasticjob/infra/spi/fixture/TypedFooService.java | 0 .../infra/spi/fixture/UnRegisteredTypedFooService.java | 0 .../infra/spi/fixture/impl/TypedFooServiceImpl.java | 0 .../fixture/impl/UnRegisteredTypedFooServiceImpl.java | 0 .../infra/validator/JobPropertiesValidateRuleTest.java | 0 .../elasticjob/infra/yaml/YamlEngineTest.java | 0 .../config/YamlConfigurationConverterFactoryTest.java | 0 .../infra/yaml/fixture/FooYamlConfiguration.java | 0 ...sphere.elasticjob.infra.listener.ElasticJobListener | 0 ...sphere.elasticjob.infra.spi.fixture.TypedFooService | 0 ...icjob.infra.spi.fixture.UnRegisteredTypedFooService | 0 .../common}/src/test/resources/logback-test.xml | 0 {elasticjob-infra => infra}/pom.xml | 6 +++--- .../registry-center/api}/pom.xml | 0 .../elasticjob/reg/base/CoordinatorRegistryCenter.java | 0 .../elasticjob/reg/base/ElectionCandidate.java | 0 .../elasticjob/reg/base/LeaderExecutionCallback.java | 0 .../elasticjob/reg/base/RegistryCenter.java | 0 .../reg/base/transaction/TransactionOperation.java | 0 .../reg/exception/IgnoredExceptionProvider.java | 0 .../elasticjob/reg/exception/RegException.java | 0 .../elasticjob/reg/exception/RegExceptionHandler.java | 0 .../listener/ConnectionStateChangedEventListener.java | 0 .../elasticjob/reg/listener/DataChangedEvent.java | 0 .../reg/listener/DataChangedEventListener.java | 0 .../reg/base/transaction/TransactionOperationTest.java | 0 .../reg/exception/RegExceptionHandlerTest.java | 0 .../registry-center}/pom.xml | 4 ++-- .../registry-center/provider}/pom.xml | 2 +- .../provider/zookeeper-curator}/pom.xml | 0 .../reg/zookeeper/ZookeeperConfiguration.java | 0 .../reg/zookeeper/ZookeeperElectionService.java | 0 .../reg/zookeeper/ZookeeperRegistryCenter.java | 0 .../ZookeeperCuratorIgnoredExceptionProvider.java | 0 ...e.elasticjob.reg.exception.IgnoredExceptionProvider | 0 .../reg/zookeeper/ZookeeperConfigurationTest.java | 0 .../reg/zookeeper/ZookeeperElectionServiceTest.java | 0 .../ZookeeperRegistryCenterExecuteInLeaderTest.java | 0 .../zookeeper/ZookeeperRegistryCenterForAuthTest.java | 0 .../ZookeeperRegistryCenterInitFailureTest.java | 0 .../zookeeper/ZookeeperRegistryCenterListenerTest.java | 0 .../ZookeeperRegistryCenterMiscellaneousTest.java | 0 .../zookeeper/ZookeeperRegistryCenterModifyTest.java | 0 .../ZookeeperRegistryCenterQueryWithCacheTest.java | 0 .../ZookeeperRegistryCenterQueryWithoutCacheTest.java | 0 .../ZookeeperRegistryCenterTransactionTest.java | 0 .../zookeeper/ZookeeperRegistryCenterWatchTest.java | 0 .../ZookeeperCuratorIgnoredExceptionProviderTest.java | 0 .../reg/zookeeper/fixture/EmbedTestingServer.java | 0 .../util/ZookeeperRegistryCenterTestUtil.java | 0 .../src/test/resources/conf/reg/local.properties | 0 .../test/resources/conf/reg/local_overwrite.properties | 0 .../src/test/resources/logback-test.xml | 0 .../elasticjob-restful => infra/restful}/README.md | 0 .../elasticjob-restful => infra/restful}/pom.xml | 0 .../shardingsphere/elasticjob/restful/Filter.java | 0 .../apache/shardingsphere/elasticjob/restful/Http.java | 0 .../elasticjob/restful/NettyRestfulService.java | 0 .../restful/NettyRestfulServiceConfiguration.java | 0 .../elasticjob/restful/RestfulController.java | 0 .../elasticjob/restful/RestfulService.java | 0 .../elasticjob/restful/annotation/ContextPath.java | 0 .../elasticjob/restful/annotation/Mapping.java | 0 .../elasticjob/restful/annotation/Param.java | 0 .../elasticjob/restful/annotation/ParamSource.java | 0 .../elasticjob/restful/annotation/RequestBody.java | 0 .../elasticjob/restful/annotation/Returning.java | 0 .../restful/deserializer/RequestBodyDeserializer.java | 0 .../deserializer/RequestBodyDeserializerFactory.java | 0 .../RequestBodyDeserializerNotFoundException.java | 0 .../deserializer/factory/DeserializerFactory.java | 0 .../DefaultJsonRequestBodyDeserializerFactory.java | 0 ...DefaultTextPlainRequestBodyDeserializerFactory.java | 0 .../impl/DefaultJsonRequestBodyDeserializer.java | 0 .../impl/DefaultTextPlainRequestBodyDeserializer.java | 0 .../elasticjob/restful/filter/DefaultFilterChain.java | 0 .../elasticjob/restful/filter/FilterChain.java | 0 .../restful/handler/ExceptionHandleResult.java | 0 .../elasticjob/restful/handler/ExceptionHandler.java | 0 .../elasticjob/restful/handler/HandleContext.java | 0 .../elasticjob/restful/handler/Handler.java | 0 .../restful/handler/HandlerMappingRegistry.java | 0 .../restful/handler/HandlerNotFoundException.java | 0 .../elasticjob/restful/handler/HandlerParameter.java | 0 .../restful/handler/impl/DefaultExceptionHandler.java | 0 .../impl/DefaultHandlerNotFoundExceptionHandler.java | 0 .../restful/mapping/AmbiguousPathPatternException.java | 0 .../restful/mapping/DefaultMappingContext.java | 0 .../elasticjob/restful/mapping/MappingContext.java | 0 .../elasticjob/restful/mapping/PathMatcher.java | 0 .../elasticjob/restful/mapping/RegexPathMatcher.java | 0 .../elasticjob/restful/mapping/RegexUrlPatternMap.java | 0 .../elasticjob/restful/mapping/UrlPatternMap.java | 0 .../pipeline/ContextInitializationInboundHandler.java | 0 .../elasticjob/restful/pipeline/ExceptionHandling.java | 0 .../restful/pipeline/FilterChainInboundHandler.java | 0 .../restful/pipeline/HandleMethodExecutor.java | 0 .../restful/pipeline/HandlerParameterDecoder.java | 0 .../restful/pipeline/HttpRequestDispatcher.java | 0 .../pipeline/RestfulServiceChannelInitializer.java | 0 .../restful/serializer/ResponseBodySerializer.java | 0 .../serializer/ResponseBodySerializerFactory.java | 0 .../ResponseBodySerializerNotFoundException.java | 0 .../restful/serializer/factory/SerializerFactory.java | 0 .../impl/DefaultJsonResponseBodySerializerFactory.java | 0 .../impl/DefaultJsonResponseBodySerializer.java | 0 .../elasticjob/restful/wrapper/QueryParameterMap.java | 0 ...ob.restful.deserializer.factory.DeserializerFactory | 0 ...ticjob.restful.serializer.factory.SerializerFactory | 0 .../elasticjob/restful/RegexPathMatcherTest.java | 0 .../elasticjob/restful/RegexUrlPatternMapTest.java | 0 .../elasticjob/restful/controller/IndexController.java | 0 .../elasticjob/restful/controller/JobController.java | 0 .../controller/TrailingSlashTestController.java | 0 .../RequestBodyDeserializerFactoryTest.java | 0 .../restful/filter/DefaultFilterChainTest.java | 0 .../handler/CustomIllegalStateExceptionHandler.java | 0 .../pipeline/FilterChainInboundHandlerTest.java | 0 .../restful/pipeline/HandlerParameterDecoderTest.java | 0 .../elasticjob/restful/pipeline/HttpClient.java | 0 .../restful/pipeline/HttpRequestDispatcherTest.java | 0 .../restful/pipeline/NettyRestfulServiceTest.java | 0 ...ettyRestfulServiceTrailingSlashInsensitiveTest.java | 0 .../NettyRestfulServiceTrailingSlashSensitiveTest.java | 0 .../elasticjob/restful/pojo/JobPojo.java | 0 .../elasticjob/restful/pojo/ResultDto.java | 0 .../CustomTextPlainResponseBodySerializer.java | 0 .../serializer/ResponseBodySerializerFactoryTest.java | 0 .../restful/wrapper/QueryParameterMapTest.java | 0 ...lasticjob.restful.serializer.ResponseBodySerializer | 0 pom.xml | 10 +++++----- 690 files changed, 36 insertions(+), 36 deletions(-) rename {elasticjob-api => api}/pom.xml (100%) rename {elasticjob-api => api}/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java (100%) rename {elasticjob-api => api}/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java (100%) rename {elasticjob-api => api}/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java (100%) rename {elasticjob-api => api}/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java (100%) rename {elasticjob-api => api}/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java (100%) rename {elasticjob-api => api}/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java (100%) rename {elasticjob-api => api}/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java (100%) rename {elasticjob-api => api}/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java (100%) rename {elasticjob-api => api}/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java (100%) rename {elasticjob-api => api}/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java (100%) rename {elasticjob-api => api}/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java (100%) rename {elasticjob-api => api}/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java (100%) rename {elasticjob-distribution/elasticjob-bin-distribution => distribution/bin}/pom.xml (100%) rename {elasticjob-distribution/elasticjob-bin-distribution => distribution/bin}/src/main/assembly/elasticjob-binary-distribution.xml (100%) rename {elasticjob-distribution/elasticjob-bin-distribution => distribution/bin}/src/main/release-docs/README.txt (100%) rename {elasticjob-distribution => distribution}/pom.xml (93%) rename {elasticjob-distribution/elasticjob-src-distribution => distribution/src}/pom.xml (100%) rename {elasticjob-distribution/elasticjob-src-distribution => distribution/src}/src/main/assembly/source-distribution.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler => ecosystem/error-handler}/pom.xml (92%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi => ecosystem/error-handler/spi}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi => ecosystem/error-handler/spi}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi => ecosystem/error-handler/spi}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk => ecosystem/error-handler/type/dingtalk}/src/test/resources/logback-test.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email => ecosystem/error-handler/type/email}/src/test/resources/logback-test.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general => ecosystem/error-handler/type/general}/src/test/resources/logback-test.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type => ecosystem/error-handler/type}/pom.xml (86%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (100%) rename {elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat => ecosystem/error-handler/type/wechat}/src/test/resources/logback-test.xml (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel => ecosystem/executor/kernel}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor (100%) rename {elasticjob-ecosystem/elasticjob-executor => ecosystem/executor}/pom.xml (93%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor => ecosystem/executor/type/dataflow}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor => ecosystem/executor/type/dataflow}/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor => ecosystem/executor/type/dataflow}/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor => ecosystem/executor/type/dataflow}/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor => ecosystem/executor/type/dataflow}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor => ecosystem/executor/type/dataflow}/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor => ecosystem/executor/type/http}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor => ecosystem/executor/type/http}/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor => ecosystem/executor/type/http}/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor => ecosystem/executor/type/http}/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor => ecosystem/executor/type/http}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor => ecosystem/executor/type/http}/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor => ecosystem/executor/type/http}/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type => ecosystem/executor/type}/pom.xml (87%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor => ecosystem/executor/type/script}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor => ecosystem/executor/type/script}/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor => ecosystem/executor/type/script}/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor => ecosystem/executor/type/script}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor => ecosystem/executor/type/script}/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor => ecosystem/executor/type/simple}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor => ecosystem/executor/type/simple}/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor => ecosystem/executor/type/simple}/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor => ecosystem/executor/type/simple}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor => ecosystem/executor/type/simple}/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java (100%) rename {elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor => ecosystem/executor/type/simple}/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java (100%) rename {elasticjob-ecosystem => ecosystem}/pom.xml (91%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api => ecosystem/tracing/api}/src/test/resources/logback-test.xml (100%) rename {elasticjob-ecosystem/elasticjob-tracing => ecosystem/tracing}/pom.xml (93%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/pom.xml (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultDatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/sql/DB2.properties (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/sql/H2.properties (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/sql/MySQL.properties (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/sql/Oracle.properties (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/sql/PostgreSQL.properties (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/sql/SQL92.properties (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/main/resources/META-INF/sql/SQLServer.properties (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java (100%) rename {elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb => ecosystem/tracing/rdb}/src/test/resources/logback-test.xml (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/pom.xml (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {elasticjob-engine/elasticjob-engine-core => engine/core}/src/test/resources/logback-test.xml (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/pom.xml (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java (100%) rename {elasticjob-engine/elasticjob-engine-lifecycle => engine/lifecycle}/src/test/resources/logback-test.xml (100%) rename {elasticjob-engine => engine}/pom.xml (90%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/README.md (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/pom.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/resources/META-INF/additional-spring-configuration-metadata.json (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/resources/META-INF/spring.factories (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/resources/META-INF/spring.provides (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/resources/application-elasticjob.yml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/resources/application-snapshot.yml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/resources/application-tracing.yml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter => engine/spring/boot-starter}/src/test/resources/logback-test.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/pom.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core => engine/spring/core}/src/test/resources/META-INF/logback-test.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/pom.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/resources/META-INF/namespace/elasticjob.xsd (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/resources/META-INF/spring.handlers (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/main/resources/META-INF/spring.schemas (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/base.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithJobHandler.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithJobRef.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithJobType.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithListener.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/oneOffWithoutListener.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withEventTraceRdb.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withJobHandler.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withJobRef.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withJobType.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withListener.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withListenerAndCglib.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/job/withoutListener.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/reg/regContext.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/scanner/jobScannerContext.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/snapshot/snapshotDisabled.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/META-INF/snapshot/snapshotEnabled.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/conf/job/conf.properties (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/conf/reg/conf.properties (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/logback-test.xml (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/script/demo.bat (100%) rename {elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace => engine/spring/namespace}/src/test/resources/script/demo.sh (100%) rename {elasticjob-engine/elasticjob-engine-spring => engine/spring}/pom.xml (94%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/pom.xml (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService (100%) rename {elasticjob-infra/elasticjob-infra-common => infra/common}/src/test/resources/logback-test.xml (100%) rename {elasticjob-infra => infra}/pom.xml (90%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/pom.xml (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api => infra/registry-center/api}/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center => infra/registry-center}/pom.xml (92%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider => infra/registry-center/provider}/pom.xml (95%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/pom.xml (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/resources/conf/reg/local.properties (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/resources/conf/reg/local_overwrite.properties (100%) rename {elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator => infra/registry-center/provider/zookeeper-curator}/src/test/resources/logback-test.xml (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/README.md (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/pom.xml (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java (100%) rename {elasticjob-infra/elasticjob-restful => infra/restful}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer (100%) diff --git a/elasticjob-api/pom.xml b/api/pom.xml similarity index 100% rename from elasticjob-api/pom.xml rename to api/pom.xml diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java similarity index 100% rename from elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java similarity index 100% rename from elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobProp.java diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java similarity index 100% rename from elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/api/ElasticJob.java diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java similarity index 100% rename from elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java similarity index 100% rename from elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfiguration.java diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java similarity index 100% rename from elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobExtraConfigurationFactory.java diff --git a/elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java similarity index 100% rename from elasticjob-api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java similarity index 100% rename from elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java rename to api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfigurationTest.java diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java similarity index 100% rename from elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java rename to api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/SimpleTracingConfigurationFactory.java diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java similarity index 100% rename from elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java rename to api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java similarity index 100% rename from elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java rename to api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java diff --git a/elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java similarity index 100% rename from elasticjob-api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java rename to api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java diff --git a/elasticjob-distribution/elasticjob-bin-distribution/pom.xml b/distribution/bin/pom.xml similarity index 100% rename from elasticjob-distribution/elasticjob-bin-distribution/pom.xml rename to distribution/bin/pom.xml diff --git a/elasticjob-distribution/elasticjob-bin-distribution/src/main/assembly/elasticjob-binary-distribution.xml b/distribution/bin/src/main/assembly/elasticjob-binary-distribution.xml similarity index 100% rename from elasticjob-distribution/elasticjob-bin-distribution/src/main/assembly/elasticjob-binary-distribution.xml rename to distribution/bin/src/main/assembly/elasticjob-binary-distribution.xml diff --git a/elasticjob-distribution/elasticjob-bin-distribution/src/main/release-docs/README.txt b/distribution/bin/src/main/release-docs/README.txt similarity index 100% rename from elasticjob-distribution/elasticjob-bin-distribution/src/main/release-docs/README.txt rename to distribution/bin/src/main/release-docs/README.txt diff --git a/elasticjob-distribution/pom.xml b/distribution/pom.xml similarity index 93% rename from elasticjob-distribution/pom.xml rename to distribution/pom.xml index ea0183ef0f..33159f8a74 100644 --- a/elasticjob-distribution/pom.xml +++ b/distribution/pom.xml @@ -28,8 +28,8 @@ ${project.artifactId} - elasticjob-src-distribution - elasticjob-bin-distribution + src + bin diff --git a/elasticjob-distribution/elasticjob-src-distribution/pom.xml b/distribution/src/pom.xml similarity index 100% rename from elasticjob-distribution/elasticjob-src-distribution/pom.xml rename to distribution/src/pom.xml diff --git a/elasticjob-distribution/elasticjob-src-distribution/src/main/assembly/source-distribution.xml b/distribution/src/src/main/assembly/source-distribution.xml similarity index 100% rename from elasticjob-distribution/elasticjob-src-distribution/src/main/assembly/source-distribution.xml rename to distribution/src/src/main/assembly/source-distribution.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml b/ecosystem/error-handler/pom.xml similarity index 92% rename from elasticjob-ecosystem/elasticjob-error-handler/pom.xml rename to ecosystem/error-handler/pom.xml index e2a1ad3324..a4d7425eb9 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/pom.xml +++ b/ecosystem/error-handler/pom.xml @@ -27,7 +27,7 @@ pom - elasticjob-error-handler-spi - elasticjob-error-handler-type + spi + type diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml b/ecosystem/error-handler/spi/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/pom.xml rename to ecosystem/error-handler/spi/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java b/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java rename to ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java rename to ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml b/ecosystem/error-handler/type/dingtalk/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/pom.xml rename to ecosystem/error-handler/type/dingtalk/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java rename to ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java rename to ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java rename to ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java rename to ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java rename to ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java rename to ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-dingtalk/src/test/resources/logback-test.xml rename to ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml b/ecosystem/error-handler/type/email/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/pom.xml rename to ecosystem/error-handler/type/email/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java rename to ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java rename to ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java rename to ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java rename to ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java rename to ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/email/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/test/resources/logback-test.xml rename to ecosystem/error-handler/type/email/src/test/resources/logback-test.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml b/ecosystem/error-handler/type/general/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/pom.xml rename to ecosystem/error-handler/type/general/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java rename to ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java rename to ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java rename to ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java rename to ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java rename to ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable b/ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable rename to ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java rename to ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java rename to ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java rename to ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java rename to ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java rename to ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-general/src/test/resources/logback-test.xml rename to ecosystem/error-handler/type/general/src/test/resources/logback-test.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml b/ecosystem/error-handler/type/pom.xml similarity index 86% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml rename to ecosystem/error-handler/type/pom.xml index 0fb1b6c4dd..c4147c1488 100644 --- a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/pom.xml +++ b/ecosystem/error-handler/type/pom.xml @@ -27,9 +27,9 @@ pom - elasticjob-error-handler-general - elasticjob-error-handler-email - elasticjob-error-handler-wechat - elasticjob-error-handler-dingtalk + general + email + wechat + dingtalk diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml b/ecosystem/error-handler/type/wechat/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/pom.xml rename to ecosystem/error-handler/type/wechat/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java rename to ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java rename to ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java rename to ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java rename to ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java rename to ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java rename to ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler diff --git a/elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-wechat/src/test/resources/logback-test.xml rename to ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml b/ecosystem/executor/kernel/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/pom.xml rename to ecosystem/executor/kernel/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor diff --git a/elasticjob-ecosystem/elasticjob-executor/pom.xml b/ecosystem/executor/pom.xml similarity index 93% rename from elasticjob-ecosystem/elasticjob-executor/pom.xml rename to ecosystem/executor/pom.xml index e6a014877e..b0558251d3 100644 --- a/elasticjob-ecosystem/elasticjob-executor/pom.xml +++ b/ecosystem/executor/pom.xml @@ -28,7 +28,7 @@ ${project.artifactId} - elasticjob-executor-kernel - elasticjob-executor-type + kernel + type diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml b/ecosystem/executor/type/dataflow/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/pom.xml rename to ecosystem/executor/type/dataflow/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java b/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java rename to ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java b/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java rename to ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java b/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java rename to ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-dataflow-executor/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java rename to ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml b/ecosystem/executor/type/http/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/pom.xml rename to ecosystem/executor/type/http/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java b/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java rename to ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java b/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java rename to ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java b/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java rename to ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java rename to ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java b/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-http-executor/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java rename to ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml b/ecosystem/executor/type/pom.xml similarity index 87% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml rename to ecosystem/executor/type/pom.xml index 7ba4b49302..66f974728e 100644 --- a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/pom.xml +++ b/ecosystem/executor/type/pom.xml @@ -28,9 +28,9 @@ ${project.artifactId} - elasticjob-simple-executor - elasticjob-dataflow-executor - elasticjob-script-executor - elasticjob-http-executor + simple + dataflow + script + http diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml b/ecosystem/executor/type/script/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/pom.xml rename to ecosystem/executor/type/script/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java rename to ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java b/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java rename to ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-script-executor/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java rename to ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml b/ecosystem/executor/type/simple/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/pom.xml rename to ecosystem/executor/type/simple/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java b/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java rename to ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java b/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java rename to ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java rename to ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java diff --git a/elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java b/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-executor/elasticjob-executor-type/elasticjob-simple-executor/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java rename to ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java diff --git a/elasticjob-ecosystem/pom.xml b/ecosystem/pom.xml similarity index 91% rename from elasticjob-ecosystem/pom.xml rename to ecosystem/pom.xml index 8f9e1bfe73..a8dca47096 100644 --- a/elasticjob-ecosystem/pom.xml +++ b/ecosystem/pom.xml @@ -28,8 +28,8 @@ ${project.artifactId} - elasticjob-executor - elasticjob-error-handler - elasticjob-tracing + executor + error-handler + tracing diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml b/ecosystem/tracing/api/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/pom.xml rename to ecosystem/tracing/api/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java rename to ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter b/ecosystem/tracing/api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter rename to ecosystem/tracing/api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java rename to ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter b/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter rename to ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration b/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration rename to ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter b/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter rename to ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml b/ecosystem/tracing/api/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml rename to ecosystem/tracing/api/src/test/resources/logback-test.xml diff --git a/elasticjob-ecosystem/elasticjob-tracing/pom.xml b/ecosystem/tracing/pom.xml similarity index 93% rename from elasticjob-ecosystem/elasticjob-tracing/pom.xml rename to ecosystem/tracing/pom.xml index cb3660a4e5..c158d86e54 100644 --- a/elasticjob-ecosystem/elasticjob-tracing/pom.xml +++ b/ecosystem/tracing/pom.xml @@ -28,7 +28,7 @@ ${project.artifactId} - elasticjob-tracing-api - elasticjob-tracing-rdb + api + rdb diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml b/ecosystem/tracing/rdb/pom.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml rename to ecosystem/tracing/rdb/pom.xml diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultDatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultDatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/DB2.properties b/ecosystem/tracing/rdb/src/main/resources/META-INF/sql/DB2.properties similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/DB2.properties rename to ecosystem/tracing/rdb/src/main/resources/META-INF/sql/DB2.properties diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/H2.properties b/ecosystem/tracing/rdb/src/main/resources/META-INF/sql/H2.properties similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/H2.properties rename to ecosystem/tracing/rdb/src/main/resources/META-INF/sql/H2.properties diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/MySQL.properties b/ecosystem/tracing/rdb/src/main/resources/META-INF/sql/MySQL.properties similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/MySQL.properties rename to ecosystem/tracing/rdb/src/main/resources/META-INF/sql/MySQL.properties diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/Oracle.properties b/ecosystem/tracing/rdb/src/main/resources/META-INF/sql/Oracle.properties similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/Oracle.properties rename to ecosystem/tracing/rdb/src/main/resources/META-INF/sql/Oracle.properties diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/PostgreSQL.properties b/ecosystem/tracing/rdb/src/main/resources/META-INF/sql/PostgreSQL.properties similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/PostgreSQL.properties rename to ecosystem/tracing/rdb/src/main/resources/META-INF/sql/PostgreSQL.properties diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQL92.properties b/ecosystem/tracing/rdb/src/main/resources/META-INF/sql/SQL92.properties similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQL92.properties rename to ecosystem/tracing/rdb/src/main/resources/META-INF/sql/SQL92.properties diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQLServer.properties b/ecosystem/tracing/rdb/src/main/resources/META-INF/sql/SQLServer.properties similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/SQLServer.properties rename to ecosystem/tracing/rdb/src/main/resources/META-INF/sql/SQLServer.properties diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java diff --git a/elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-ecosystem/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml rename to ecosystem/tracing/rdb/src/test/resources/logback-test.xml diff --git a/elasticjob-engine/elasticjob-engine-core/pom.xml b/engine/core/pom.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/pom.xml rename to engine/core/pom.xml diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java b/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java rename to engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java b/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java rename to engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/elasticjob-engine/elasticjob-engine-core/src/test/resources/logback-test.xml b/engine/core/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-core/src/test/resources/logback-test.xml rename to engine/core/src/test/resources/logback-test.xml diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/pom.xml b/engine/lifecycle/pom.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/pom.xml rename to engine/lifecycle/pom.xml diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java rename to engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java rename to engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java diff --git a/elasticjob-engine/elasticjob-engine-lifecycle/src/test/resources/logback-test.xml b/engine/lifecycle/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-lifecycle/src/test/resources/logback-test.xml rename to engine/lifecycle/src/test/resources/logback-test.xml diff --git a/elasticjob-engine/pom.xml b/engine/pom.xml similarity index 90% rename from elasticjob-engine/pom.xml rename to engine/pom.xml index 02df86a012..c956915b76 100644 --- a/elasticjob-engine/pom.xml +++ b/engine/pom.xml @@ -28,8 +28,8 @@ ${project.artifactId} - elasticjob-engine-core - elasticjob-engine-spring - elasticjob-engine-lifecycle + core + spring + lifecycle diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/README.md b/engine/spring/boot-starter/README.md similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/README.md rename to engine/spring/boot-starter/README.md diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/pom.xml b/engine/spring/boot-starter/pom.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/pom.xml rename to engine/spring/boot-starter/pom.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java b/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java rename to engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/engine/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json rename to engine/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.factories b/engine/spring/boot-starter/src/main/resources/META-INF/spring.factories similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.factories rename to engine/spring/boot-starter/src/main/resources/META-INF/spring.factories diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.provides b/engine/spring/boot-starter/src/main/resources/META-INF/spring.provides similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring.provides rename to engine/spring/boot-starter/src/main/resources/META-INF/spring.provides diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/engine/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to engine/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java b/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java rename to engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-elasticjob.yml b/engine/spring/boot-starter/src/test/resources/application-elasticjob.yml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-elasticjob.yml rename to engine/spring/boot-starter/src/test/resources/application-elasticjob.yml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-snapshot.yml b/engine/spring/boot-starter/src/test/resources/application-snapshot.yml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-snapshot.yml rename to engine/spring/boot-starter/src/test/resources/application-snapshot.yml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-tracing.yml b/engine/spring/boot-starter/src/test/resources/application-tracing.yml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/application-tracing.yml rename to engine/spring/boot-starter/src/test/resources/application-tracing.yml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/logback-test.xml b/engine/spring/boot-starter/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-boot-starter/src/test/resources/logback-test.xml rename to engine/spring/boot-starter/src/test/resources/logback-test.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/pom.xml b/engine/spring/core/pom.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/pom.xml rename to engine/spring/core/pom.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java b/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java rename to engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java b/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java rename to engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java b/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java rename to engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java b/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java rename to engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java b/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java rename to engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java b/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java rename to engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider b/engine/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider rename to engine/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java b/engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java rename to engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java b/engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java rename to engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java b/engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java rename to engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/resources/META-INF/logback-test.xml b/engine/spring/core/src/test/resources/META-INF/logback-test.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-core/src/test/resources/META-INF/logback-test.xml rename to engine/spring/core/src/test/resources/META-INF/logback-test.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/pom.xml b/engine/spring/namespace/pom.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/pom.xml rename to engine/spring/namespace/pom.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java b/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java rename to engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd b/engine/spring/namespace/src/main/resources/META-INF/namespace/elasticjob.xsd similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/namespace/elasticjob.xsd rename to engine/spring/namespace/src/main/resources/META-INF/namespace/elasticjob.xsd diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.handlers b/engine/spring/namespace/src/main/resources/META-INF/spring.handlers similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.handlers rename to engine/spring/namespace/src/main/resources/META-INF/spring.handlers diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.schemas b/engine/spring/namespace/src/main/resources/META-INF/spring.schemas similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/main/resources/META-INF/spring.schemas rename to engine/spring/namespace/src/main/resources/META-INF/spring.schemas diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java rename to engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/base.xml b/engine/spring/namespace/src/test/resources/META-INF/job/base.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/base.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/base.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListener.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml b/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobHandler.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withJobHandler.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobHandler.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withJobHandler.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobRef.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withJobRef.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobRef.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withJobRef.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobType.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withJobType.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withJobType.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withJobType.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListener.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withListener.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListener.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withListener.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withoutListener.xml b/engine/spring/namespace/src/test/resources/META-INF/job/withoutListener.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/job/withoutListener.xml rename to engine/spring/namespace/src/test/resources/META-INF/job/withoutListener.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/reg/regContext.xml b/engine/spring/namespace/src/test/resources/META-INF/reg/regContext.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/reg/regContext.xml rename to engine/spring/namespace/src/test/resources/META-INF/reg/regContext.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml b/engine/spring/namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml rename to engine/spring/namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/engine/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to engine/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml b/engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml rename to engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml b/engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml rename to engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/job/conf.properties b/engine/spring/namespace/src/test/resources/conf/job/conf.properties similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/job/conf.properties rename to engine/spring/namespace/src/test/resources/conf/job/conf.properties diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/reg/conf.properties b/engine/spring/namespace/src/test/resources/conf/reg/conf.properties similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/conf/reg/conf.properties rename to engine/spring/namespace/src/test/resources/conf/reg/conf.properties diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/logback-test.xml b/engine/spring/namespace/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/logback-test.xml rename to engine/spring/namespace/src/test/resources/logback-test.xml diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.bat b/engine/spring/namespace/src/test/resources/script/demo.bat similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.bat rename to engine/spring/namespace/src/test/resources/script/demo.bat diff --git a/elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.sh b/engine/spring/namespace/src/test/resources/script/demo.sh similarity index 100% rename from elasticjob-engine/elasticjob-engine-spring/elasticjob-engine-spring-namespace/src/test/resources/script/demo.sh rename to engine/spring/namespace/src/test/resources/script/demo.sh diff --git a/elasticjob-engine/elasticjob-engine-spring/pom.xml b/engine/spring/pom.xml similarity index 94% rename from elasticjob-engine/elasticjob-engine-spring/pom.xml rename to engine/spring/pom.xml index afcdbaa6d0..88f4e2cc6d 100644 --- a/elasticjob-engine/elasticjob-engine-spring/pom.xml +++ b/engine/spring/pom.xml @@ -28,9 +28,9 @@ ${project.artifactId} - elasticjob-engine-spring-core - elasticjob-engine-spring-boot-starter - elasticjob-engine-spring-namespace + core + boot-starter + namespace diff --git a/elasticjob-infra/elasticjob-infra-common/pom.xml b/infra/common/pom.xml similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/pom.xml rename to infra/common/pom.xml diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java b/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java rename to infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable b/infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable rename to infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy b/infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy rename to infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy diff --git a/elasticjob-infra/elasticjob-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler b/infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler rename to infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java b/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java rename to infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService b/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService rename to infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService b/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService rename to infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/resources/logback-test.xml b/infra/common/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-infra/elasticjob-infra-common/src/test/resources/logback-test.xml rename to infra/common/src/test/resources/logback-test.xml diff --git a/elasticjob-infra/pom.xml b/infra/pom.xml similarity index 90% rename from elasticjob-infra/pom.xml rename to infra/pom.xml index 0cc6395f77..94b1426be6 100644 --- a/elasticjob-infra/pom.xml +++ b/infra/pom.xml @@ -28,8 +28,8 @@ ${project.artifactId} - elasticjob-infra-common - elasticjob-registry-center - elasticjob-restful + common + registry-center + restful diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml b/infra/registry-center/api/pom.xml similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/pom.xml rename to infra/registry-center/api/pom.xml diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java b/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java rename to infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java b/infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java rename to infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java b/infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-registry-center-api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java rename to infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/infra/registry-center/pom.xml similarity index 92% rename from elasticjob-infra/elasticjob-registry-center/pom.xml rename to infra/registry-center/pom.xml index a5b3b513d5..10f70dfb0f 100644 --- a/elasticjob-infra/elasticjob-registry-center/pom.xml +++ b/infra/registry-center/pom.xml @@ -28,7 +28,7 @@ ${project.artifactId} - elasticjob-registry-center-api - elasticjob-regitry-center-provider + api + provider diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml b/infra/registry-center/provider/pom.xml similarity index 95% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml rename to infra/registry-center/provider/pom.xml index 932d59c8d2..a04be6a079 100644 --- a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/pom.xml +++ b/infra/registry-center/provider/pom.xml @@ -28,6 +28,6 @@ ${project.artifactId} - elasticjob-registry-center-zookeeper-curator + zookeeper-curator diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml b/infra/registry-center/provider/zookeeper-curator/pom.xml similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/pom.xml rename to infra/registry-center/provider/zookeeper-curator/pom.xml diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java b/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java rename to infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java b/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java rename to infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java diff --git a/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 b/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java similarity index 100% rename from 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 rename to infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java b/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java rename to infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider b/infra/registry-center/provider/zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider rename to infra/registry-center/provider/zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java b/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java rename to infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/conf/reg/local.properties b/infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local.properties similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/conf/reg/local.properties rename to infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local.properties diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties b/infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties rename to infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties diff --git a/elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/logback-test.xml b/infra/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml similarity index 100% rename from elasticjob-infra/elasticjob-registry-center/elasticjob-regitry-center-provider/elasticjob-registry-center-zookeeper-curator/src/test/resources/logback-test.xml rename to infra/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml diff --git a/elasticjob-infra/elasticjob-restful/README.md b/infra/restful/README.md similarity index 100% rename from elasticjob-infra/elasticjob-restful/README.md rename to infra/restful/README.md diff --git a/elasticjob-infra/elasticjob-restful/pom.xml b/infra/restful/pom.xml similarity index 100% rename from elasticjob-infra/elasticjob-restful/pom.xml rename to infra/restful/pom.xml diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java b/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java rename to infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java diff --git a/elasticjob-infra/elasticjob-restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory b/infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory rename to infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory diff --git a/elasticjob-infra/elasticjob-restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory b/infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory rename to infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java b/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java rename to infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java diff --git a/elasticjob-infra/elasticjob-restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer b/infra/restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer similarity index 100% rename from elasticjob-infra/elasticjob-restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer rename to infra/restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer diff --git a/pom.xml b/pom.xml index 073e3406f0..9d391c39dd 100644 --- a/pom.xml +++ b/pom.xml @@ -31,12 +31,12 @@ Distributed scheduled job - elasticjob-api - elasticjob-infra - elasticjob-engine + api + infra + engine + ecosystem - elasticjob-distribution - elasticjob-ecosystem + distribution From 6a7332247316a94a12bd898e87822058c7bd3559 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sat, 14 Oct 2023 23:44:08 +0800 Subject: [PATCH 055/178] Refactor elasticjob-infra module --- infra/pom.xml | 2 -- pom.xml | 2 ++ {infra/registry-center => registry-center}/api/pom.xml | 0 .../elasticjob/reg/base/CoordinatorRegistryCenter.java | 0 .../shardingsphere/elasticjob/reg/base/ElectionCandidate.java | 0 .../elasticjob/reg/base/LeaderExecutionCallback.java | 0 .../shardingsphere/elasticjob/reg/base/RegistryCenter.java | 0 .../elasticjob/reg/base/transaction/TransactionOperation.java | 0 .../elasticjob/reg/exception/IgnoredExceptionProvider.java | 0 .../shardingsphere/elasticjob/reg/exception/RegException.java | 0 .../elasticjob/reg/exception/RegExceptionHandler.java | 0 .../reg/listener/ConnectionStateChangedEventListener.java | 0 .../elasticjob/reg/listener/DataChangedEvent.java | 0 .../elasticjob/reg/listener/DataChangedEventListener.java | 0 .../reg/base/transaction/TransactionOperationTest.java | 0 .../elasticjob/reg/exception/RegExceptionHandlerTest.java | 0 {infra/registry-center => registry-center}/pom.xml | 2 +- {infra/registry-center => registry-center}/provider/pom.xml | 0 .../provider/zookeeper-curator/pom.xml | 0 .../elasticjob/reg/zookeeper/ZookeeperConfiguration.java | 0 .../elasticjob/reg/zookeeper/ZookeeperElectionService.java | 0 .../elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java | 0 .../exception/ZookeeperCuratorIgnoredExceptionProvider.java | 0 ...dingsphere.elasticjob.reg.exception.IgnoredExceptionProvider | 0 .../elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java | 0 .../elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java | 0 .../zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java | 0 .../reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java | 0 .../reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java | 0 .../reg/zookeeper/ZookeeperRegistryCenterListenerTest.java | 0 .../reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java | 0 .../reg/zookeeper/ZookeeperRegistryCenterModifyTest.java | 0 .../zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java | 0 .../zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java | 0 .../reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java | 0 .../reg/zookeeper/ZookeeperRegistryCenterWatchTest.java | 0 .../exception/ZookeeperCuratorIgnoredExceptionProviderTest.java | 0 .../elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java | 0 .../reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java | 0 .../src/test/resources/conf/reg/local.properties | 0 .../src/test/resources/conf/reg/local_overwrite.properties | 0 .../zookeeper-curator/src/test/resources/logback-test.xml | 0 {infra/restful => restful}/README.md | 0 {infra/restful => restful}/pom.xml | 2 +- .../org/apache/shardingsphere/elasticjob/restful/Filter.java | 0 .../java/org/apache/shardingsphere/elasticjob/restful/Http.java | 0 .../shardingsphere/elasticjob/restful/NettyRestfulService.java | 0 .../elasticjob/restful/NettyRestfulServiceConfiguration.java | 0 .../shardingsphere/elasticjob/restful/RestfulController.java | 0 .../shardingsphere/elasticjob/restful/RestfulService.java | 0 .../elasticjob/restful/annotation/ContextPath.java | 0 .../shardingsphere/elasticjob/restful/annotation/Mapping.java | 0 .../shardingsphere/elasticjob/restful/annotation/Param.java | 0 .../elasticjob/restful/annotation/ParamSource.java | 0 .../elasticjob/restful/annotation/RequestBody.java | 0 .../shardingsphere/elasticjob/restful/annotation/Returning.java | 0 .../restful/deserializer/RequestBodyDeserializer.java | 0 .../restful/deserializer/RequestBodyDeserializerFactory.java | 0 .../deserializer/RequestBodyDeserializerNotFoundException.java | 0 .../restful/deserializer/factory/DeserializerFactory.java | 0 .../factory/impl/DefaultJsonRequestBodyDeserializerFactory.java | 0 .../impl/DefaultTextPlainRequestBodyDeserializerFactory.java | 0 .../deserializer/impl/DefaultJsonRequestBodyDeserializer.java | 0 .../impl/DefaultTextPlainRequestBodyDeserializer.java | 0 .../elasticjob/restful/filter/DefaultFilterChain.java | 0 .../shardingsphere/elasticjob/restful/filter/FilterChain.java | 0 .../elasticjob/restful/handler/ExceptionHandleResult.java | 0 .../elasticjob/restful/handler/ExceptionHandler.java | 0 .../elasticjob/restful/handler/HandleContext.java | 0 .../shardingsphere/elasticjob/restful/handler/Handler.java | 0 .../elasticjob/restful/handler/HandlerMappingRegistry.java | 0 .../elasticjob/restful/handler/HandlerNotFoundException.java | 0 .../elasticjob/restful/handler/HandlerParameter.java | 0 .../restful/handler/impl/DefaultExceptionHandler.java | 0 .../handler/impl/DefaultHandlerNotFoundExceptionHandler.java | 0 .../restful/mapping/AmbiguousPathPatternException.java | 0 .../elasticjob/restful/mapping/DefaultMappingContext.java | 0 .../elasticjob/restful/mapping/MappingContext.java | 0 .../shardingsphere/elasticjob/restful/mapping/PathMatcher.java | 0 .../elasticjob/restful/mapping/RegexPathMatcher.java | 0 .../elasticjob/restful/mapping/RegexUrlPatternMap.java | 0 .../elasticjob/restful/mapping/UrlPatternMap.java | 0 .../restful/pipeline/ContextInitializationInboundHandler.java | 0 .../elasticjob/restful/pipeline/ExceptionHandling.java | 0 .../elasticjob/restful/pipeline/FilterChainInboundHandler.java | 0 .../elasticjob/restful/pipeline/HandleMethodExecutor.java | 0 .../elasticjob/restful/pipeline/HandlerParameterDecoder.java | 0 .../elasticjob/restful/pipeline/HttpRequestDispatcher.java | 0 .../restful/pipeline/RestfulServiceChannelInitializer.java | 0 .../elasticjob/restful/serializer/ResponseBodySerializer.java | 0 .../restful/serializer/ResponseBodySerializerFactory.java | 0 .../serializer/ResponseBodySerializerNotFoundException.java | 0 .../restful/serializer/factory/SerializerFactory.java | 0 .../factory/impl/DefaultJsonResponseBodySerializerFactory.java | 0 .../serializer/impl/DefaultJsonResponseBodySerializer.java | 0 .../elasticjob/restful/wrapper/QueryParameterMap.java | 0 ....elasticjob.restful.deserializer.factory.DeserializerFactory | 0 ...here.elasticjob.restful.serializer.factory.SerializerFactory | 0 .../shardingsphere/elasticjob/restful/RegexPathMatcherTest.java | 0 .../elasticjob/restful/RegexUrlPatternMapTest.java | 0 .../elasticjob/restful/controller/IndexController.java | 0 .../elasticjob/restful/controller/JobController.java | 0 .../restful/controller/TrailingSlashTestController.java | 0 .../deserializer/RequestBodyDeserializerFactoryTest.java | 0 .../elasticjob/restful/filter/DefaultFilterChainTest.java | 0 .../restful/handler/CustomIllegalStateExceptionHandler.java | 0 .../restful/pipeline/FilterChainInboundHandlerTest.java | 0 .../restful/pipeline/HandlerParameterDecoderTest.java | 0 .../shardingsphere/elasticjob/restful/pipeline/HttpClient.java | 0 .../elasticjob/restful/pipeline/HttpRequestDispatcherTest.java | 0 .../elasticjob/restful/pipeline/NettyRestfulServiceTest.java | 0 .../NettyRestfulServiceTrailingSlashInsensitiveTest.java | 0 .../pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java | 0 .../apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java | 0 .../shardingsphere/elasticjob/restful/pojo/ResultDto.java | 0 .../serializer/CustomTextPlainResponseBodySerializer.java | 0 .../restful/serializer/ResponseBodySerializerFactoryTest.java | 0 .../elasticjob/restful/wrapper/QueryParameterMapTest.java | 0 ...gsphere.elasticjob.restful.serializer.ResponseBodySerializer | 0 119 files changed, 4 insertions(+), 4 deletions(-) rename {infra/registry-center => registry-center}/api/pom.xml (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java (100%) rename {infra/registry-center => registry-center}/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java (100%) rename {infra/registry-center => registry-center}/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java (100%) rename {infra/registry-center => registry-center}/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java (100%) rename {infra/registry-center => registry-center}/pom.xml (96%) rename {infra/registry-center => registry-center}/provider/pom.xml (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/pom.xml (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/resources/conf/reg/local.properties (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties (100%) rename {infra/registry-center => registry-center}/provider/zookeeper-curator/src/test/resources/logback-test.xml (100%) rename {infra/restful => restful}/README.md (100%) rename {infra/restful => restful}/pom.xml (98%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java (100%) rename {infra/restful => restful}/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java (100%) rename {infra/restful => restful}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory (100%) rename {infra/restful => restful}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java (100%) rename {infra/restful => restful}/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java (100%) rename {infra/restful => restful}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer (100%) diff --git a/infra/pom.xml b/infra/pom.xml index 94b1426be6..6324e6f5ae 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -29,7 +29,5 @@ common - registry-center - restful diff --git a/pom.xml b/pom.xml index 9d391c39dd..ee1e73e550 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,8 @@ api infra engine + registry-center + restful ecosystem distribution diff --git a/infra/registry-center/api/pom.xml b/registry-center/api/pom.xml similarity index 100% rename from infra/registry-center/api/pom.xml rename to registry-center/api/pom.xml diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/CoordinatorRegistryCenter.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/ElectionCandidate.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/LeaderExecutionCallback.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/RegistryCenter.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperation.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegException.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/ConnectionStateChangedEventListener.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEvent.java diff --git a/infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java similarity index 100% rename from infra/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java rename to registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/listener/DataChangedEventListener.java diff --git a/infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java b/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java similarity index 100% rename from infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java rename to registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/base/transaction/TransactionOperationTest.java diff --git a/infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java b/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java similarity index 100% rename from infra/registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java rename to registry-center/api/src/test/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandlerTest.java diff --git a/infra/registry-center/pom.xml b/registry-center/pom.xml similarity index 96% rename from infra/registry-center/pom.xml rename to registry-center/pom.xml index 10f70dfb0f..bac7be6a3f 100644 --- a/infra/registry-center/pom.xml +++ b/registry-center/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-infra + elasticjob 3.1.0-SNAPSHOT elasticjob-registry-center diff --git a/infra/registry-center/provider/pom.xml b/registry-center/provider/pom.xml similarity index 100% rename from infra/registry-center/provider/pom.xml rename to registry-center/provider/pom.xml diff --git a/infra/registry-center/provider/zookeeper-curator/pom.xml b/registry-center/provider/zookeeper-curator/pom.xml similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/pom.xml rename to registry-center/provider/zookeeper-curator/pom.xml diff --git a/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java b/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java rename to registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfiguration.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java b/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java rename to registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionService.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java b/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java rename to registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenter.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java b/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java rename to registry-center/provider/zookeeper-curator/src/main/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProvider.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider b/registry-center/provider/zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider rename to registry-center/provider/zookeeper-curator/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/exception/ZookeeperCuratorIgnoredExceptionProviderTest.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java rename to registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local.properties b/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local.properties similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local.properties rename to registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local.properties diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties b/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties rename to registry-center/provider/zookeeper-curator/src/test/resources/conf/reg/local_overwrite.properties diff --git a/infra/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml b/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml similarity index 100% rename from infra/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml rename to registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml diff --git a/infra/restful/README.md b/restful/README.md similarity index 100% rename from infra/restful/README.md rename to restful/README.md diff --git a/infra/restful/pom.xml b/restful/pom.xml similarity index 98% rename from infra/restful/pom.xml rename to restful/pom.xml index 3a15d0ddc3..92bf0da676 100644 --- a/infra/restful/pom.xml +++ b/restful/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-infra + elasticjob 3.1.0-SNAPSHOT elasticjob-restful diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Filter.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/Http.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulController.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/RestfulService.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ContextPath.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Mapping.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Param.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/ParamSource.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/RequestBody.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/annotation/Returning.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializer.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerNotFoundException.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultJsonRequestBodyDeserializerFactory.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/impl/DefaultTextPlainRequestBodyDeserializerFactory.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChain.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/filter/FilterChain.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandleResult.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/ExceptionHandler.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandleContext.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/Handler.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerMappingRegistry.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerNotFoundException.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/HandlerParameter.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultExceptionHandler.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/handler/impl/DefaultHandlerNotFoundExceptionHandler.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/AmbiguousPathPatternException.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/DefaultMappingContext.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/MappingContext.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/PathMatcher.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexPathMatcher.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/RegexUrlPatternMap.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/mapping/UrlPatternMap.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ContextInitializationInboundHandler.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/ExceptionHandling.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandler.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandleMethodExecutor.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoder.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcher.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerNotFoundException.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/impl/DefaultJsonResponseBodySerializerFactory.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java diff --git a/infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java similarity index 100% rename from infra/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java rename to restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMap.java diff --git a/infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory b/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory similarity index 100% rename from infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory rename to restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory diff --git a/infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory b/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory similarity index 100% rename from infra/restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory rename to restful/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexPathMatcherTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/RegexUrlPatternMapTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/IndexController.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/JobController.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/controller/TrailingSlashTestController.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactoryTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/filter/DefaultFilterChainTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/handler/CustomIllegalStateExceptionHandler.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HandlerParameterDecoderTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpRequestDispatcherTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashInsensitiveTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/JobPojo.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pojo/ResultDto.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/CustomTextPlainResponseBodySerializer.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactoryTest.java diff --git a/infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java similarity index 100% rename from infra/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java rename to restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/wrapper/QueryParameterMapTest.java diff --git a/infra/restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer b/restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer similarity index 100% rename from infra/restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer rename to restful/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer From 3d4f604cc5df7452dc6281df98dbb916a4cdc8a7 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 00:01:33 +0800 Subject: [PATCH 056/178] Refactor elasticjob-infra module --- ecosystem/error-handler/spi/pom.xml | 2 +- ecosystem/error-handler/type/general/pom.xml | 2 +- ecosystem/executor/kernel/pom.xml | 2 +- ecosystem/tracing/api/pom.xml | 2 +- engine/core/pom.xml | 2 +- infra/common/pom.xml | 75 ------------------- infra/pom.xml | 50 ++++++++++++- .../infra/concurrent/BlockUtils.java | 0 .../concurrent/ElasticJobExecutorService.java | 0 .../concurrent/ExecutorServiceReloadable.java | 0 .../infra/context/ExecutionType.java | 0 .../elasticjob/infra/context/Reloadable.java | 0 .../context/ReloadablePostProcessor.java | 0 .../infra/context/ShardingItemParameters.java | 0 .../elasticjob/infra/context/TaskContext.java | 0 .../elasticjob/infra/env/HostException.java | 0 .../elasticjob/infra/env/IpUtils.java | 0 .../elasticjob/infra/env/TimeService.java | 0 .../infra/exception/ExceptionUtils.java | 0 .../exception/JobConfigurationException.java | 0 .../JobExecutionEnvironmentException.java | 0 .../exception/JobExecutionException.java | 0 .../exception/JobStatisticException.java | 0 .../infra/exception/JobSystemException.java | 0 .../infra/handler/sharding/JobInstance.java | 0 .../handler/sharding/JobShardingStrategy.java | 0 .../sharding/JobShardingStrategyFactory.java | 0 .../AverageAllocationJobShardingStrategy.java | 0 .../OdevitySortByNameJobShardingStrategy.java | 0 .../RoundRobinByNameJobShardingStrategy.java | 0 .../threadpool/JobExecutorServiceHandler.java | 0 .../JobExecutorServiceHandlerFactory.java | 0 .../AbstractJobExecutorServiceHandler.java | 0 .../CPUUsageJobExecutorServiceHandler.java | 0 ...SingleThreadJobExecutorServiceHandler.java | 0 .../elasticjob/infra/json/GsonFactory.java | 0 .../infra/listener/ElasticJobListener.java | 0 .../listener/ElasticJobListenerFactory.java | 0 .../infra/listener/ShardingContexts.java | 0 .../infra/pojo/JobConfigurationPOJO.java | 0 .../infra/spi/ElasticJobServiceLoader.java | 0 .../infra/spi/SPIPostProcessor.java | 0 .../elasticjob/infra/spi/TypedSPI.java | 0 .../ServiceLoaderInstantiationException.java | 0 .../validator/JobPropertiesValidateRule.java | 0 .../validator/JobPropertiesValidator.java | 0 .../elasticjob/infra/yaml/YamlEngine.java | 0 .../infra/yaml/config/YamlConfiguration.java | 0 .../config/YamlConfigurationConverter.java | 0 .../YamlConfigurationConverterFactory.java | 0 ...nfigurationConverterNotFoundException.java | 0 .../DefaultYamlTupleProcessor.java | 0 .../ElasticJobYamlRepresenter.java | 0 ...sphere.elasticjob.infra.context.Reloadable | 0 ...infra.handler.sharding.JobShardingStrategy | 0 ...ndler.threadpool.JobExecutorServiceHandler | 0 .../ElasticJobExecutorServiceTest.java | 0 .../ExecutorServiceReloadableTest.java | 0 .../context/ShardingItemParametersTest.java | 0 .../infra/context/TaskContextTest.java | 0 .../infra/context/fixture/TaskNode.java | 0 .../infra/env/HostExceptionTest.java | 0 .../elasticjob/infra/env/IpUtilsTest.java | 0 .../elasticjob/infra/env/TimeServiceTest.java | 0 .../infra/exception/ExceptionUtilsTest.java | 0 .../JobConfigurationExceptionTest.java | 0 .../JobExecutionEnvironmentExceptionTest.java | 0 .../exception/JobStatisticExceptionTest.java | 0 .../exception/JobSystemExceptionTest.java | 0 .../handler/sharding/JobInstanceTest.java | 0 .../JobShardingStrategyFactoryTest.java | 0 ...rageAllocationJobShardingStrategyTest.java | 0 ...vitySortByNameJobShardingStrategyTest.java | 0 ...teServerByNameJobShardingStrategyTest.java | 0 .../JobExecutorServiceHandlerFactoryTest.java | 0 ...CPUUsageJobExecutorServiceHandlerTest.java | 0 ...leThreadJobExecutorServiceHandlerTest.java | 0 .../infra/json/GsonFactoryTest.java | 0 .../ElasticJobListenerFactoryTest.java | 0 .../infra/listener/ShardingContextsTest.java | 0 .../fixture/FooElasticJobListener.java | 0 .../infra/pojo/JobConfigurationPOJOTest.java | 0 .../spi/ElasticJobServiceLoaderTest.java | 0 .../infra/spi/fixture/TypedFooService.java | 0 .../fixture/UnRegisteredTypedFooService.java | 0 .../spi/fixture/impl/TypedFooServiceImpl.java | 0 .../impl/UnRegisteredTypedFooServiceImpl.java | 0 .../JobPropertiesValidateRuleTest.java | 0 .../elasticjob/infra/yaml/YamlEngineTest.java | 0 ...YamlConfigurationConverterFactoryTest.java | 0 .../yaml/fixture/FooYamlConfiguration.java | 0 ...asticjob.infra.listener.ElasticJobListener | 0 ...asticjob.infra.spi.fixture.TypedFooService | 0 ...ra.spi.fixture.UnRegisteredTypedFooService | 0 .../src/test/resources/logback-test.xml | 0 restful/pom.xml | 2 +- 96 files changed, 52 insertions(+), 85 deletions(-) delete mode 100644 infra/common/pom.xml rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java (100%) rename infra/{common => }/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java (100%) rename infra/{common => }/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable (100%) rename infra/{common => }/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy (100%) rename infra/{common => }/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java (100%) rename infra/{common => }/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java (100%) rename infra/{common => }/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename infra/{common => }/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService (100%) rename infra/{common => }/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService (100%) rename infra/{common => }/src/test/resources/logback-test.xml (100%) diff --git a/ecosystem/error-handler/spi/pom.xml b/ecosystem/error-handler/spi/pom.xml index 42dff33886..62c701735b 100644 --- a/ecosystem/error-handler/spi/pom.xml +++ b/ecosystem/error-handler/spi/pom.xml @@ -28,7 +28,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra-common + elasticjob-infra ${project.parent.version} diff --git a/ecosystem/error-handler/type/general/pom.xml b/ecosystem/error-handler/type/general/pom.xml index f3cf22792d..df581f134f 100644 --- a/ecosystem/error-handler/type/general/pom.xml +++ b/ecosystem/error-handler/type/general/pom.xml @@ -33,7 +33,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra-common + elasticjob-infra ${project.parent.version} diff --git a/ecosystem/executor/kernel/pom.xml b/ecosystem/executor/kernel/pom.xml index 07c9570179..77b8c2a6a3 100644 --- a/ecosystem/executor/kernel/pom.xml +++ b/ecosystem/executor/kernel/pom.xml @@ -34,7 +34,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra-common + elasticjob-infra ${project.parent.version} diff --git a/ecosystem/tracing/api/pom.xml b/ecosystem/tracing/api/pom.xml index 287846d289..2a4caf1904 100644 --- a/ecosystem/tracing/api/pom.xml +++ b/ecosystem/tracing/api/pom.xml @@ -34,7 +34,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra-common + elasticjob-infra ${project.parent.version} diff --git a/engine/core/pom.xml b/engine/core/pom.xml index 26d0432ba6..6f598522f7 100644 --- a/engine/core/pom.xml +++ b/engine/core/pom.xml @@ -34,7 +34,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra-common + elasticjob-infra ${project.parent.version} diff --git a/infra/common/pom.xml b/infra/common/pom.xml deleted file mode 100644 index 518a2556bf..0000000000 --- a/infra/common/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-infra - 3.1.0-SNAPSHOT - - elasticjob-infra-common - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-api - ${project.parent.version} - - - - org.apache.commons - commons-lang3 - - - org.yaml - snakeyaml - - - com.google.code.gson - gson - - - org.slf4j - slf4j-api - ${slf4j.version} - - - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - - - ch.qos.logback - logback-classic - test - - - org.awaitility - awaitility - test - - - diff --git a/infra/pom.xml b/infra/pom.xml index 6324e6f5ae..bc8f70d631 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -24,10 +24,52 @@ 3.1.0-SNAPSHOT elasticjob-infra - pom ${project.artifactId} - - common - + + + org.apache.shardingsphere.elasticjob + elasticjob-api + ${project.parent.version} + + + + org.apache.commons + commons-lang3 + + + org.yaml + snakeyaml + + + com.google.code.gson + gson + + + org.slf4j + slf4j-api + ${slf4j.version} + + + + org.slf4j + jcl-over-slf4j + test + + + org.slf4j + log4j-over-slf4j + test + + + ch.qos.logback + logback-classic + test + + + org.awaitility + awaitility + test + + diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java diff --git a/infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java similarity index 100% rename from infra/common/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java diff --git a/infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable similarity index 100% rename from infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable rename to infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable diff --git a/infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy similarity index 100% rename from infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy rename to infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy diff --git a/infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler similarity index 100% rename from infra/common/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler rename to infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java diff --git a/infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java similarity index 100% rename from infra/common/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java diff --git a/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService b/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService similarity index 100% rename from infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService rename to infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService diff --git a/infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService b/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService similarity index 100% rename from infra/common/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService rename to infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService diff --git a/infra/common/src/test/resources/logback-test.xml b/infra/src/test/resources/logback-test.xml similarity index 100% rename from infra/common/src/test/resources/logback-test.xml rename to infra/src/test/resources/logback-test.xml diff --git a/restful/pom.xml b/restful/pom.xml index 92bf0da676..8d7e85f378 100644 --- a/restful/pom.xml +++ b/restful/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra-common + elasticjob-infra ${project.parent.version} From 7d472ed0e9e78cd03a3c56d02d59ae0498f41159 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 00:30:33 +0800 Subject: [PATCH 057/178] Spilt elasticjob-engine module --- {engine/core => core}/pom.xml | 2 +- .../elasticjob/engine/api/bootstrap/JobBootstrap.java | 0 .../engine/api/bootstrap/impl/OneOffJobBootstrap.java | 0 .../engine/api/bootstrap/impl/ScheduleJobBootstrap.java | 0 .../listener/AbstractDistributeOnceElasticJobListener.java | 0 .../elasticjob/engine/api/registry/JobInstanceRegistry.java | 0 .../engine/internal/annotation/JobAnnotationBuilder.java | 0 .../elasticjob/engine/internal/config/ConfigurationNode.java | 0 .../engine/internal/config/ConfigurationService.java | 0 .../engine/internal/config/RescheduleListenerManager.java | 0 .../engine/internal/election/ElectionListenerManager.java | 0 .../elasticjob/engine/internal/election/LeaderNode.java | 0 .../elasticjob/engine/internal/election/LeaderService.java | 0 .../engine/internal/failover/FailoverListenerManager.java | 0 .../elasticjob/engine/internal/failover/FailoverNode.java | 0 .../elasticjob/engine/internal/failover/FailoverService.java | 0 .../engine/internal/guarantee/GuaranteeListenerManager.java | 0 .../elasticjob/engine/internal/guarantee/GuaranteeNode.java | 0 .../engine/internal/guarantee/GuaranteeService.java | 0 .../elasticjob/engine/internal/instance/InstanceNode.java | 0 .../elasticjob/engine/internal/instance/InstanceService.java | 0 .../engine/internal/instance/ShutdownListenerManager.java | 0 .../engine/internal/listener/AbstractListenerManager.java | 0 .../elasticjob/engine/internal/listener/ListenerManager.java | 0 .../engine/internal/listener/ListenerNotifierManager.java | 0 .../listener/RegistryCenterConnectionStateListener.java | 0 .../engine/internal/reconcile/ReconcileService.java | 0 .../elasticjob/engine/internal/schedule/JobRegistry.java | 0 .../engine/internal/schedule/JobScheduleController.java | 0 .../elasticjob/engine/internal/schedule/JobScheduler.java | 0 .../engine/internal/schedule/JobShutdownHookPlugin.java | 0 .../engine/internal/schedule/JobTriggerListener.java | 0 .../elasticjob/engine/internal/schedule/LiteJob.java | 0 .../elasticjob/engine/internal/schedule/LiteJobFacade.java | 0 .../elasticjob/engine/internal/schedule/SchedulerFacade.java | 0 .../elasticjob/engine/internal/server/ServerNode.java | 0 .../elasticjob/engine/internal/server/ServerService.java | 0 .../elasticjob/engine/internal/server/ServerStatus.java | 0 .../engine/internal/setup/DefaultJobClassNameProvider.java | 0 .../engine/internal/setup/JobClassNameProvider.java | 0 .../engine/internal/setup/JobClassNameProviderFactory.java | 0 .../elasticjob/engine/internal/setup/SetUpFacade.java | 0 .../engine/internal/sharding/ExecutionContextService.java | 0 .../engine/internal/sharding/ExecutionService.java | 0 .../internal/sharding/MonitorExecutionListenerManager.java | 0 .../engine/internal/sharding/ShardingListenerManager.java | 0 .../elasticjob/engine/internal/sharding/ShardingNode.java | 0 .../elasticjob/engine/internal/sharding/ShardingService.java | 0 .../elasticjob/engine/internal/snapshot/SnapshotService.java | 0 .../elasticjob/engine/internal/storage/JobNodePath.java | 0 .../elasticjob/engine/internal/storage/JobNodeStorage.java | 0 .../engine/internal/trigger/TriggerListenerManager.java | 0 .../elasticjob/engine/internal/trigger/TriggerNode.java | 0 .../elasticjob/engine/internal/trigger/TriggerService.java | 0 .../elasticjob/engine/internal/util/SensitiveInfoUtils.java | 0 .../engine/api/bootstrap/impl/OneOffJobBootstrapTest.java | 0 .../api/listener/DistributeOnceElasticJobListenerTest.java | 0 .../api/listener/fixture/ElasticJobListenerCaller.java | 0 .../fixture/TestDistributeOnceElasticJobListener.java | 0 .../engine/api/listener/fixture/TestElasticJobListener.java | 0 .../engine/api/registry/JobInstanceRegistryTest.java | 0 .../elasticjob/engine/fixture/EmbedTestingServer.java | 0 .../elasticjob/engine/fixture/LiteYamlConstants.java | 0 .../engine/fixture/executor/ClassedFooJobExecutor.java | 0 .../elasticjob/engine/fixture/job/AnnotationSimpleJob.java | 0 .../engine/fixture/job/AnnotationUnShardingJob.java | 0 .../elasticjob/engine/fixture/job/DetailedFooJob.java | 0 .../shardingsphere/elasticjob/engine/fixture/job/FooJob.java | 0 .../elasticjob/engine/integrate/BaseIntegrateTest.java | 0 .../engine/integrate/disable/DisabledJobIntegrateTest.java | 0 .../integrate/disable/OneOffDisabledJobIntegrateTest.java | 0 .../integrate/disable/ScheduleDisabledJobIntegrateTest.java | 0 .../engine/integrate/enable/EnabledJobIntegrateTest.java | 0 .../integrate/enable/OneOffEnabledJobIntegrateTest.java | 0 .../integrate/enable/ScheduleEnabledJobIntegrateTest.java | 0 .../listener/TestDistributeOnceElasticJobListener.java | 0 .../engine/integrate/listener/TestElasticJobListener.java | 0 .../engine/internal/annotation/JobAnnotationBuilderTest.java | 0 .../internal/annotation/integrate/BaseAnnotationTest.java | 0 .../internal/annotation/integrate/OneOffEnabledJobTest.java | 0 .../annotation/integrate/ScheduleEnabledJobTest.java | 0 .../engine/internal/config/ConfigurationNodeTest.java | 0 .../engine/internal/config/ConfigurationServiceTest.java | 0 .../internal/config/RescheduleListenerManagerTest.java | 0 .../internal/election/ElectionListenerManagerTest.java | 0 .../elasticjob/engine/internal/election/LeaderNodeTest.java | 0 .../engine/internal/election/LeaderServiceTest.java | 0 .../internal/failover/FailoverListenerManagerTest.java | 0 .../engine/internal/failover/FailoverNodeTest.java | 0 .../engine/internal/failover/FailoverServiceTest.java | 0 .../internal/guarantee/GuaranteeListenerManagerTest.java | 0 .../engine/internal/guarantee/GuaranteeNodeTest.java | 0 .../engine/internal/guarantee/GuaranteeServiceTest.java | 0 .../engine/internal/instance/InstanceNodeTest.java | 0 .../engine/internal/instance/InstanceServiceTest.java | 0 .../internal/instance/ShutdownListenerManagerTest.java | 0 .../engine/internal/listener/ListenerManagerTest.java | 0 .../internal/listener/ListenerNotifierManagerTest.java | 0 .../listener/RegistryCenterConnectionStateListenerTest.java | 0 .../engine/internal/reconcile/ReconcileServiceTest.java | 0 .../elasticjob/engine/internal/schedule/JobRegistryTest.java | 0 .../engine/internal/schedule/JobScheduleControllerTest.java | 0 .../engine/internal/schedule/JobTriggerListenerTest.java | 0 .../engine/internal/schedule/LiteJobFacadeTest.java | 0 .../engine/internal/schedule/SchedulerFacadeTest.java | 0 .../elasticjob/engine/internal/server/ServerNodeTest.java | 0 .../elasticjob/engine/internal/server/ServerServiceTest.java | 0 .../internal/setup/DefaultJobClassNameProviderTest.java | 0 .../internal/setup/JobClassNameProviderFactoryTest.java | 0 .../elasticjob/engine/internal/setup/SetUpFacadeTest.java | 0 .../internal/sharding/ExecutionContextServiceTest.java | 0 .../engine/internal/sharding/ExecutionServiceTest.java | 0 .../sharding/MonitorExecutionListenerManagerTest.java | 0 .../internal/sharding/ShardingListenerManagerTest.java | 0 .../engine/internal/sharding/ShardingNodeTest.java | 0 .../engine/internal/sharding/ShardingServiceTest.java | 0 .../engine/internal/snapshot/BaseSnapshotServiceTest.java | 0 .../engine/internal/snapshot/SnapshotServiceDisableTest.java | 0 .../engine/internal/snapshot/SnapshotServiceEnableTest.java | 0 .../elasticjob/engine/internal/snapshot/SocketUtils.java | 0 .../elasticjob/engine/internal/storage/JobNodePathTest.java | 0 .../engine/internal/storage/JobNodeStorageTest.java | 0 .../engine/internal/trigger/TriggerListenerManagerTest.java | 0 .../engine/internal/util/SensitiveInfoUtilsTest.java | 0 .../elasticjob/engine/util/ReflectionUtils.java | 0 ...here.elasticjob.executor.item.impl.ClassedJobItemExecutor | 0 ...ardingsphere.elasticjob.infra.listener.ElasticJobListener | 0 {engine/core => core}/src/test/resources/logback-test.xml | 0 engine/pom.xml | 2 -- {engine/lifecycle => lifecycle}/pom.xml | 2 +- .../elasticjob/engine/lifecycle/api/JobAPIFactory.java | 0 .../elasticjob/engine/lifecycle/api/JobConfigurationAPI.java | 0 .../elasticjob/engine/lifecycle/api/JobOperateAPI.java | 0 .../elasticjob/engine/lifecycle/api/JobStatisticsAPI.java | 0 .../elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java | 0 .../elasticjob/engine/lifecycle/api/ShardingOperateAPI.java | 0 .../engine/lifecycle/api/ShardingStatisticsAPI.java | 0 .../elasticjob/engine/lifecycle/domain/JobBriefInfo.java | 0 .../elasticjob/engine/lifecycle/domain/ServerBriefInfo.java | 0 .../elasticjob/engine/lifecycle/domain/ShardingInfo.java | 0 .../engine/lifecycle/internal/operate/JobOperateAPIImpl.java | 0 .../lifecycle/internal/operate/ShardingOperateAPIImpl.java | 0 .../engine/lifecycle/internal/reg/RegistryCenterFactory.java | 0 .../lifecycle/internal/settings/JobConfigurationAPIImpl.java | 0 .../lifecycle/internal/statistics/JobStatisticsAPIImpl.java | 0 .../internal/statistics/ServerStatisticsAPIImpl.java | 0 .../internal/statistics/ShardingStatisticsAPIImpl.java | 0 .../engine/lifecycle/AbstractEmbedZookeeperBaseTest.java | 0 .../elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java | 0 .../engine/lifecycle/domain/ShardingStatusTest.java | 0 .../engine/lifecycle/fixture/LifecycleYamlConstants.java | 0 .../lifecycle/internal/operate/JobOperateAPIImplTest.java | 0 .../internal/operate/ShardingOperateAPIImplTest.java | 0 .../lifecycle/internal/reg/RegistryCenterFactoryTest.java | 0 .../internal/settings/JobConfigurationAPIImplTest.java | 0 .../internal/statistics/JobStatisticsAPIImplTest.java | 0 .../internal/statistics/ServerStatisticsAPIImplTest.java | 0 .../internal/statistics/ShardingStatisticsAPIImplTest.java | 0 .../src/test/resources/logback-test.xml | 0 pom.xml | 5 +++-- 160 files changed, 5 insertions(+), 6 deletions(-) rename {engine/core => core}/pom.xml (98%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java (100%) rename {engine/core => core}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java (100%) rename {engine/core => core}/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java (100%) rename {engine/core => core}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {engine/core => core}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {engine/core => core}/src/test/resources/logback-test.xml (100%) rename {engine/lifecycle => lifecycle}/pom.xml (98%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java (100%) rename {engine/lifecycle => lifecycle}/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java (100%) rename {engine/lifecycle => lifecycle}/src/test/resources/logback-test.xml (100%) diff --git a/engine/core/pom.xml b/core/pom.xml similarity index 98% rename from engine/core/pom.xml rename to core/pom.xml index 6f598522f7..ba731a5505 100644 --- a/engine/core/pom.xml +++ b/core/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-engine + elasticjob 3.1.0-SNAPSHOT elasticjob-engine-core diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java diff --git a/engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java b/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java similarity index 100% rename from engine/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java rename to core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java diff --git a/engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java similarity index 100% rename from engine/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java rename to core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java diff --git a/engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from engine/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/engine/core/src/test/resources/logback-test.xml b/core/src/test/resources/logback-test.xml similarity index 100% rename from engine/core/src/test/resources/logback-test.xml rename to core/src/test/resources/logback-test.xml diff --git a/engine/pom.xml b/engine/pom.xml index c956915b76..71594903bb 100644 --- a/engine/pom.xml +++ b/engine/pom.xml @@ -28,8 +28,6 @@ ${project.artifactId} - core spring - lifecycle diff --git a/engine/lifecycle/pom.xml b/lifecycle/pom.xml similarity index 98% rename from engine/lifecycle/pom.xml rename to lifecycle/pom.xml index e8c4bc7040..019475e132 100644 --- a/engine/lifecycle/pom.xml +++ b/lifecycle/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-engine + elasticjob 3.1.0-SNAPSHOT elasticjob-engine-lifecycle diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java diff --git a/engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java similarity index 100% rename from engine/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java diff --git a/engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java similarity index 100% rename from engine/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java diff --git a/engine/lifecycle/src/test/resources/logback-test.xml b/lifecycle/src/test/resources/logback-test.xml similarity index 100% rename from engine/lifecycle/src/test/resources/logback-test.xml rename to lifecycle/src/test/resources/logback-test.xml diff --git a/pom.xml b/pom.xml index ee1e73e550..35060b5508 100644 --- a/pom.xml +++ b/pom.xml @@ -32,12 +32,13 @@ api + registry-center infra + core engine - registry-center restful + lifecycle ecosystem - distribution From 36beb1fe691eb6df4c2e2c1932e61890a5c9cdc4 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 01:07:21 +0800 Subject: [PATCH 058/178] Spilt elasticjob-engine module --- engine/pom.xml | 33 ------------------- pom.xml | 7 +++- .../spring => spring}/boot-starter/README.md | 0 .../spring => spring}/boot-starter/pom.xml | 0 .../job/ElasticJobBootstrapConfiguration.java | 0 .../ElasticJobConfigurationProperties.java | 0 .../job/ElasticJobLiteAutoConfiguration.java | 0 .../spring/boot/job/ElasticJobProperties.java | 0 .../ScheduleJobBootstrapStartupRunner.java | 0 ...ElasticJobRegistryCenterConfiguration.java | 0 .../spring/boot/reg/ZookeeperProperties.java | 0 ...lasticJobSnapshotServiceConfiguration.java | 0 .../snapshot/SnapshotServiceProperties.java | 0 .../ElasticJobTracingConfiguration.java | 0 .../boot/tracing/TracingProperties.java | 0 ...itional-spring-configuration-metadata.json | 0 .../main/resources/META-INF/spring.factories | 0 .../main/resources/META-INF/spring.provides | 0 ...ot.autoconfigure.AutoConfiguration.imports | 0 ...ElasticJobConfigurationPropertiesTest.java | 0 .../job/ElasticJobSpringBootScannerTest.java | 0 .../boot/job/ElasticJobSpringBootTest.java | 0 .../executor/CustomClassedJobExecutor.java | 0 .../boot/job/executor/PrintJobExecutor.java | 0 .../boot/job/executor/PrintJobProperties.java | 0 .../boot/job/fixture/EmbedTestingServer.java | 0 .../boot/job/fixture/job/CustomJob.java | 0 .../fixture/job/impl/AnnotationCustomJob.java | 0 .../job/fixture/job/impl/CustomTestJob.java | 0 .../listener/LogElasticJobListener.java | 0 .../listener/NoopElasticJobListener.java | 0 .../boot/job/repository/BarRepository.java | 0 .../repository/impl/BarRepositoryImpl.java | 0 .../boot/reg/ZookeeperPropertiesTest.java | 0 ...icJobSnapshotServiceConfigurationTest.java | 0 .../tracing/TracingConfigurationTest.java | 0 ....executor.item.impl.ClassedJobItemExecutor | 0 ...ob.executor.item.impl.TypedJobItemExecutor | 0 ...asticjob.infra.listener.ElasticJobListener | 0 .../test/resources/application-elasticjob.yml | 0 .../test/resources/application-snapshot.yml | 0 .../test/resources/application-tracing.yml | 0 .../src/test/resources/logback-test.xml | 0 {engine/spring => spring}/core/pom.xml | 0 .../core/scanner/ClassPathJobScanner.java | 0 .../spring/core/scanner/ElasticJobScan.java | 0 .../core/scanner/ElasticJobScanRegistrar.java | 0 .../core/scanner/JobScannerConfiguration.java | 0 .../SpringProxyJobClassNameProvider.java | 0 .../spring/core/util/AopTargetUtils.java | 0 ...engine.internal.setup.JobClassNameProvider | 0 .../JobClassNameProviderFactoryTest.java | 0 .../spring/core/util/AopTargetUtilsTest.java | 0 .../engine/spring/core/util/TargetJob.java | 0 .../test/resources/META-INF/logback-test.xml | 0 {engine/spring => spring}/namespace/pom.xml | 0 .../namespace/ElasticJobNamespaceHandler.java | 0 .../job/parser/JobBeanDefinitionParser.java | 0 .../job/tag/JobBeanDefinitionTag.java | 0 .../parser/ZookeeperBeanDefinitionParser.java | 0 .../reg/tag/ZookeeperBeanDefinitionTag.java | 0 .../JobScannerBeanDefinitionParser.java | 0 .../tag/JobScannerBeanDefinitionTag.java | 0 .../parser/SnapshotBeanDefinitionParser.java | 0 .../tag/SnapshotBeanDefinitionTag.java | 0 .../parser/TracingBeanDefinitionParser.java | 0 .../tracing/tag/TracingBeanDefinitionTag.java | 0 .../META-INF/namespace/elasticjob.xsd | 0 .../main/resources/META-INF/spring.handlers | 0 .../main/resources/META-INF/spring.schemas | 0 .../fixture/aspect/SimpleAspect.java | 0 .../fixture/job/DataflowElasticJob.java | 0 .../fixture/job/FooSimpleElasticJob.java | 0 .../job/annotation/AnnotationSimpleJob.java | 0 .../job/ref/RefFooDataflowElasticJob.java | 0 .../job/ref/RefFooSimpleElasticJob.java | 0 .../fixture/listener/SimpleCglibListener.java | 0 .../SimpleJdkDynamicProxyListener.java | 0 .../fixture/listener/SimpleListener.java | 0 .../fixture/listener/SimpleOnceListener.java | 0 .../namespace/fixture/service/FooService.java | 0 .../fixture/service/FooServiceImpl.java | 0 .../job/AbstractJobSpringIntegrateTest.java | 0 .../AbstractOneOffJobSpringIntegrateTest.java | 0 ...bSpringNamespaceWithEventTraceRdbTest.java | 0 .../JobSpringNamespaceWithJobHandlerTest.java | 0 ...ringNamespaceWithListenerAndCglibTest.java | 0 ...aceWithListenerAndJdkDynamicProxyTest.java | 0 .../JobSpringNamespaceWithListenerTest.java | 0 .../job/JobSpringNamespaceWithRefTest.java | 0 .../job/JobSpringNamespaceWithTypeTest.java | 0 ...JobSpringNamespaceWithoutListenerTest.java | 0 ...bSpringNamespaceWithEventTraceRdbTest.java | 0 ...fJobSpringNamespaceWithJobHandlerTest.java | 0 ...ringNamespaceWithListenerAndCglibTest.java | 0 ...aceWithListenerAndJdkDynamicProxyTest.java | 0 ...OffJobSpringNamespaceWithListenerTest.java | 0 .../OneOffJobSpringNamespaceWithRefTest.java | 0 .../OneOffJobSpringNamespaceWithTypeTest.java | 0 ...JobSpringNamespaceWithoutListenerTest.java | 0 .../AbstractJobSpringIntegrateTest.java | 0 .../namespace/scanner/JobScannerTest.java | 0 .../SnapshotSpringNamespaceDisableTest.java | 0 .../SnapshotSpringNamespaceEnableTest.java | 0 .../namespace/snapshot/SocketUtils.java | 0 ...okeeperJUnitJupiterSpringContextTests.java | 0 .../EmbedZookeeperTestExecutionListener.java | 0 .../src/test/resources/META-INF/job/base.xml | 0 .../META-INF/job/oneOffWithEventTraceRdb.xml | 0 .../META-INF/job/oneOffWithJobHandler.xml | 0 .../META-INF/job/oneOffWithJobRef.xml | 0 .../META-INF/job/oneOffWithJobType.xml | 0 .../META-INF/job/oneOffWithListener.xml | 0 .../job/oneOffWithListenerAndCglib.xml | 0 .../oneOffWithListenerAndJdkDynamicProxy.xml | 0 .../META-INF/job/oneOffWithoutListener.xml | 0 .../META-INF/job/withEventTraceRdb.xml | 0 .../resources/META-INF/job/withJobHandler.xml | 0 .../resources/META-INF/job/withJobRef.xml | 0 .../resources/META-INF/job/withJobType.xml | 0 .../resources/META-INF/job/withListener.xml | 0 .../META-INF/job/withListenerAndCglib.xml | 0 .../job/withListenerAndJdkDynamicProxy.xml | 0 .../META-INF/job/withoutListener.xml | 0 .../resources/META-INF/reg/regContext.xml | 0 .../META-INF/scanner/jobScannerContext.xml | 0 ...asticjob.infra.listener.ElasticJobListener | 0 .../META-INF/snapshot/snapshotDisabled.xml | 0 .../META-INF/snapshot/snapshotEnabled.xml | 0 .../test/resources/conf/job/conf.properties | 0 .../test/resources/conf/reg/conf.properties | 0 .../src/test/resources/logback-test.xml | 0 .../src/test/resources/script/demo.bat | 0 .../src/test/resources/script/demo.sh | 0 {engine/spring => spring}/pom.xml | 2 +- 135 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 engine/pom.xml rename {engine/spring => spring}/boot-starter/README.md (100%) rename {engine/spring => spring}/boot-starter/pom.xml (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java (100%) rename {engine/spring => spring}/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java (100%) rename {engine/spring => spring}/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json (100%) rename {engine/spring => spring}/boot-starter/src/main/resources/META-INF/spring.factories (100%) rename {engine/spring => spring}/boot-starter/src/main/resources/META-INF/spring.provides (100%) rename {engine/spring => spring}/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java (100%) rename {engine/spring => spring}/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java (100%) rename {engine/spring => spring}/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {engine/spring => spring}/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor (100%) rename {engine/spring => spring}/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {engine/spring => spring}/boot-starter/src/test/resources/application-elasticjob.yml (100%) rename {engine/spring => spring}/boot-starter/src/test/resources/application-snapshot.yml (100%) rename {engine/spring => spring}/boot-starter/src/test/resources/application-tracing.yml (100%) rename {engine/spring => spring}/boot-starter/src/test/resources/logback-test.xml (100%) rename {engine/spring => spring}/core/pom.xml (100%) rename {engine/spring => spring}/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java (100%) rename {engine/spring => spring}/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java (100%) rename {engine/spring => spring}/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java (100%) rename {engine/spring => spring}/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java (100%) rename {engine/spring => spring}/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java (100%) rename {engine/spring => spring}/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java (100%) rename {engine/spring => spring}/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider (100%) rename {engine/spring => spring}/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java (100%) rename {engine/spring => spring}/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java (100%) rename {engine/spring => spring}/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java (100%) rename {engine/spring => spring}/core/src/test/resources/META-INF/logback-test.xml (100%) rename {engine/spring => spring}/namespace/pom.xml (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java (100%) rename {engine/spring => spring}/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java (100%) rename {engine/spring => spring}/namespace/src/main/resources/META-INF/namespace/elasticjob.xsd (100%) rename {engine/spring => spring}/namespace/src/main/resources/META-INF/spring.handlers (100%) rename {engine/spring => spring}/namespace/src/main/resources/META-INF/spring.schemas (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java (100%) rename {engine/spring => spring}/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/base.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withJobHandler.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withJobRef.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withJobType.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withListener.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/job/withoutListener.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/reg/regContext.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/conf/job/conf.properties (100%) rename {engine/spring => spring}/namespace/src/test/resources/conf/reg/conf.properties (100%) rename {engine/spring => spring}/namespace/src/test/resources/logback-test.xml (100%) rename {engine/spring => spring}/namespace/src/test/resources/script/demo.bat (100%) rename {engine/spring => spring}/namespace/src/test/resources/script/demo.sh (100%) rename {engine/spring => spring}/pom.xml (98%) diff --git a/engine/pom.xml b/engine/pom.xml deleted file mode 100644 index 71594903bb..0000000000 --- a/engine/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob - 3.1.0-SNAPSHOT - - elasticjob-engine - pom - ${project.artifactId} - - - spring - - diff --git a/pom.xml b/pom.xml index 35060b5508..2361be421d 100644 --- a/pom.xml +++ b/pom.xml @@ -35,10 +35,10 @@ registry-center infra core - engine restful lifecycle ecosystem + spring distribution @@ -203,6 +203,11 @@ ${slf4j.version} true + + ch.qos.logback + logback-core + ${logback.version} + ch.qos.logback logback-classic diff --git a/engine/spring/boot-starter/README.md b/spring/boot-starter/README.md similarity index 100% rename from engine/spring/boot-starter/README.md rename to spring/boot-starter/README.md diff --git a/engine/spring/boot-starter/pom.xml b/spring/boot-starter/pom.xml similarity index 100% rename from engine/spring/boot-starter/pom.xml rename to spring/boot-starter/pom.xml diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java diff --git a/engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java similarity index 100% rename from engine/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java diff --git a/engine/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json similarity index 100% rename from engine/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json rename to spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json diff --git a/engine/spring/boot-starter/src/main/resources/META-INF/spring.factories b/spring/boot-starter/src/main/resources/META-INF/spring.factories similarity index 100% rename from engine/spring/boot-starter/src/main/resources/META-INF/spring.factories rename to spring/boot-starter/src/main/resources/META-INF/spring.factories diff --git a/engine/spring/boot-starter/src/main/resources/META-INF/spring.provides b/spring/boot-starter/src/main/resources/META-INF/spring.provides similarity index 100% rename from engine/spring/boot-starter/src/main/resources/META-INF/spring.provides rename to spring/boot-starter/src/main/resources/META-INF/spring.provides diff --git a/engine/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports similarity index 100% rename from engine/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename to spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java diff --git a/engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java similarity index 100% rename from engine/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java diff --git a/engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor similarity index 100% rename from engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor diff --git a/engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from engine/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/engine/spring/boot-starter/src/test/resources/application-elasticjob.yml b/spring/boot-starter/src/test/resources/application-elasticjob.yml similarity index 100% rename from engine/spring/boot-starter/src/test/resources/application-elasticjob.yml rename to spring/boot-starter/src/test/resources/application-elasticjob.yml diff --git a/engine/spring/boot-starter/src/test/resources/application-snapshot.yml b/spring/boot-starter/src/test/resources/application-snapshot.yml similarity index 100% rename from engine/spring/boot-starter/src/test/resources/application-snapshot.yml rename to spring/boot-starter/src/test/resources/application-snapshot.yml diff --git a/engine/spring/boot-starter/src/test/resources/application-tracing.yml b/spring/boot-starter/src/test/resources/application-tracing.yml similarity index 100% rename from engine/spring/boot-starter/src/test/resources/application-tracing.yml rename to spring/boot-starter/src/test/resources/application-tracing.yml diff --git a/engine/spring/boot-starter/src/test/resources/logback-test.xml b/spring/boot-starter/src/test/resources/logback-test.xml similarity index 100% rename from engine/spring/boot-starter/src/test/resources/logback-test.xml rename to spring/boot-starter/src/test/resources/logback-test.xml diff --git a/engine/spring/core/pom.xml b/spring/core/pom.xml similarity index 100% rename from engine/spring/core/pom.xml rename to spring/core/pom.xml diff --git a/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java similarity index 100% rename from engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java diff --git a/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java similarity index 100% rename from engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java diff --git a/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java similarity index 100% rename from engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java diff --git a/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java similarity index 100% rename from engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java diff --git a/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java similarity index 100% rename from engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java diff --git a/engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java similarity index 100% rename from engine/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java diff --git a/engine/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider b/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider similarity index 100% rename from engine/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider rename to spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider diff --git a/engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java similarity index 100% rename from engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java rename to spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java diff --git a/engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java similarity index 100% rename from engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java rename to spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java diff --git a/engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java similarity index 100% rename from engine/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java rename to spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java diff --git a/engine/spring/core/src/test/resources/META-INF/logback-test.xml b/spring/core/src/test/resources/META-INF/logback-test.xml similarity index 100% rename from engine/spring/core/src/test/resources/META-INF/logback-test.xml rename to spring/core/src/test/resources/META-INF/logback-test.xml diff --git a/engine/spring/namespace/pom.xml b/spring/namespace/pom.xml similarity index 100% rename from engine/spring/namespace/pom.xml rename to spring/namespace/pom.xml diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java diff --git a/engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java similarity index 100% rename from engine/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java diff --git a/engine/spring/namespace/src/main/resources/META-INF/namespace/elasticjob.xsd b/spring/namespace/src/main/resources/META-INF/namespace/elasticjob.xsd similarity index 100% rename from engine/spring/namespace/src/main/resources/META-INF/namespace/elasticjob.xsd rename to spring/namespace/src/main/resources/META-INF/namespace/elasticjob.xsd diff --git a/engine/spring/namespace/src/main/resources/META-INF/spring.handlers b/spring/namespace/src/main/resources/META-INF/spring.handlers similarity index 100% rename from engine/spring/namespace/src/main/resources/META-INF/spring.handlers rename to spring/namespace/src/main/resources/META-INF/spring.handlers diff --git a/engine/spring/namespace/src/main/resources/META-INF/spring.schemas b/spring/namespace/src/main/resources/META-INF/spring.schemas similarity index 100% rename from engine/spring/namespace/src/main/resources/META-INF/spring.schemas rename to spring/namespace/src/main/resources/META-INF/spring.schemas diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java diff --git a/engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java similarity index 100% rename from engine/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/base.xml b/spring/namespace/src/test/resources/META-INF/job/base.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/base.xml rename to spring/namespace/src/test/resources/META-INF/job/base.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithJobHandler.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithJobRef.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithJobType.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndCglib.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithListenerAndJdkDynamicProxy.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml rename to spring/namespace/src/test/resources/META-INF/job/oneOffWithoutListener.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml b/spring/namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml rename to spring/namespace/src/test/resources/META-INF/job/withEventTraceRdb.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withJobHandler.xml b/spring/namespace/src/test/resources/META-INF/job/withJobHandler.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withJobHandler.xml rename to spring/namespace/src/test/resources/META-INF/job/withJobHandler.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withJobRef.xml b/spring/namespace/src/test/resources/META-INF/job/withJobRef.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withJobRef.xml rename to spring/namespace/src/test/resources/META-INF/job/withJobRef.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withJobType.xml b/spring/namespace/src/test/resources/META-INF/job/withJobType.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withJobType.xml rename to spring/namespace/src/test/resources/META-INF/job/withJobType.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withListener.xml b/spring/namespace/src/test/resources/META-INF/job/withListener.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withListener.xml rename to spring/namespace/src/test/resources/META-INF/job/withListener.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml b/spring/namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml rename to spring/namespace/src/test/resources/META-INF/job/withListenerAndCglib.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml b/spring/namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml rename to spring/namespace/src/test/resources/META-INF/job/withListenerAndJdkDynamicProxy.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/job/withoutListener.xml b/spring/namespace/src/test/resources/META-INF/job/withoutListener.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/job/withoutListener.xml rename to spring/namespace/src/test/resources/META-INF/job/withoutListener.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/reg/regContext.xml b/spring/namespace/src/test/resources/META-INF/reg/regContext.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/reg/regContext.xml rename to spring/namespace/src/test/resources/META-INF/reg/regContext.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml b/spring/namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml rename to spring/namespace/src/test/resources/META-INF/scanner/jobScannerContext.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml b/spring/namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml rename to spring/namespace/src/test/resources/META-INF/snapshot/snapshotDisabled.xml diff --git a/engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml b/spring/namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml rename to spring/namespace/src/test/resources/META-INF/snapshot/snapshotEnabled.xml diff --git a/engine/spring/namespace/src/test/resources/conf/job/conf.properties b/spring/namespace/src/test/resources/conf/job/conf.properties similarity index 100% rename from engine/spring/namespace/src/test/resources/conf/job/conf.properties rename to spring/namespace/src/test/resources/conf/job/conf.properties diff --git a/engine/spring/namespace/src/test/resources/conf/reg/conf.properties b/spring/namespace/src/test/resources/conf/reg/conf.properties similarity index 100% rename from engine/spring/namespace/src/test/resources/conf/reg/conf.properties rename to spring/namespace/src/test/resources/conf/reg/conf.properties diff --git a/engine/spring/namespace/src/test/resources/logback-test.xml b/spring/namespace/src/test/resources/logback-test.xml similarity index 100% rename from engine/spring/namespace/src/test/resources/logback-test.xml rename to spring/namespace/src/test/resources/logback-test.xml diff --git a/engine/spring/namespace/src/test/resources/script/demo.bat b/spring/namespace/src/test/resources/script/demo.bat similarity index 100% rename from engine/spring/namespace/src/test/resources/script/demo.bat rename to spring/namespace/src/test/resources/script/demo.bat diff --git a/engine/spring/namespace/src/test/resources/script/demo.sh b/spring/namespace/src/test/resources/script/demo.sh similarity index 100% rename from engine/spring/namespace/src/test/resources/script/demo.sh rename to spring/namespace/src/test/resources/script/demo.sh diff --git a/engine/spring/pom.xml b/spring/pom.xml similarity index 98% rename from engine/spring/pom.xml rename to spring/pom.xml index 88f4e2cc6d..e343358d7f 100644 --- a/engine/spring/pom.xml +++ b/spring/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-engine + elasticjob 3.1.0-SNAPSHOT elasticjob-engine-spring From 9ae1d6808d1f20871e80f8a471fe02c5766e51c3 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 11:26:52 +0800 Subject: [PATCH 059/178] Refactor spring dependencies --- spring/boot-starter/pom.xml | 3 +-- spring/core/pom.xml | 23 ++-------------------- spring/namespace/pom.xml | 38 ++++++++----------------------------- spring/pom.xml | 6 ++++++ 4 files changed, 17 insertions(+), 53 deletions(-) diff --git a/spring/boot-starter/pom.xml b/spring/boot-starter/pom.xml index eeab8a741c..dfbd074fe2 100644 --- a/spring/boot-starter/pom.xml +++ b/spring/boot-starter/pom.xml @@ -32,6 +32,7 @@ elasticjob-engine-spring-core ${project.parent.version} + org.springframework.boot spring-boot-starter @@ -55,7 +56,6 @@ org.apache.curator curator-test - test com.h2database @@ -65,7 +65,6 @@ org.awaitility awaitility - test diff --git a/spring/core/pom.xml b/spring/core/pom.xml index 73be5f0aab..cd2d479050 100644 --- a/spring/core/pom.xml +++ b/spring/core/pom.xml @@ -38,6 +38,7 @@ + org.springframework spring-context @@ -45,31 +46,11 @@ org.springframework spring-context-support - - - org.springframework - spring-context - - + org.springframework spring-test - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - - - ch.qos.logback - logback-classic - test - diff --git a/spring/namespace/pom.xml b/spring/namespace/pom.xml index 250a0191e0..a51a6a2247 100644 --- a/spring/namespace/pom.xml +++ b/spring/namespace/pom.xml @@ -33,21 +33,6 @@ ${project.parent.version} - - org.springframework - spring-context - - - org.springframework - spring-context-support - - - org.springframework - spring-context - - - - org.apache.shardingsphere.elasticjob elasticjob-error-handler-email @@ -68,31 +53,25 @@ - org.apache.curator - curator-test + org.springframework + spring-context org.springframework - spring-test + spring-context-support + org.aspectj aspectjweaver - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test + org.apache.curator + curator-test - ch.qos.logback - logback-classic - test + org.springframework + spring-test com.h2database @@ -106,7 +85,6 @@ org.awaitility awaitility - test diff --git a/spring/pom.xml b/spring/pom.xml index e343358d7f..ec75e56cc5 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -57,6 +57,12 @@ org.springframework spring-context-support ${springframework.version} + + + org.springframework + spring-context + + provided From ce681de53d04667958e9aaccc77676f258b65b2e Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sun, 15 Oct 2023 11:27:25 +0800 Subject: [PATCH 060/178] Relax the conditions for unit tests involving awaitility to fix CI (#2293) --- .../engine/integrate/disable/DisabledJobIntegrateTest.java | 2 +- .../namespace/job/OneOffJobSpringNamespaceWithTypeTest.java | 2 +- .../namespace/scanner/AbstractJobSpringIntegrateTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java index 195df83243..ddcc15c44a 100644 --- a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java +++ b/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java @@ -42,7 +42,7 @@ public DisabledJobIntegrateTest(final TestType type) { } protected final void assertDisabledRegCenterInfo() { - Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> { + Awaitility.await().atLeast(1L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); }); diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index a5850543df..760d75dec2 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -52,6 +52,6 @@ void tearDown() { void jobScriptWithJobTypeTest() { OneOffJobBootstrap bootstrap = applicationContext.getBean(scriptJobName, OneOffJobBootstrap.class); bootstrap.execute(); - Awaitility.await().atLeast(100L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertTrue(regCenter.isExisted("/" + scriptJobName + "/sharding"))); + Awaitility.await().atLeast(1L, TimeUnit.MILLISECONDS).atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertTrue(regCenter.isExisted("/" + scriptJobName + "/sharding"))); } } diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index 82fabe7955..6ca0928044 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -59,7 +59,7 @@ void assertSpringJobBean() { } private void assertSimpleElasticJobBean() { - Awaitility.await().atMost(5L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(AnnotationSimpleJob.isCompleted(), is(true))); + Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(AnnotationSimpleJob.isCompleted(), is(true))); assertTrue(AnnotationSimpleJob.isCompleted()); assertTrue(regCenter.isExisted("/" + simpleJobName + "/sharding")); } From cf9552aed67f9e2265ee8c75661d88d98cac74f4 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 11:30:26 +0800 Subject: [PATCH 061/178] Refactor spring dependencies --- spring/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring/pom.xml b/spring/pom.xml index ec75e56cc5..581f0dc97e 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -57,13 +57,13 @@ org.springframework spring-context-support ${springframework.version} + provided org.springframework spring-context - provided org.springframework From c56ab166f5bf79fb796571fbcd1e2a326f8f79b0 Mon Sep 17 00:00:00 2001 From: Mingyuan Wu Date: Sun, 15 Oct 2023 11:40:53 +0800 Subject: [PATCH 062/178] JDK 21 is go GA now (#2278) JDK 21 is go GA now --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 37e27cf8a2..aadcf1e40c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,7 +28,7 @@ jobs: build: strategy: matrix: - java: [ 8, 17, 21-ea ] + java: [ 8, 17, 21 ] os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ] runs-on: ${{ matrix.os }} From 442bf91d0b6ac5c4413435db78da41b279f17823 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 13:10:20 +0800 Subject: [PATCH 063/178] Rename elasticjob-kernel module --- distribution/bin/pom.xml | 2 +- docs/content/quick-start/_index.cn.md | 2 +- docs/content/quick-start/_index.en.md | 2 +- ecosystem/tracing/api/src/test/resources/logback-test.xml | 2 +- ecosystem/tracing/rdb/src/test/resources/logback-test.xml | 2 +- examples/elasticjob-example-jobs/pom.xml | 2 +- examples/elasticjob-example-lite-java/pom.xml | 2 +- examples/pom.xml | 2 +- infra/src/test/resources/logback-test.xml | 2 +- {core => kernel}/pom.xml | 2 +- .../elasticjob/engine/api/bootstrap/JobBootstrap.java | 0 .../engine/api/bootstrap/impl/OneOffJobBootstrap.java | 0 .../engine/api/bootstrap/impl/ScheduleJobBootstrap.java | 0 .../listener/AbstractDistributeOnceElasticJobListener.java | 0 .../elasticjob/engine/api/registry/JobInstanceRegistry.java | 0 .../engine/internal/annotation/JobAnnotationBuilder.java | 0 .../elasticjob/engine/internal/config/ConfigurationNode.java | 0 .../engine/internal/config/ConfigurationService.java | 0 .../engine/internal/config/RescheduleListenerManager.java | 0 .../engine/internal/election/ElectionListenerManager.java | 0 .../elasticjob/engine/internal/election/LeaderNode.java | 0 .../elasticjob/engine/internal/election/LeaderService.java | 0 .../engine/internal/failover/FailoverListenerManager.java | 0 .../elasticjob/engine/internal/failover/FailoverNode.java | 0 .../elasticjob/engine/internal/failover/FailoverService.java | 0 .../engine/internal/guarantee/GuaranteeListenerManager.java | 0 .../elasticjob/engine/internal/guarantee/GuaranteeNode.java | 0 .../engine/internal/guarantee/GuaranteeService.java | 0 .../elasticjob/engine/internal/instance/InstanceNode.java | 0 .../elasticjob/engine/internal/instance/InstanceService.java | 0 .../engine/internal/instance/ShutdownListenerManager.java | 0 .../engine/internal/listener/AbstractListenerManager.java | 0 .../elasticjob/engine/internal/listener/ListenerManager.java | 0 .../engine/internal/listener/ListenerNotifierManager.java | 0 .../listener/RegistryCenterConnectionStateListener.java | 0 .../engine/internal/reconcile/ReconcileService.java | 0 .../elasticjob/engine/internal/schedule/JobRegistry.java | 0 .../engine/internal/schedule/JobScheduleController.java | 0 .../elasticjob/engine/internal/schedule/JobScheduler.java | 0 .../engine/internal/schedule/JobShutdownHookPlugin.java | 0 .../engine/internal/schedule/JobTriggerListener.java | 0 .../elasticjob/engine/internal/schedule/LiteJob.java | 0 .../elasticjob/engine/internal/schedule/LiteJobFacade.java | 0 .../elasticjob/engine/internal/schedule/SchedulerFacade.java | 0 .../elasticjob/engine/internal/server/ServerNode.java | 0 .../elasticjob/engine/internal/server/ServerService.java | 0 .../elasticjob/engine/internal/server/ServerStatus.java | 0 .../engine/internal/setup/DefaultJobClassNameProvider.java | 0 .../engine/internal/setup/JobClassNameProvider.java | 0 .../engine/internal/setup/JobClassNameProviderFactory.java | 0 .../elasticjob/engine/internal/setup/SetUpFacade.java | 0 .../engine/internal/sharding/ExecutionContextService.java | 0 .../elasticjob/engine/internal/sharding/ExecutionService.java | 0 .../internal/sharding/MonitorExecutionListenerManager.java | 0 .../engine/internal/sharding/ShardingListenerManager.java | 0 .../elasticjob/engine/internal/sharding/ShardingNode.java | 0 .../elasticjob/engine/internal/sharding/ShardingService.java | 0 .../elasticjob/engine/internal/snapshot/SnapshotService.java | 0 .../elasticjob/engine/internal/storage/JobNodePath.java | 0 .../elasticjob/engine/internal/storage/JobNodeStorage.java | 0 .../engine/internal/trigger/TriggerListenerManager.java | 0 .../elasticjob/engine/internal/trigger/TriggerNode.java | 0 .../elasticjob/engine/internal/trigger/TriggerService.java | 0 .../elasticjob/engine/internal/util/SensitiveInfoUtils.java | 0 .../engine/api/bootstrap/impl/OneOffJobBootstrapTest.java | 0 .../api/listener/DistributeOnceElasticJobListenerTest.java | 0 .../engine/api/listener/fixture/ElasticJobListenerCaller.java | 0 .../fixture/TestDistributeOnceElasticJobListener.java | 0 .../engine/api/listener/fixture/TestElasticJobListener.java | 0 .../engine/api/registry/JobInstanceRegistryTest.java | 0 .../elasticjob/engine/fixture/EmbedTestingServer.java | 0 .../elasticjob/engine/fixture/LiteYamlConstants.java | 0 .../engine/fixture/executor/ClassedFooJobExecutor.java | 0 .../elasticjob/engine/fixture/job/AnnotationSimpleJob.java | 0 .../engine/fixture/job/AnnotationUnShardingJob.java | 0 .../elasticjob/engine/fixture/job/DetailedFooJob.java | 0 .../shardingsphere/elasticjob/engine/fixture/job/FooJob.java | 0 .../elasticjob/engine/integrate/BaseIntegrateTest.java | 0 .../engine/integrate/disable/DisabledJobIntegrateTest.java | 0 .../integrate/disable/OneOffDisabledJobIntegrateTest.java | 0 .../integrate/disable/ScheduleDisabledJobIntegrateTest.java | 0 .../engine/integrate/enable/EnabledJobIntegrateTest.java | 0 .../integrate/enable/OneOffEnabledJobIntegrateTest.java | 0 .../integrate/enable/ScheduleEnabledJobIntegrateTest.java | 0 .../listener/TestDistributeOnceElasticJobListener.java | 0 .../engine/integrate/listener/TestElasticJobListener.java | 0 .../engine/internal/annotation/JobAnnotationBuilderTest.java | 0 .../internal/annotation/integrate/BaseAnnotationTest.java | 0 .../internal/annotation/integrate/OneOffEnabledJobTest.java | 0 .../internal/annotation/integrate/ScheduleEnabledJobTest.java | 0 .../engine/internal/config/ConfigurationNodeTest.java | 0 .../engine/internal/config/ConfigurationServiceTest.java | 0 .../engine/internal/config/RescheduleListenerManagerTest.java | 0 .../engine/internal/election/ElectionListenerManagerTest.java | 0 .../elasticjob/engine/internal/election/LeaderNodeTest.java | 0 .../engine/internal/election/LeaderServiceTest.java | 0 .../engine/internal/failover/FailoverListenerManagerTest.java | 0 .../elasticjob/engine/internal/failover/FailoverNodeTest.java | 0 .../engine/internal/failover/FailoverServiceTest.java | 0 .../internal/guarantee/GuaranteeListenerManagerTest.java | 0 .../engine/internal/guarantee/GuaranteeNodeTest.java | 0 .../engine/internal/guarantee/GuaranteeServiceTest.java | 0 .../elasticjob/engine/internal/instance/InstanceNodeTest.java | 0 .../engine/internal/instance/InstanceServiceTest.java | 0 .../engine/internal/instance/ShutdownListenerManagerTest.java | 0 .../engine/internal/listener/ListenerManagerTest.java | 0 .../engine/internal/listener/ListenerNotifierManagerTest.java | 0 .../listener/RegistryCenterConnectionStateListenerTest.java | 0 .../engine/internal/reconcile/ReconcileServiceTest.java | 0 .../elasticjob/engine/internal/schedule/JobRegistryTest.java | 0 .../engine/internal/schedule/JobScheduleControllerTest.java | 0 .../engine/internal/schedule/JobTriggerListenerTest.java | 0 .../engine/internal/schedule/LiteJobFacadeTest.java | 0 .../engine/internal/schedule/SchedulerFacadeTest.java | 0 .../elasticjob/engine/internal/server/ServerNodeTest.java | 0 .../elasticjob/engine/internal/server/ServerServiceTest.java | 0 .../internal/setup/DefaultJobClassNameProviderTest.java | 0 .../internal/setup/JobClassNameProviderFactoryTest.java | 0 .../elasticjob/engine/internal/setup/SetUpFacadeTest.java | 0 .../engine/internal/sharding/ExecutionContextServiceTest.java | 0 .../engine/internal/sharding/ExecutionServiceTest.java | 0 .../sharding/MonitorExecutionListenerManagerTest.java | 0 .../engine/internal/sharding/ShardingListenerManagerTest.java | 0 .../elasticjob/engine/internal/sharding/ShardingNodeTest.java | 0 .../engine/internal/sharding/ShardingServiceTest.java | 0 .../engine/internal/snapshot/BaseSnapshotServiceTest.java | 0 .../engine/internal/snapshot/SnapshotServiceDisableTest.java | 0 .../engine/internal/snapshot/SnapshotServiceEnableTest.java | 0 .../elasticjob/engine/internal/snapshot/SocketUtils.java | 0 .../elasticjob/engine/internal/storage/JobNodePathTest.java | 0 .../engine/internal/storage/JobNodeStorageTest.java | 0 .../engine/internal/trigger/TriggerListenerManagerTest.java | 0 .../engine/internal/util/SensitiveInfoUtilsTest.java | 0 .../elasticjob/engine/util/ReflectionUtils.java | 0 ...phere.elasticjob.executor.item.impl.ClassedJobItemExecutor | 0 ...hardingsphere.elasticjob.infra.listener.ElasticJobListener | 0 {core => kernel}/src/test/resources/logback-test.xml | 2 +- lifecycle/pom.xml | 2 +- pom.xml | 4 ++-- .../zookeeper-curator/src/test/resources/logback-test.xml | 2 +- spring/core/pom.xml | 2 +- 141 files changed, 16 insertions(+), 16 deletions(-) rename {core => kernel}/pom.xml (98%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java (100%) rename {core => kernel}/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java (100%) rename {core => kernel}/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java (100%) rename {core => kernel}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor (100%) rename {core => kernel}/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener (100%) rename {core => kernel}/src/test/resources/logback-test.xml (95%) diff --git a/distribution/bin/pom.xml b/distribution/bin/pom.xml index ae91da3250..9d33cc341e 100644 --- a/distribution/bin/pom.xml +++ b/distribution/bin/pom.xml @@ -30,7 +30,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel ${project.version} diff --git a/docs/content/quick-start/_index.cn.md b/docs/content/quick-start/_index.cn.md index d9a6c2e188..6fde4e1571 100644 --- a/docs/content/quick-start/_index.cn.md +++ b/docs/content/quick-start/_index.cn.md @@ -10,7 +10,7 @@ chapter = true ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel ${latest.release.version} ``` diff --git a/docs/content/quick-start/_index.en.md b/docs/content/quick-start/_index.en.md index 19d9dbb23d..356124da83 100644 --- a/docs/content/quick-start/_index.en.md +++ b/docs/content/quick-start/_index.en.md @@ -10,7 +10,7 @@ chapter = true ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel ${latest.release.version} ``` diff --git a/ecosystem/tracing/api/src/test/resources/logback-test.xml b/ecosystem/tracing/api/src/test/resources/logback-test.xml index bd9617984c..ee3f508d5a 100644 --- a/ecosystem/tracing/api/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/api/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml index 1438462bef..17942473ec 100644 --- a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/examples/elasticjob-example-jobs/pom.xml b/examples/elasticjob-example-jobs/pom.xml index 473ff3a193..5d1cedb9c9 100644 --- a/examples/elasticjob-example-jobs/pom.xml +++ b/examples/elasticjob-example-jobs/pom.xml @@ -31,7 +31,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel diff --git a/examples/elasticjob-example-lite-java/pom.xml b/examples/elasticjob-example-lite-java/pom.xml index 24f214bce6..e64fd59d3a 100644 --- a/examples/elasticjob-example-lite-java/pom.xml +++ b/examples/elasticjob-example-lite-java/pom.xml @@ -57,7 +57,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel diff --git a/examples/pom.xml b/examples/pom.xml index 64eb64f03b..3dd7543f30 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -53,7 +53,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel ${revision} diff --git a/infra/src/test/resources/logback-test.xml b/infra/src/test/resources/logback-test.xml index c79142ad07..0184fdda63 100644 --- a/infra/src/test/resources/logback-test.xml +++ b/infra/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/core/pom.xml b/kernel/pom.xml similarity index 98% rename from core/pom.xml rename to kernel/pom.xml index ba731a5505..83a8561039 100644 --- a/core/pom.xml +++ b/kernel/pom.xml @@ -23,7 +23,7 @@ elasticjob 3.1.0-SNAPSHOT - elasticjob-engine-core + elasticjob-kernel ${project.artifactId} diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java diff --git a/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java similarity index 100% rename from core/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java diff --git a/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java similarity index 100% rename from core/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java diff --git a/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor similarity index 100% rename from core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor diff --git a/core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener similarity index 100% rename from core/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener diff --git a/core/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml similarity index 95% rename from core/src/test/resources/logback-test.xml rename to kernel/src/test/resources/logback-test.xml index d7b1eb9c5b..3910420a37 100644 --- a/core/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/lifecycle/pom.xml b/lifecycle/pom.xml index 019475e132..31498a04cc 100644 --- a/lifecycle/pom.xml +++ b/lifecycle/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel ${project.parent.version} diff --git a/pom.xml b/pom.xml index 2361be421d..b6cbdc27ba 100644 --- a/pom.xml +++ b/pom.xml @@ -34,9 +34,9 @@ api registry-center infra - core - restful + kernel lifecycle + restful ecosystem spring distribution diff --git a/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml b/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml index 287aa7dde9..28c1cb65cc 100644 --- a/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml +++ b/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/spring/core/pom.xml b/spring/core/pom.xml index cd2d479050..ef4a2cfa2a 100644 --- a/spring/core/pom.xml +++ b/spring/core/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-core + elasticjob-kernel ${project.parent.version} From 94251106f5c02565083268f5719fded5624d4753 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 13:20:11 +0800 Subject: [PATCH 064/178] Rename elasticjob-lifecycle module name --- .../user-manual/usage/operation-api/_index.cn.md | 12 ++++++------ .../user-manual/usage/operation-api/_index.en.md | 12 ++++++------ lifecycle/pom.xml | 2 +- .../lifecycle/api/JobAPIFactory.java | 16 ++++++++-------- .../lifecycle/api/JobConfigurationAPI.java | 2 +- .../lifecycle/api/JobOperateAPI.java | 2 +- .../lifecycle/api/JobStatisticsAPI.java | 4 ++-- .../lifecycle/api/ServerStatisticsAPI.java | 4 ++-- .../lifecycle/api/ShardingOperateAPI.java | 2 +- .../lifecycle/api/ShardingStatisticsAPI.java | 4 ++-- .../lifecycle/domain/JobBriefInfo.java | 2 +- .../lifecycle/domain/ServerBriefInfo.java | 2 +- .../lifecycle/domain/ShardingInfo.java | 2 +- .../internal/operate/JobOperateAPIImpl.java | 4 ++-- .../internal/operate/ShardingOperateAPIImpl.java | 4 ++-- .../internal/reg/RegistryCenterFactory.java | 2 +- .../settings/JobConfigurationAPIImpl.java | 4 ++-- .../statistics/JobStatisticsAPIImpl.java | 6 +++--- .../statistics/ServerStatisticsAPIImpl.java | 6 +++--- .../statistics/ShardingStatisticsAPIImpl.java | 6 +++--- .../AbstractEmbedZookeeperBaseTest.java | 2 +- .../lifecycle/api/JobAPIFactoryTest.java | 4 ++-- .../lifecycle/domain/ShardingStatusTest.java | 2 +- .../fixture/LifecycleYamlConstants.java | 2 +- .../internal/operate/JobOperateAPIImplTest.java | 4 ++-- .../operate/ShardingOperateAPIImplTest.java | 4 ++-- .../internal/reg/RegistryCenterFactoryTest.java | 4 ++-- .../settings/JobConfigurationAPIImplTest.java | 6 +++--- .../statistics/JobStatisticsAPIImplTest.java | 8 ++++---- .../statistics/ServerStatisticsAPIImplTest.java | 6 +++--- .../ShardingStatisticsAPIImplTest.java | 6 +++--- lifecycle/src/test/resources/logback-test.xml | 2 +- 32 files changed, 74 insertions(+), 74 deletions(-) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/JobAPIFactory.java (84%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/JobConfigurationAPI.java (95%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/JobOperateAPI.java (97%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/JobStatisticsAPI.java (91%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/ServerStatisticsAPI.java (88%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/ShardingOperateAPI.java (94%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/ShardingStatisticsAPI.java (88%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/domain/JobBriefInfo.java (95%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/domain/ServerBriefInfo.java (96%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/domain/ShardingInfo.java (96%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/operate/JobOperateAPIImpl.java (97%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/operate/ShardingOperateAPIImpl.java (92%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/reg/RegistryCenterFactory.java (97%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/settings/JobConfigurationAPIImpl.java (93%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/statistics/JobStatisticsAPIImpl.java (96%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java (93%) rename lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java (92%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/AbstractEmbedZookeeperBaseTest.java (98%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/api/JobAPIFactoryTest.java (93%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/domain/ShardingStatusTest.java (96%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/fixture/LifecycleYamlConstants.java (97%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/operate/JobOperateAPIImplTest.java (98%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/operate/ShardingOperateAPIImplTest.java (91%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/reg/RegistryCenterFactoryTest.java (94%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/settings/JobConfigurationAPIImplTest.java (95%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java (96%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java (94%) rename lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java (95%) diff --git a/docs/content/user-manual/usage/operation-api/_index.cn.md b/docs/content/user-manual/usage/operation-api/_index.cn.md index a3346ae7b9..4cae0e2d22 100644 --- a/docs/content/user-manual/usage/operation-api/_index.cn.md +++ b/docs/content/user-manual/usage/operation-api/_index.cn.md @@ -10,7 +10,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 ## 配置类 API -类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI` +类名称:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI` ### 获取作业配置 @@ -37,7 +37,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 ## 操作类 API -类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI` +类名称:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI` ### 触发作业执行 @@ -85,7 +85,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 ## 操作分片的 API -类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI` +类名称:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI` ### 禁用作业分片 @@ -105,7 +105,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 ## 作业统计 API -类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI` +类名称:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI` ### 获取作业总数 @@ -139,7 +139,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 ## 作业服务器状态展示 API -类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI` +类名称:`org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI` ### 获取作业服务器总数 @@ -155,7 +155,7 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 ## 作业分片状态展示 API -类名称:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI` +类名称:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI` ### 获取作业分片信息集合 diff --git a/docs/content/user-manual/usage/operation-api/_index.en.md b/docs/content/user-manual/usage/operation-api/_index.en.md index 11ade7c643..846fe21379 100644 --- a/docs/content/user-manual/usage/operation-api/_index.en.md +++ b/docs/content/user-manual/usage/operation-api/_index.en.md @@ -10,7 +10,7 @@ The module is still in incubation. ## Configuration API -Class name: `org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI` +Class name: `org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI` ### Get job configuration @@ -37,7 +37,7 @@ Method signature:void removeJobConfiguration(String jobName) ## Operation API -Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI` +Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI` ### Trigger job execution @@ -85,7 +85,7 @@ Method signature:void remove(Optional jobName, Optional server ## Operate sharding API -Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI` +Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI` ### Disable job sharding @@ -105,7 +105,7 @@ Method signature:void enable(String jobName, String item) ## Job statistics API -Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI` +Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI` ### Get the total count of jobs @@ -139,7 +139,7 @@ Method signature:Collection getJobsBriefInfo(String ip) ## Job server status display API -Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI` +Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI` ### Total count of job servers @@ -155,7 +155,7 @@ Method signature:Collection getAllServersBriefInfo() ## Job sharding status display API -Class name:`org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI` +Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI` ### Get job sharding information collection diff --git a/lifecycle/pom.xml b/lifecycle/pom.xml index 31498a04cc..0ee436659d 100644 --- a/lifecycle/pom.xml +++ b/lifecycle/pom.xml @@ -23,7 +23,7 @@ elasticjob 3.1.0-SNAPSHOT - elasticjob-engine-lifecycle + elasticjob-lifecycle ${project.artifactId} diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactory.java similarity index 84% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactory.java index bb9677832a..e37b80cf42 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactory.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactory.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate.JobOperateAPIImpl; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate.ShardingOperateAPIImpl; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.reg.RegistryCenterFactory; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.settings.JobConfigurationAPIImpl; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics.JobStatisticsAPIImpl; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics.ServerStatisticsAPIImpl; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics.ShardingStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.operate.JobOperateAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.operate.ShardingOperateAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.reg.RegistryCenterFactory; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.settings.JobConfigurationAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.JobStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.ServerStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.ShardingStatisticsAPIImpl; /** * Job API factory. diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java similarity index 95% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java index f6f383c942..0425f48738 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobConfigurationAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobOperateAPI.java similarity index 97% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobOperateAPI.java index d5826335bc..48fe82fa51 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobOperateAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobOperateAPI.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; import java.io.IOException; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobStatisticsAPI.java similarity index 91% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobStatisticsAPI.java index 17f3549f7b..361987a089 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobStatisticsAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobStatisticsAPI.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.JobBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.JobBriefInfo; import java.util.Collection; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ServerStatisticsAPI.java similarity index 88% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ServerStatisticsAPI.java index 4f36052c8f..66855d125d 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ServerStatisticsAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ServerStatisticsAPI.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ServerBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ServerBriefInfo; import java.util.Collection; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ShardingOperateAPI.java similarity index 94% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ShardingOperateAPI.java index 8bbf8dde34..a60c42dd0b 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingOperateAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ShardingOperateAPI.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; /** * Sharding operate API. diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ShardingStatisticsAPI.java similarity index 88% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ShardingStatisticsAPI.java index e1cdb61dd2..9f8fd4fd8c 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/ShardingStatisticsAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/ShardingStatisticsAPI.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ShardingInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ShardingInfo; import java.util.Collection; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/JobBriefInfo.java similarity index 95% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/JobBriefInfo.java index 0b269ce8ae..59d7286937 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/JobBriefInfo.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/JobBriefInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.lifecycle.domain; import lombok.Getter; import lombok.Setter; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ServerBriefInfo.java similarity index 96% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ServerBriefInfo.java index eb03255faf..1c6e08cde6 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ServerBriefInfo.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ServerBriefInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.lifecycle.domain; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ShardingInfo.java similarity index 96% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ShardingInfo.java index 111e16f981..fb0cf13d94 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingInfo.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ShardingInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.lifecycle.domain; import lombok.Getter; import lombok.Setter; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java similarity index 97% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java index 09f519ee84..899a2e7b13 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.operate; import com.google.common.base.Preconditions; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.io.IOException; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImpl.java similarity index 92% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImpl.java index be8f6e498f..58ea9020f7 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImpl.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.operate; import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactory.java similarity index 97% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactory.java index 8789f26d88..dc63c17fbe 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactory.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.reg; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.reg; import com.google.common.base.Strings; import com.google.common.hash.HashCode; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java similarity index 93% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java index 3bc737b54b..39150556cc 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.settings; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.settings; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java similarity index 96% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index 99a02d05fb..e3bd455af1 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.JobBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.JobBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java similarity index 93% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java index 6b0eab5ac9..edbe7b3815 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ServerBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ServerBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java similarity index 92% rename from lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java rename to lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java index 93cd8803a6..097dd652dd 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ShardingInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ShardingInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/AbstractEmbedZookeeperBaseTest.java similarity index 98% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/AbstractEmbedZookeeperBaseTest.java index 7f370328b7..b2ab7d1bde 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/AbstractEmbedZookeeperBaseTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/AbstractEmbedZookeeperBaseTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle; +package org.apache.shardingsphere.elasticjob.lifecycle; import lombok.extern.slf4j.Slf4j; import org.apache.curator.framework.CuratorFramework; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java similarity index 93% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java index 59726e7508..53eb758cbd 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/api/JobAPIFactoryTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.api; +package org.apache.shardingsphere.elasticjob.lifecycle.api; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.AbstractEmbedZookeeperBaseTest; +import org.apache.shardingsphere.elasticjob.lifecycle.AbstractEmbedZookeeperBaseTest; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ShardingStatusTest.java similarity index 96% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ShardingStatusTest.java index e4b2803e77..3c4deaa911 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/domain/ShardingStatusTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/domain/ShardingStatusTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.domain; +package org.apache.shardingsphere.elasticjob.lifecycle.domain; import org.junit.jupiter.api.Test; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/fixture/LifecycleYamlConstants.java similarity index 97% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/fixture/LifecycleYamlConstants.java index c8a0f6a9e5..bf4b710da7 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/fixture/LifecycleYamlConstants.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/fixture/LifecycleYamlConstants.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.fixture; +package org.apache.shardingsphere.elasticjob.lifecycle.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImplTest.java similarity index 98% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImplTest.java index 2462a71886..d42db686fa 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/JobOperateAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImplTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.operate; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobOperateAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImplTest.java similarity index 91% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImplTest.java index 92fefd9d98..1a0ed2e9a3 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/operate/ShardingOperateAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImplTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.operate; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.operate; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingOperateAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java similarity index 94% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java index bd8e9d245b..22c6eaaa09 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/reg/RegistryCenterFactoryTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.reg; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.reg; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.AbstractEmbedZookeeperBaseTest; +import org.apache.shardingsphere.elasticjob.lifecycle.AbstractEmbedZookeeperBaseTest; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java similarity index 95% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java index 7184da3d0b..93793787de 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/settings/JobConfigurationAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.settings; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.settings; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobConfigurationAPI; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.fixture.LifecycleYamlConstants; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.fixture.LifecycleYamlConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; import org.junit.jupiter.api.BeforeEach; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java similarity index 96% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java index 4085ec6b44..1c4a3b0805 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImplTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.JobStatisticsAPI; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.JobBriefInfo; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.fixture.LifecycleYamlConstants; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.JobBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.fixture.LifecycleYamlConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java similarity index 94% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java index a502c2a96a..f1e71fe25a 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImplTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ServerStatisticsAPI; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ServerBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ServerBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java similarity index 95% rename from lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java rename to lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java index 98a60d2b71..863bf8bd04 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/engine/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImplTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.lifecycle.internal.statistics; +package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.api.ShardingStatisticsAPI; -import org.apache.shardingsphere.elasticjob.engine.lifecycle.domain.ShardingInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ShardingInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/lifecycle/src/test/resources/logback-test.xml b/lifecycle/src/test/resources/logback-test.xml index 5c47f5f36c..0e0ccda830 100644 --- a/lifecycle/src/test/resources/logback-test.xml +++ b/lifecycle/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + From 00abb85954a5adc8c1197e2bd87441cd7bc590d3 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 13:20:31 +0800 Subject: [PATCH 065/178] Rename elasticjob-lifecycle module name --- .../lifecycle/internal/statistics/JobStatisticsAPIImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index e3bd455af1..7e745eb95e 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -113,7 +113,7 @@ private boolean isHasShardingFlag(final JobNodePath jobNodePath, final List(instances).containsAll(shardingInstances) || shardingInstances.isEmpty(); } private int getJobInstanceCount(final String jobName) { From cf74040e9aab1d565177781e9d2b00fea8006d01 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 14:03:26 +0800 Subject: [PATCH 066/178] Refactor elasticjob-spring module --- distribution/bin/pom.xml | 4 ++-- .../configuration/spring-boot-starter.cn.md | 8 +++---- .../configuration/spring-boot-starter.en.md | 8 +++---- .../configuration/spring-namespace.cn.md | 4 ++-- .../configuration/spring-namespace.en.md | 4 ++-- .../usage/job-api/spring-boot-starter.cn.md | 2 +- .../usage/job-api/spring-boot-starter.en.md | 2 +- .../usage/tracing/spring-boot-starter.cn.md | 2 +- .../usage/tracing/spring-boot-starter.en.md | 2 +- .../usage/tracing/spring-namespace.cn.md | 4 ++-- .../usage/tracing/spring-namespace.en.md | 2 +- .../elasticjob-example-lite-spring/pom.xml | 2 +- .../pom.xml | 2 +- .../src/main/resources/application.yml | 2 +- examples/pom.xml | 2 +- spring/boot-starter/README.md | 4 ++-- spring/boot-starter/pom.xml | 6 ++--- .../job/ElasticJobBootstrapConfiguration.java | 4 ++-- .../ElasticJobConfigurationProperties.java | 2 +- .../job/ElasticJobLiteAutoConfiguration.java | 8 +++---- .../spring/boot/job/ElasticJobProperties.java | 2 +- .../ScheduleJobBootstrapStartupRunner.java | 2 +- ...ElasticJobRegistryCenterConfiguration.java | 2 +- .../spring/boot/reg/ZookeeperProperties.java | 2 +- ...lasticJobSnapshotServiceConfiguration.java | 2 +- .../snapshot/SnapshotServiceProperties.java | 2 +- .../ElasticJobTracingConfiguration.java | 2 +- .../boot/tracing/TracingProperties.java | 2 +- ...itional-spring-configuration-metadata.json | 22 +++++++++---------- .../main/resources/META-INF/spring.factories | 2 +- .../main/resources/META-INF/spring.provides | 2 +- ...ot.autoconfigure.AutoConfiguration.imports | 2 +- ...ElasticJobConfigurationPropertiesTest.java | 2 +- .../job/ElasticJobSpringBootScannerTest.java | 10 ++++----- .../boot/job/ElasticJobSpringBootTest.java | 12 +++++----- .../executor/CustomClassedJobExecutor.java | 4 ++-- .../boot/job/executor/PrintJobExecutor.java | 2 +- .../boot/job/executor/PrintJobProperties.java | 2 +- .../boot/job/fixture/EmbedTestingServer.java | 2 +- .../boot/job/fixture/job/CustomJob.java | 2 +- .../fixture/job/impl/AnnotationCustomJob.java | 4 ++-- .../job/fixture/job/impl/CustomTestJob.java | 6 ++--- .../listener/LogElasticJobListener.java | 2 +- .../listener/NoopElasticJobListener.java | 2 +- .../boot/job/repository/BarRepository.java | 2 +- .../repository/impl/BarRepositoryImpl.java | 4 ++-- .../boot/reg/ZookeeperPropertiesTest.java | 2 +- ...icJobSnapshotServiceConfigurationTest.java | 4 ++-- .../tracing/TracingConfigurationTest.java | 4 ++-- ....executor.item.impl.ClassedJobItemExecutor | 2 +- ...ob.executor.item.impl.TypedJobItemExecutor | 2 +- ...asticjob.infra.listener.ElasticJobListener | 4 ++-- .../test/resources/application-elasticjob.yml | 6 ++--- .../test/resources/application-snapshot.yml | 2 +- .../test/resources/application-tracing.yml | 2 +- spring/core/pom.xml | 4 ++-- .../core/scanner/ClassPathJobScanner.java | 2 +- .../spring/core/scanner/ElasticJobScan.java | 2 +- .../core/scanner/ElasticJobScanRegistrar.java | 2 +- .../core/scanner/JobScannerConfiguration.java | 2 +- .../SpringProxyJobClassNameProvider.java | 4 ++-- .../spring/core/util/AopTargetUtils.java | 2 +- ...engine.internal.setup.JobClassNameProvider | 2 +- .../JobClassNameProviderFactoryTest.java | 2 +- .../spring/core/util/AopTargetUtilsTest.java | 2 +- .../spring/core/util/TargetJob.java | 2 +- spring/namespace/pom.xml | 6 ++--- .../namespace/ElasticJobNamespaceHandler.java | 12 +++++----- .../job/parser/JobBeanDefinitionParser.java | 4 ++-- .../job/tag/JobBeanDefinitionTag.java | 2 +- .../parser/ZookeeperBeanDefinitionParser.java | 4 ++-- .../reg/tag/ZookeeperBeanDefinitionTag.java | 2 +- .../JobScannerBeanDefinitionParser.java | 6 ++--- .../tag/JobScannerBeanDefinitionTag.java | 2 +- .../parser/SnapshotBeanDefinitionParser.java | 4 ++-- .../tag/SnapshotBeanDefinitionTag.java | 2 +- .../parser/TracingBeanDefinitionParser.java | 4 ++-- .../tracing/tag/TracingBeanDefinitionTag.java | 2 +- .../main/resources/META-INF/spring.handlers | 2 +- .../fixture/aspect/SimpleAspect.java | 4 ++-- .../fixture/job/DataflowElasticJob.java | 2 +- .../fixture/job/FooSimpleElasticJob.java | 2 +- .../job/annotation/AnnotationSimpleJob.java | 2 +- .../job/ref/RefFooDataflowElasticJob.java | 4 ++-- .../job/ref/RefFooSimpleElasticJob.java | 4 ++-- .../fixture/listener/SimpleCglibListener.java | 2 +- .../SimpleJdkDynamicProxyListener.java | 2 +- .../fixture/listener/SimpleListener.java | 2 +- .../fixture/listener/SimpleOnceListener.java | 4 ++-- .../namespace/fixture/service/FooService.java | 2 +- .../fixture/service/FooServiceImpl.java | 2 +- .../job/AbstractJobSpringIntegrateTest.java | 8 +++---- .../AbstractOneOffJobSpringIntegrateTest.java | 8 +++---- ...bSpringNamespaceWithEventTraceRdbTest.java | 2 +- .../JobSpringNamespaceWithJobHandlerTest.java | 2 +- ...ringNamespaceWithListenerAndCglibTest.java | 2 +- ...aceWithListenerAndJdkDynamicProxyTest.java | 2 +- .../JobSpringNamespaceWithListenerTest.java | 2 +- .../job/JobSpringNamespaceWithRefTest.java | 6 ++--- .../job/JobSpringNamespaceWithTypeTest.java | 4 ++-- ...JobSpringNamespaceWithoutListenerTest.java | 2 +- ...bSpringNamespaceWithEventTraceRdbTest.java | 2 +- ...fJobSpringNamespaceWithJobHandlerTest.java | 2 +- ...ringNamespaceWithListenerAndCglibTest.java | 2 +- ...aceWithListenerAndJdkDynamicProxyTest.java | 2 +- ...OffJobSpringNamespaceWithListenerTest.java | 2 +- .../OneOffJobSpringNamespaceWithRefTest.java | 6 ++--- .../OneOffJobSpringNamespaceWithTypeTest.java | 4 ++-- ...JobSpringNamespaceWithoutListenerTest.java | 2 +- .../AbstractJobSpringIntegrateTest.java | 6 ++--- .../namespace/scanner/JobScannerTest.java | 2 +- .../SnapshotSpringNamespaceDisableTest.java | 4 ++-- .../SnapshotSpringNamespaceEnableTest.java | 4 ++-- .../namespace/snapshot/SocketUtils.java | 2 +- ...okeeperJUnitJupiterSpringContextTests.java | 2 +- .../EmbedZookeeperTestExecutionListener.java | 2 +- .../src/test/resources/META-INF/job/base.xml | 2 +- .../META-INF/job/oneOffWithEventTraceRdb.xml | 4 ++-- .../META-INF/job/oneOffWithJobHandler.xml | 4 ++-- .../META-INF/job/oneOffWithJobRef.xml | 4 ++-- .../META-INF/job/oneOffWithListener.xml | 4 ++-- .../job/oneOffWithListenerAndCglib.xml | 6 ++--- .../oneOffWithListenerAndJdkDynamicProxy.xml | 6 ++--- .../META-INF/job/oneOffWithoutListener.xml | 4 ++-- .../META-INF/job/withEventTraceRdb.xml | 4 ++-- .../resources/META-INF/job/withJobHandler.xml | 4 ++-- .../resources/META-INF/job/withJobRef.xml | 4 ++-- .../resources/META-INF/job/withListener.xml | 4 ++-- .../META-INF/job/withListenerAndCglib.xml | 6 ++--- .../job/withListenerAndJdkDynamicProxy.xml | 6 ++--- .../META-INF/job/withoutListener.xml | 4 ++-- .../META-INF/scanner/jobScannerContext.xml | 2 +- ...asticjob.infra.listener.ElasticJobListener | 8 +++---- .../test/resources/conf/job/conf.properties | 4 ++-- spring/pom.xml | 2 +- 135 files changed, 238 insertions(+), 238 deletions(-) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ElasticJobBootstrapConfiguration.java (98%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ElasticJobConfigurationProperties.java (97%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ElasticJobLiteAutoConfiguration.java (82%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ElasticJobProperties.java (94%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ScheduleJobBootstrapStartupRunner.java (95%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java (95%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/reg/ZookeeperProperties.java (97%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java (96%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/reg/snapshot/SnapshotServiceProperties.java (93%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/tracing/ElasticJobTracingConfiguration.java (97%) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/tracing/TracingProperties.java (94%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ElasticJobConfigurationPropertiesTest.java (98%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ElasticJobSpringBootScannerTest.java (84%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/ElasticJobSpringBootTest.java (94%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/executor/CustomClassedJobExecutor.java (90%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/executor/PrintJobExecutor.java (95%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/executor/PrintJobProperties.java (92%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/fixture/EmbedTestingServer.java (98%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/fixture/job/CustomJob.java (93%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java (91%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/fixture/job/impl/CustomTestJob.java (86%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/fixture/listener/LogElasticJobListener.java (94%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/fixture/listener/NoopElasticJobListener.java (94%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/repository/BarRepository.java (92%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/job/repository/impl/BarRepositoryImpl.java (86%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/reg/ZookeeperPropertiesTest.java (97%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java (91%) rename spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/boot/tracing/TracingConfigurationTest.java (92%) rename spring/core/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/scanner/ClassPathJobScanner.java (98%) rename spring/core/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/scanner/ElasticJobScan.java (95%) rename spring/core/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/scanner/ElasticJobScanRegistrar.java (97%) rename spring/core/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/scanner/JobScannerConfiguration.java (96%) rename spring/core/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/setup/SpringProxyJobClassNameProvider.java (91%) rename spring/core/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/util/AopTargetUtils.java (97%) rename spring/core/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/setup/JobClassNameProviderFactoryTest.java (94%) rename spring/core/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/util/AopTargetUtilsTest.java (96%) rename spring/core/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/core/util/TargetJob.java (94%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/ElasticJobNamespaceHandler.java (70%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/parser/JobBeanDefinitionParser.java (97%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/tag/JobBeanDefinitionTag.java (97%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java (95%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java (95%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java (85%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java (92%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java (90%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java (93%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java (90%) rename spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java (92%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/aspect/SimpleAspect.java (92%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/job/DataflowElasticJob.java (95%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/job/FooSimpleElasticJob.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java (95%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java (90%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java (88%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/listener/SimpleCglibListener.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/listener/SimpleListener.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/listener/SimpleOnceListener.java (92%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/service/FooService.java (91%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/fixture/service/FooServiceImpl.java (91%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/AbstractJobSpringIntegrateTest.java (87%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java (89%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithListenerTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithRefTest.java (88%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithTypeTest.java (92%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java (90%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java (92%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java (94%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java (88%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/scanner/JobScannerTest.java (93%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java (87%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java (86%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/snapshot/SocketUtils.java (95%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java (95%) rename spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/{engine => }/spring/namespace/test/EmbedZookeeperTestExecutionListener.java (98%) diff --git a/distribution/bin/pom.xml b/distribution/bin/pom.xml index 9d33cc341e..ff1e411467 100644 --- a/distribution/bin/pom.xml +++ b/distribution/bin/pom.xml @@ -35,12 +35,12 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-namespace + elasticjob-spring-namespace ${project.version} org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-boot-starter + elasticjob-spring-boot-starter ${project.version} diff --git a/docs/content/user-manual/configuration/spring-boot-starter.cn.md b/docs/content/user-manual/configuration/spring-boot-starter.cn.md index f4f8f405be..c0de545e29 100644 --- a/docs/content/user-manual/configuration/spring-boot-starter.cn.md +++ b/docs/content/user-manual/configuration/spring-boot-starter.cn.md @@ -4,12 +4,12 @@ weight = 2 chapter = true +++ -使用 Spring-boot 需在 pom.xml 文件中添加 elasticjob-engine-spring-boot-starter 模块的依赖。 +使用 Spring-boot 需在 pom.xml 文件中添加 elasticjob-spring-boot-starter 模块的依赖。 ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-boot-starter + elasticjob-spring-boot-starter ${latest.release.version} ``` @@ -38,12 +38,12 @@ chapter = true elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-engine-springboot + namespace: elasticjob-springboot ``` **Properties** ``` -elasticjob.reg-center.namespace=elasticjob-engine-springboot +elasticjob.reg-center.namespace=elasticjob-springboot elasticjob.reg-center.server-lists=localhost:6181 ``` diff --git a/docs/content/user-manual/configuration/spring-boot-starter.en.md b/docs/content/user-manual/configuration/spring-boot-starter.en.md index ae7afd8a72..b294ca11cb 100644 --- a/docs/content/user-manual/configuration/spring-boot-starter.en.md +++ b/docs/content/user-manual/configuration/spring-boot-starter.en.md @@ -4,12 +4,12 @@ weight = 2 chapter = true +++ -To use the Spring boot, user need to add the dependency of the `elasticjob-engine-spring-boot-starter` module in the `pom.xml` file. +To use the Spring boot, user need to add the dependency of the `elasticjob-spring-boot-starter` module in the `pom.xml` file. ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-boot-starter + elasticjob-spring-boot-starter ${latest.release.version} ``` @@ -38,12 +38,12 @@ Reference: elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-engine-springboot + namespace: elasticjob-springboot ``` **Properties** ``` -elasticjob.reg-center.namespace=elasticjob-engine-springboot +elasticjob.reg-center.namespace=elasticjob-springboot elasticjob.reg-center.server-lists=localhost:6181 ``` diff --git a/docs/content/user-manual/configuration/spring-namespace.cn.md b/docs/content/user-manual/configuration/spring-namespace.cn.md index af51309b20..8744645027 100644 --- a/docs/content/user-manual/configuration/spring-namespace.cn.md +++ b/docs/content/user-manual/configuration/spring-namespace.cn.md @@ -4,12 +4,12 @@ weight = 3 chapter = true +++ -使用 Spring 命名空间需在 pom.xml 文件中添加 elasticjob-engine-spring 模块的依赖。 +使用 Spring 命名空间需在 pom.xml 文件中添加 elasticjob-spring 模块的依赖。 ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-namespace + elasticjob-spring-namespace ${latest.release.version} ``` diff --git a/docs/content/user-manual/configuration/spring-namespace.en.md b/docs/content/user-manual/configuration/spring-namespace.en.md index 4ece71528e..28e91b4dd5 100644 --- a/docs/content/user-manual/configuration/spring-namespace.en.md +++ b/docs/content/user-manual/configuration/spring-namespace.en.md @@ -4,12 +4,12 @@ weight = 2 chapter = true +++ -To use the Spring namespace, user need to add the dependency of the `elasticjob-engine-spring` module in the `pom.xml` file. +To use the Spring namespace, user need to add the dependency of the `elasticjob-spring` module in the `pom.xml` file. ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-namespace + elasticjob-spring-namespace ${latest.release.version} ``` diff --git a/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md b/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md index 1ae7a81ef2..e21e6f849d 100644 --- a/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md +++ b/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md @@ -48,7 +48,7 @@ Starter 会根据该配置自动创建 `OneOffJobBootstrap` 或 `ScheduleJobBoot elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-engine-springboot + namespace: elasticjob-springboot jobs: dataflowJob: elasticJobClass: org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob diff --git a/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md b/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md index 3a54a8c019..2592c27092 100644 --- a/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md +++ b/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md @@ -49,7 +49,7 @@ Configuration reference: elasticjob: regCenter: serverLists: localhost:6181 - namespace: elasticjob-engine-springboot + namespace: elasticjob-springboot jobs: dataflowJob: elasticJobClass: org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob diff --git a/docs/content/user-manual/usage/tracing/spring-boot-starter.cn.md b/docs/content/user-manual/usage/tracing/spring-boot-starter.cn.md index 4bc5980511..e817e106df 100644 --- a/docs/content/user-manual/usage/tracing/spring-boot-starter.cn.md +++ b/docs/content/user-manual/usage/tracing/spring-boot-starter.cn.md @@ -37,5 +37,5 @@ elasticjob: ## 作业启动 -指定事件追踪数据源类型为 RDB,TracingConfiguration 会自动注册到容器中,如果与 elasticjob-engine-spring-boot-starter 配合使用, +指定事件追踪数据源类型为 RDB,TracingConfiguration 会自动注册到容器中,如果与 elasticjob-spring-boot-starter 配合使用, 开发者无需进行其他额外的操作,作业启动器会自动使用创建的 TracingConfiguration。 diff --git a/docs/content/user-manual/usage/tracing/spring-boot-starter.en.md b/docs/content/user-manual/usage/tracing/spring-boot-starter.en.md index bb38e471cf..2b2e9619fa 100644 --- a/docs/content/user-manual/usage/tracing/spring-boot-starter.en.md +++ b/docs/content/user-manual/usage/tracing/spring-boot-starter.en.md @@ -38,5 +38,5 @@ elasticjob: ## Job Start TracingConfiguration will be registered into the IoC container imperceptibly after setting tracing type to RDB. -If elasticjob-engine-spring-boot-starter was imported, developers need to do nothing else. +If elasticjob-spring-boot-starter was imported, developers need to do nothing else. The instances of JobBootstrap will use the TracingConfiguration automatically. diff --git a/docs/content/user-manual/usage/tracing/spring-namespace.cn.md b/docs/content/user-manual/usage/tracing/spring-namespace.cn.md index 810c05cd57..bb5c497ef2 100644 --- a/docs/content/user-manual/usage/tracing/spring-namespace.cn.md +++ b/docs/content/user-manual/usage/tracing/spring-namespace.cn.md @@ -6,12 +6,12 @@ chapter = true ## 引入 Maven 依赖 -引入 elasticjob-engine-spring +引入 elasticjob-spring ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-namespace + elasticjob-spring-namespace ${elasticjob.latest.version} ``` diff --git a/docs/content/user-manual/usage/tracing/spring-namespace.en.md b/docs/content/user-manual/usage/tracing/spring-namespace.en.md index e36bd0434c..d5f68f07f1 100644 --- a/docs/content/user-manual/usage/tracing/spring-namespace.en.md +++ b/docs/content/user-manual/usage/tracing/spring-namespace.en.md @@ -9,7 +9,7 @@ chapter = true ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-namespace + elasticjob-spring-namespace ${elasticjob.latest.version} ``` diff --git a/examples/elasticjob-example-lite-spring/pom.xml b/examples/elasticjob-example-lite-spring/pom.xml index 6c01294512..4f3b2043f7 100644 --- a/examples/elasticjob-example-lite-spring/pom.xml +++ b/examples/elasticjob-example-lite-spring/pom.xml @@ -57,7 +57,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-namespace + elasticjob-spring-namespace diff --git a/examples/elasticjob-example-lite-springboot/pom.xml b/examples/elasticjob-example-lite-springboot/pom.xml index 009b9b6535..125be9b2e8 100644 --- a/examples/elasticjob-example-lite-springboot/pom.xml +++ b/examples/elasticjob-example-lite-springboot/pom.xml @@ -46,7 +46,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-boot-starter + elasticjob-spring-boot-starter ${project.version} diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml index 11c5c0b6df..f3be9ed814 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml +++ b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml @@ -7,7 +7,7 @@ elasticjob: type: RDB regCenter: serverLists: localhost:6181 - namespace: elasticjob-engine-springboot + namespace: elasticjob-springboot jobs: simpleJob: elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob diff --git a/examples/pom.xml b/examples/pom.xml index 3dd7543f30..15918249c6 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -63,7 +63,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-namespace + elasticjob-spring-namespace ${revision} diff --git a/spring/boot-starter/README.md b/spring/boot-starter/README.md index a113684e3d..4634008ebe 100644 --- a/spring/boot-starter/README.md +++ b/spring/boot-starter/README.md @@ -7,7 +7,7 @@ ```xml org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-boot-starter + elasticjob-spring-boot-starter ${latest.version} ``` @@ -52,7 +52,7 @@ elasticjob: type: RDB regCenter: serverLists: localhost:6181 - namespace: elasticjob-engine-springboot + namespace: elasticjob-springboot jobs: classed: org.apache.shardingsphere.elasticjob.simple.job.SimpleJob: diff --git a/spring/boot-starter/pom.xml b/spring/boot-starter/pom.xml index dfbd074fe2..805c895f81 100644 --- a/spring/boot-starter/pom.xml +++ b/spring/boot-starter/pom.xml @@ -20,16 +20,16 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-engine-spring + elasticjob-spring 3.1.0-SNAPSHOT - elasticjob-engine-spring-boot-starter + elasticjob-spring-boot-starter ${project.artifactId} org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-core + elasticjob-spring-core ${project.parent.version} diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java similarity index 98% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index 096537171b..2895efde50 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; import com.google.common.base.Preconditions; import com.google.common.base.Strings; @@ -25,7 +25,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing.TracingProperties; +import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.springframework.beans.factory.BeanCreationException; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationProperties.java similarity index 97% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationProperties.java index 93ff44cc31..f3ef7bceac 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationProperties.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; import lombok.Getter; import lombok.Setter; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobLiteAutoConfiguration.java similarity index 82% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobLiteAutoConfiguration.java index 5adc514479..d6ed04b500 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobLiteAutoConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobLiteAutoConfiguration.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ElasticJobRegistryCenterConfiguration; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot.ElasticJobSnapshotServiceConfiguration; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing.ElasticJobTracingConfiguration; +import org.apache.shardingsphere.elasticjob.spring.boot.reg.ElasticJobRegistryCenterConfiguration; +import org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot.ElasticJobSnapshotServiceConfiguration; +import org.apache.shardingsphere.elasticjob.spring.boot.tracing.ElasticJobTracingConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobProperties.java similarity index 94% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobProperties.java index 75c3cc508c..4c1d2e8a3b 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobProperties.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; import lombok.Getter; import lombok.Setter; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java similarity index 95% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java index fd4768481e..423f37e7eb 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ScheduleJobBootstrapStartupRunner.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; import lombok.Setter; import lombok.extern.slf4j.Slf4j; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java similarity index 95% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java index ed980afe1d..c6b749c344 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ElasticJobRegistryCenterConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg; +package org.apache.shardingsphere.elasticjob.spring.boot.reg; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperProperties.java similarity index 97% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperProperties.java index 6af78fa634..8267a42950 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperProperties.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg; +package org.apache.shardingsphere.elasticjob.spring.boot.reg; import lombok.Getter; import lombok.Setter; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java similarity index 96% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java index 809b4dacbb..1fdaf4dc0a 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot; +package org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot; import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/SnapshotServiceProperties.java similarity index 93% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/SnapshotServiceProperties.java index 61bd7550eb..11fc54877e 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/SnapshotServiceProperties.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/SnapshotServiceProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot; +package org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot; import lombok.Getter; import lombok.Setter; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java similarity index 97% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java index 1536b584f9..86233220c1 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing; +package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingProperties.java similarity index 94% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingProperties.java index 333b8bce2f..d34fc18cb9 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingProperties.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing; +package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import lombok.Getter; import lombok.Setter; diff --git a/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 99940422d8..5dcbcc73a6 100644 --- a/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring/boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -19,7 +19,7 @@ "groups": [ { "name": "elasticjob.reg-center", - "type": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties", + "type": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties", "description": "Registry Center configurations." }, { @@ -36,52 +36,52 @@ "name": "elasticjob.reg-center.server-lists", "type": "java.lang.String", "description": "Include IP addresses and ports. Multiple IP address split by comma.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.namespace", "type": "java.lang.String", "description": "Namespace.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.base-sleep-time-milliseconds", "type": "java.lang.Integer", "defaultValue": 1000, "description": "Base sleep time milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.max-sleep-time-milliseconds", "type": "java.lang.Integer", "defaultValue": 3000, "description": "Max sleep time milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.max-retries", "type": "java.lang.Integer", "defaultValue": 3, "description": "Max retry times.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.session-timeout-milliseconds", "type": "java.lang.Integer", "description": "Session timeout milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.connection-timeout-milliseconds", "type": "java.lang.Integer", "description": "Connection timeout milliseconds.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.reg-center.digest", "type": "java.lang.String", "description": "Zookeeper digest.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties" }, { "name": "elasticjob.tracing.type", @@ -102,13 +102,13 @@ }, { "name": "elasticjob.jobs", - "type": "java.util.Map" + "type": "java.util.Map" }, { "name": "elasticjob.dump.port", "type": "java.lang.Integer", "description": "A port for configuring SnapshotService.", - "sourceType": "org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot.SnapshotServiceProperties" + "sourceType": "org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot.SnapshotServiceProperties" }, { "name": "elasticjob.dump.enabled", diff --git a/spring/boot-starter/src/main/resources/META-INF/spring.factories b/spring/boot-starter/src/main/resources/META-INF/spring.factories index 318d6fed79..72ca9c32e4 100644 --- a/spring/boot-starter/src/main/resources/META-INF/spring.factories +++ b/spring/boot-starter/src/main/resources/META-INF/spring.factories @@ -15,4 +15,4 @@ # limitations under the License. # org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.apache.shardingsphere.elasticjob.engine.spring.boot.job.ElasticJobLiteAutoConfiguration + org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobLiteAutoConfiguration diff --git a/spring/boot-starter/src/main/resources/META-INF/spring.provides b/spring/boot-starter/src/main/resources/META-INF/spring.provides index 8d0b5bb9b2..366410bf30 100644 --- a/spring/boot-starter/src/main/resources/META-INF/spring.provides +++ b/spring/boot-starter/src/main/resources/META-INF/spring.provides @@ -15,4 +15,4 @@ # limitations under the License. # -provides: elasticjob-engine-spring-boot-starter +provides: elasticjob-spring-boot-starter diff --git a/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index c38136983e..c008333f6b 100644 --- a/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.spring.boot.job.ElasticJobLiteAutoConfiguration +org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobLiteAutoConfiguration diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationPropertiesTest.java similarity index 98% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationPropertiesTest.java index 6c68a8a875..19f2e81a62 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobConfigurationPropertiesTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationPropertiesTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java similarity index 84% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java index 91bf473921..a8e2984215 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.AnnotationCustomJob; -import org.apache.shardingsphere.elasticjob.engine.spring.core.scanner.ElasticJobScan; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.AnnotationCustomJob; +import org.apache.shardingsphere.elasticjob.spring.core.scanner.ElasticJobScan; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -38,7 +38,7 @@ @SpringBootTest @ActiveProfiles("elasticjob") -@ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl") +@ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl") class ElasticJobSpringBootScannerTest { @Autowired diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java similarity index 94% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 0e72713573..4d9860908c 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; @@ -23,10 +23,10 @@ import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.CustomTestJob; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.ZookeeperProperties; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing.TracingProperties; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob; +import org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties; +import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; @@ -74,7 +74,7 @@ void assertZookeeperProperties() { assertNotNull(applicationContext); ZookeeperProperties actual = applicationContext.getBean(ZookeeperProperties.class); assertThat(actual.getServerLists(), is(EmbedTestingServer.getConnectionString())); - assertThat(actual.getNamespace(), is("elasticjob-engine-spring-boot-starter")); + assertThat(actual.getNamespace(), is("elasticjob-spring-boot-starter")); } @Test diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java similarity index 90% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java index 0c81737e2d..eb558d1a64 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/CustomClassedJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor; +package org.apache.shardingsphere.elasticjob.spring.boot.job.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.executor.JobFacade; import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.CustomJob; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; public final class CustomClassedJobExecutor implements ClassedJobItemExecutor { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java similarity index 95% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java index 077d6da747..35479eb174 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor; +package org.apache.shardingsphere.elasticjob.spring.boot.job.executor; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobProperties.java similarity index 92% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobProperties.java index ad60a48e02..2ae9df5c22 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/executor/PrintJobProperties.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor; +package org.apache.shardingsphere.elasticjob.spring.boot.job.executor; public final class PrintJobProperties { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/EmbedTestingServer.java similarity index 98% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/EmbedTestingServer.java index e226e5ea9e..dacd73e0c9 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/EmbedTestingServer.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/EmbedTestingServer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture; +package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java similarity index 93% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java index fbfc1669e2..5533160ff8 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/CustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job; +package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java similarity index 91% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java index d388dfdf7f..7ce8dcf247 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl; +package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.CustomJob; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; import org.springframework.transaction.annotation.Transactional; @Slf4j diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java similarity index 86% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java index de81b265e2..19633b9202 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/job/impl/CustomTestJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl; +package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.CustomJob; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository.BarRepository; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; +import org.apache.shardingsphere.elasticjob.spring.boot.job.repository.BarRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java similarity index 94% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java index 30025e94c2..b55e1c8d91 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/LogElasticJobListener.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener; +package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java similarity index 94% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java index 0e36c9d612..cf1940c2eb 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/fixture/listener/NoopElasticJobListener.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener; +package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/repository/BarRepository.java similarity index 92% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/repository/BarRepository.java index 31510b3eda..e1a7e620d3 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/BarRepository.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/repository/BarRepository.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository; +package org.apache.shardingsphere.elasticjob.spring.boot.job.repository; /** * Bar Repository. diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/repository/impl/BarRepositoryImpl.java similarity index 86% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/repository/impl/BarRepositoryImpl.java index 79713c53a6..0d3ce75722 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/job/repository/impl/BarRepositoryImpl.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/repository/impl/BarRepositoryImpl.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository.impl; +package org.apache.shardingsphere.elasticjob.spring.boot.job.repository.impl; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.repository.BarRepository; +import org.apache.shardingsphere.elasticjob.spring.boot.job.repository.BarRepository; import org.springframework.stereotype.Repository; @Repository diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperPropertiesTest.java similarity index 97% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperPropertiesTest.java index 133df34a5f..7bf2804fff 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/ZookeeperPropertiesTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperPropertiesTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg; +package org.apache.shardingsphere.elasticjob.spring.boot.reg; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.junit.jupiter.api.Test; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java similarity index 91% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java index ab1ee55647..49a570005a 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.reg.snapshot; +package org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot; import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java similarity index 92% rename from spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java rename to spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java index 96832e8f73..89f029a5b8 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/boot/tracing/TracingConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.boot.tracing; +package org.apache.shardingsphere.elasticjob.spring.boot.tracing; -import org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor index bd40a8b132..efdf281e0a 100644 --- a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor +++ b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor.CustomClassedJobExecutor +org.apache.shardingsphere.elasticjob.spring.boot.job.executor.CustomClassedJobExecutor diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor index aeb4830459..80cd53a93b 100644 --- a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor +++ b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.spring.boot.job.executor.PrintJobExecutor +org.apache.shardingsphere.elasticjob.spring.boot.job.executor.PrintJobExecutor diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index 3627b025a3..659237b886 100644 --- a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener.NoopElasticJobListener -org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.listener.LogElasticJobListener +org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener.NoopElasticJobListener +org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener.LogElasticJobListener diff --git a/spring/boot-starter/src/test/resources/application-elasticjob.yml b/spring/boot-starter/src/test/resources/application-elasticjob.yml index 4c213ec878..204bd0e0f5 100644 --- a/spring/boot-starter/src/test/resources/application-elasticjob.yml +++ b/spring/boot-starter/src/test/resources/application-elasticjob.yml @@ -28,10 +28,10 @@ elasticjob: excludeJobNames: [customTestJob] regCenter: serverLists: localhost:18181 - namespace: elasticjob-engine-spring-boot-starter + namespace: elasticjob-spring-boot-starter jobs: customTestJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.CustomTestJob + elasticJobClass: org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob jobBootstrapBeanName: customTestJobBean shardingTotalCount: 3 jobListenerTypes: @@ -46,7 +46,7 @@ elasticjob: defaultBeanNameClassJob: cron: 0/5 * * * * ? timeZome: GMT+08:00 - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.spring.boot.job.fixture.job.impl.CustomTestJob + elasticJobClass: org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob shardingTotalCount: 3 defaultBeanNameTypeJob: cron: 0/5 * * * * ? diff --git a/spring/boot-starter/src/test/resources/application-snapshot.yml b/spring/boot-starter/src/test/resources/application-snapshot.yml index 97aec15057..95e28f1de6 100644 --- a/spring/boot-starter/src/test/resources/application-snapshot.yml +++ b/spring/boot-starter/src/test/resources/application-snapshot.yml @@ -20,4 +20,4 @@ elasticjob: port: 0 regCenter: serverLists: localhost:18181 - namespace: elasticjob-engine-spring-boot-starter + namespace: elasticjob-spring-boot-starter diff --git a/spring/boot-starter/src/test/resources/application-tracing.yml b/spring/boot-starter/src/test/resources/application-tracing.yml index fb344f6025..610a73cf9a 100644 --- a/spring/boot-starter/src/test/resources/application-tracing.yml +++ b/spring/boot-starter/src/test/resources/application-tracing.yml @@ -18,4 +18,4 @@ elasticjob: regCenter: serverLists: localhost:18181 - namespace: elasticjob-engine-spring-boot-starter + namespace: elasticjob-spring-boot-starter diff --git a/spring/core/pom.xml b/spring/core/pom.xml index ef4a2cfa2a..c5dfa1a581 100644 --- a/spring/core/pom.xml +++ b/spring/core/pom.xml @@ -20,10 +20,10 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-engine-spring + elasticjob-spring 3.1.0-SNAPSHOT - elasticjob-engine-spring-core + elasticjob-spring-core ${project.artifactId} diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java similarity index 98% rename from spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java index 2d0b5c77dd..f17f70badb 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ClassPathJobScanner.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.spring.core.scanner; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ElasticJobScan.java similarity index 95% rename from spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ElasticJobScan.java index 0df4f06e6b..b571c0fd38 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScan.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ElasticJobScan.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.spring.core.scanner; import org.springframework.context.annotation.Import; diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ElasticJobScanRegistrar.java similarity index 97% rename from spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ElasticJobScanRegistrar.java index d0d3d18cec..7cdcb03cf5 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/ElasticJobScanRegistrar.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ElasticJobScanRegistrar.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.spring.core.scanner; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/JobScannerConfiguration.java similarity index 96% rename from spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/JobScannerConfiguration.java index 7f4404da6f..7cba1854b1 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/scanner/JobScannerConfiguration.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/JobScannerConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.scanner; +package org.apache.shardingsphere.elasticjob.spring.core.scanner; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/setup/SpringProxyJobClassNameProvider.java similarity index 91% rename from spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/setup/SpringProxyJobClassNameProvider.java index 88b66090a9..7ea11d493a 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/SpringProxyJobClassNameProvider.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/setup/SpringProxyJobClassNameProvider.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.setup; +package org.apache.shardingsphere.elasticjob.spring.core.setup; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider; -import org.apache.shardingsphere.elasticjob.engine.spring.core.util.AopTargetUtils; +import org.apache.shardingsphere.elasticjob.spring.core.util.AopTargetUtils; import org.springframework.aop.support.AopUtils; /** diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtils.java similarity index 97% rename from spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java rename to spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtils.java index d019d51de9..6410b752a8 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtils.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.util; +package org.apache.shardingsphere.elasticjob.spring.core.util; import java.lang.reflect.Field; import lombok.AccessLevel; diff --git a/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider b/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider index 2971f53f21..f94da17ec1 100644 --- a/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider +++ b/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.spring.core.setup.SpringProxyJobClassNameProvider +org.apache.shardingsphere.elasticjob.spring.core.setup.SpringProxyJobClassNameProvider diff --git a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/setup/JobClassNameProviderFactoryTest.java similarity index 94% rename from spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java rename to spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/setup/JobClassNameProviderFactoryTest.java index 97325cd185..2aab5fed07 100644 --- a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/setup/JobClassNameProviderFactoryTest.java +++ b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/setup/JobClassNameProviderFactoryTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.setup; +package org.apache.shardingsphere.elasticjob.spring.core.setup; import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProviderFactory; import org.junit.jupiter.api.Test; diff --git a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtilsTest.java similarity index 96% rename from spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java rename to spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtilsTest.java index 3d4c6e56be..b516b66c6b 100644 --- a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/AopTargetUtilsTest.java +++ b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.util; +package org.apache.shardingsphere.elasticjob.spring.core.util; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.junit.jupiter.api.Test; diff --git a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java similarity index 94% rename from spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java rename to spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java index 6f2aa795e0..cb71cde0ed 100644 --- a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/core/util/TargetJob.java +++ b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.core.util; +package org.apache.shardingsphere.elasticjob.spring.core.util; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/spring/namespace/pom.xml b/spring/namespace/pom.xml index a51a6a2247..53a038bb7d 100644 --- a/spring/namespace/pom.xml +++ b/spring/namespace/pom.xml @@ -20,16 +20,16 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-engine-spring + elasticjob-spring 3.1.0-SNAPSHOT - elasticjob-engine-spring-namespace + elasticjob-spring-namespace ${project.artifactId} org.apache.shardingsphere.elasticjob - elasticjob-engine-spring-core + elasticjob-spring-core ${project.parent.version} diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/ElasticJobNamespaceHandler.java similarity index 70% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/ElasticJobNamespaceHandler.java index b2328008e8..1bd7f226f0 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/ElasticJobNamespaceHandler.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/ElasticJobNamespaceHandler.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace; +package org.apache.shardingsphere.elasticjob.spring.namespace; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.parser.JobScannerBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.parser.JobBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.parser.ZookeeperBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.parser.SnapshotBeanDefinitionParser; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.parser.TracingBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.spring.namespace.scanner.parser.JobScannerBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.spring.namespace.job.parser.JobBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.spring.namespace.reg.parser.ZookeeperBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.spring.namespace.snapshot.parser.SnapshotBeanDefinitionParser; +import org.apache.shardingsphere.elasticjob.spring.namespace.tracing.parser.TracingBeanDefinitionParser; import org.springframework.beans.factory.xml.NamespaceHandlerSupport; /** diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java similarity index 97% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java index d1dbe0b900..c7da27b158 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/parser/JobBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.parser; +package org.apache.shardingsphere.elasticjob.spring.namespace.job.parser; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.tag.JobBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.spring.namespace.job.tag.JobBeanDefinitionTag; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/tag/JobBeanDefinitionTag.java similarity index 97% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/tag/JobBeanDefinitionTag.java index fffccdeea9..a74c2d3115 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/tag/JobBeanDefinitionTag.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/tag/JobBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job.tag; +package org.apache.shardingsphere.elasticjob.spring.namespace.job.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java similarity index 95% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java index 0cb29198f9..435ca0e574 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.parser; +package org.apache.shardingsphere.elasticjob.spring.namespace.reg.parser; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.tag.ZookeeperBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.spring.namespace.reg.tag.ZookeeperBeanDefinitionTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java similarity index 95% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java index f46f41cbf7..7f2a470380 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/tag/ZookeeperBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.reg.tag; +package org.apache.shardingsphere.elasticjob.spring.namespace.reg.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java similarity index 85% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java index e257727606..b41f44f9d8 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/parser/JobScannerBeanDefinitionParser.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.parser; +package org.apache.shardingsphere.elasticjob.spring.namespace.scanner.parser; -import org.apache.shardingsphere.elasticjob.engine.spring.core.scanner.JobScannerConfiguration; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.tag.JobScannerBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.spring.core.scanner.JobScannerConfiguration; +import org.apache.shardingsphere.elasticjob.spring.namespace.scanner.tag.JobScannerBeanDefinitionTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java similarity index 92% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java index 37d28431a1..b3f4879d73 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/tag/JobScannerBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner.tag; +package org.apache.shardingsphere.elasticjob.spring.namespace.scanner.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java similarity index 90% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java index 9bae04e155..bcc4efd400 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.parser; +package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot.parser; import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.tag.SnapshotBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.spring.namespace.snapshot.tag.SnapshotBeanDefinitionTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java similarity index 93% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java index 30eb33a4f7..5f93214f4e 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/tag/SnapshotBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot.tag; +package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java similarity index 90% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java index 8645f3c519..1111f03d12 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.parser; +package org.apache.shardingsphere.elasticjob.spring.namespace.tracing.parser; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.tag.TracingBeanDefinitionTag; +import org.apache.shardingsphere.elasticjob.spring.namespace.tracing.tag.TracingBeanDefinitionTag; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java similarity index 92% rename from spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java rename to spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java index a288cdf20e..68b78929d5 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/tag/TracingBeanDefinitionTag.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.tracing.tag; +package org.apache.shardingsphere.elasticjob.spring.namespace.tracing.tag; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/spring/namespace/src/main/resources/META-INF/spring.handlers b/spring/namespace/src/main/resources/META-INF/spring.handlers index 58639891d2..7d4a1bc7e5 100644 --- a/spring/namespace/src/main/resources/META-INF/spring.handlers +++ b/spring/namespace/src/main/resources/META-INF/spring.handlers @@ -15,4 +15,4 @@ # limitations under the License. # -http\://shardingsphere.apache.org/schema/elasticjob=org.apache.shardingsphere.elasticjob.engine.spring.namespace.ElasticJobNamespaceHandler +http\://shardingsphere.apache.org/schema/elasticjob=org.apache.shardingsphere.elasticjob.spring.namespace.ElasticJobNamespaceHandler diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/aspect/SimpleAspect.java similarity index 92% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/aspect/SimpleAspect.java index 1672fca67e..59f8e5e986 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/aspect/SimpleAspect.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/aspect/SimpleAspect.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.aspect; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.aspect; import org.aspectj.lang.JoinPoint; import org.springframework.stereotype.Component; @@ -30,7 +30,7 @@ public class SimpleAspect { /** * Aspect. */ - @Pointcut("execution(* org.apache.shardingsphere.elasticjob.engine.spring.fixture..*(..))") + @Pointcut("execution(* org.apache.shardingsphere.elasticjob.spring.fixture..*(..))") public void aspect() { } diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java similarity index 95% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java index 138d758315..6693833b52 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/DataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java index d9b8570f1d..1bbcb567aa 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/FooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java similarity index 95% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java index 089cba9534..67fcdb6413 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.annotation; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.annotation; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java similarity index 90% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java index c0bb9892b8..d607a29072 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref; import lombok.Getter; import lombok.Setter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service.FooService; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; import java.util.Collections; import java.util.List; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java similarity index 88% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java index 5964c53d23..4ad7fdf0c4 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref; import lombok.Getter; import lombok.Setter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service.FooService; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; public class RefFooSimpleElasticJob implements SimpleJob { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java index 6dc2dc8fe7..2ff8f3a8ae 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleCglibListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java index a656454b23..91be80eee8 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java index 000a8f9952..52bf6ff235 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java similarity index 92% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java index 7df627eb7b..58a9b7cf8a 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service.FooService; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; import org.springframework.beans.factory.annotation.Autowired; import static org.hamcrest.CoreMatchers.is; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/service/FooService.java similarity index 91% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/service/FooService.java index 1a35de7581..3a8e7f692b 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooService.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/service/FooService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service; public interface FooService { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/service/FooServiceImpl.java similarity index 91% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/service/FooServiceImpl.java index a9e0d05df3..eb1c1ef37d 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/fixture/service/FooServiceImpl.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/service/FooServiceImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.service; +package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service; public class FooServiceImpl implements FooService { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java similarity index 87% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java index eb10c0b6aa..9278d7f688 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.DataflowElasticJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.FooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java similarity index 89% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index d672a55ef6..7ba171ff51 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.DataflowElasticJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.FooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java index de4b47314f..ad287e64f3 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithEventTraceRdbTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java index 97d17f80c5..ff5648da5e 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithJobHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java index 2f64a6ae1f..33daaaa94e 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerAndCglibTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java index 19ebb96870..a9cc9b403a 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerTest.java index 24c81dfafa..29d699046f 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithListenerTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java similarity index 88% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 21b729cc81..9d64011a41 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java similarity index 92% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index 61f4d5e9b3..55a28af43c 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java index 7016acd6f4..56d5b369e0 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithoutListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java index 98ab3a44ba..219d2c63cf 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithEventTraceRdbTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java index 7053ac2cbd..71b3bdbda7 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithJobHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java index f650ec78e1..beffed9971 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndCglibTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java index 6c1ff0f1b6..ef3dc52f97 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerAndJdkDynamicProxyTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java index 87f41f7a95..30b875461b 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java similarity index 90% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index eac01a5da4..36d5417fc5 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java similarity index 92% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index 760d75dec2..153c52bdb0 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java similarity index 94% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java index d779191235..676fafc50e 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithoutListenerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.job; +package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java similarity index 88% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index 6ca0928044..abe9ec754b 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner; +package org.apache.shardingsphere.elasticjob.spring.namespace.scanner; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/JobScannerTest.java similarity index 93% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/JobScannerTest.java index ce2b34530c..a031576468 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/scanner/JobScannerTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/JobScannerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.scanner; +package org.apache.shardingsphere.elasticjob.spring.namespace.scanner; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java similarity index 87% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java index 7b1da87381..38d79cea6b 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot; +package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot; import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java similarity index 86% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java index 108c37aa7e..a52e334832 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot; +package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot; -import org.apache.shardingsphere.elasticjob.engine.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SocketUtils.java similarity index 95% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SocketUtils.java index 8ceec037f1..cd6fe1735a 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/snapshot/SocketUtils.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SocketUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.snapshot; +package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot; import java.io.BufferedReader; import java.io.BufferedWriter; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java similarity index 95% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java index 74fce8e4a2..bde8ca1248 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.test; +package org.apache.shardingsphere.elasticjob.spring.namespace.test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.TestExecutionListeners; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/EmbedZookeeperTestExecutionListener.java similarity index 98% rename from spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java rename to spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/EmbedZookeeperTestExecutionListener.java index efbdb9da1c..f79ac9100b 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/engine/spring/namespace/test/EmbedZookeeperTestExecutionListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/EmbedZookeeperTestExecutionListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.spring.namespace.test; +package org.apache.shardingsphere.elasticjob.spring.namespace.test; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/spring/namespace/src/test/resources/META-INF/job/base.xml b/spring/namespace/src/test/resources/META-INF/job/base.xml index d9c1ff679c..b2b83c4509 100644 --- a/spring/namespace/src/test/resources/META-INF/job/base.xml +++ b/spring/namespace/src/test/resources/META-INF/job/base.xml @@ -40,5 +40,5 @@ - + diff --git a/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml index 4248c702e8..d9e91ab7ab 100644 --- a/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml +++ b/spring/namespace/src/test/resources/META-INF/job/oneOffWithEventTraceRdb.xml @@ -26,8 +26,8 @@ "> - - + + - - + + - + - + diff --git a/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml b/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml index a5a0c18358..02aaed04fa 100644 --- a/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml +++ b/spring/namespace/src/test/resources/META-INF/job/oneOffWithListener.xml @@ -26,8 +26,8 @@ "> - - + + - + - - + + - + - - + + - - + + - - + + - - + + - + - + diff --git a/spring/namespace/src/test/resources/META-INF/job/withListener.xml b/spring/namespace/src/test/resources/META-INF/job/withListener.xml index 44aaecfcf8..d0807358fc 100644 --- a/spring/namespace/src/test/resources/META-INF/job/withListener.xml +++ b/spring/namespace/src/test/resources/META-INF/job/withListener.xml @@ -26,8 +26,8 @@ "> - - + + - + - - + + - + - - + + - - + + - + diff --git a/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index b8e125cef7..8c9292ec19 100644 --- a/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -15,7 +15,7 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleCglibListener -org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleJdkDynamicProxyListener -org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleListener -org.apache.shardingsphere.elasticjob.engine.spring.namespace.fixture.listener.SimpleOnceListener +org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener.SimpleCglibListener +org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener.SimpleJdkDynamicProxyListener +org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener.SimpleListener +org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener.SimpleOnceListener diff --git a/spring/namespace/src/test/resources/conf/job/conf.properties b/spring/namespace/src/test/resources/conf/job/conf.properties index 55154f9077..4f09309e23 100644 --- a/spring/namespace/src/test/resources/conf/job/conf.properties +++ b/spring/namespace/src/test/resources/conf/job/conf.properties @@ -16,7 +16,7 @@ # regCenter.serverLists=localhost:3181 -regCenter.namespace=elasticjob-engine-spring-test +regCenter.namespace=elasticjob-spring-test regCenter.baseSleepTimeMilliseconds=1000 regCenter.maxSleepTimeMilliseconds=3000 regCenter.maxRetries=3 @@ -39,5 +39,5 @@ dataflowJob.overwrite=true dataflowJob.streamingProcess=true # need absolute path -#script.scriptCommandLine=your_path/elasticjob/elasticjob-engine-spring/src/test/resources/script/demo.sh +#script.scriptCommandLine=your_path/elasticjob/elasticjob-spring/src/test/resources/script/demo.sh script.scriptCommandLine=echo test diff --git a/spring/pom.xml b/spring/pom.xml index 581f0dc97e..6357ab8d90 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -23,7 +23,7 @@ elasticjob 3.1.0-SNAPSHOT - elasticjob-engine-spring + elasticjob-spring pom ${project.artifactId} From cbb59f5d475dbf24c11f7c6a7dfc04b9b883c868 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 15:11:51 +0800 Subject: [PATCH 067/178] =?UTF-8?q?Refactor=20elasticjob-engine=20module?= =?UTF-8?q?=E2=80=98s=20package=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/content/faq/_index.cn.md | 2 +- docs/content/faq/_index.en.md | 2 +- .../configuration/spring-boot-starter.cn.md | 4 ++-- .../configuration/spring-boot-starter.en.md | 4 ++-- .../usage/job-api/spring-namespace.cn.md | 2 +- .../usage/job-api/spring-namespace.en.md | 2 +- .../example/EmbedZookeeperServer.java | 2 +- .../example/fixture/entity/Foo.java | 2 +- .../fixture/repository/FooRepository.java | 4 ++-- .../repository/FooRepositoryFactory.java | 2 +- .../example/job/dataflow/JavaDataflowJob.java | 8 +++---- .../job/dataflow/SpringDataflowJob.java | 6 ++--- .../example/job/simple/JavaOccurErrorJob.java | 2 +- .../example/job/simple/JavaSimpleJob.java | 8 +++---- .../example/job/simple/SpringSimpleJob.java | 6 ++--- .../{lite => }/example/JavaMain.java | 12 +++++----- .../{lite => }/example/SpringMain.java | 2 +- .../META-INF/application-context.xml | 14 ++++++------ .../{engine => }/example/SpringBootMain.java | 2 +- .../controller/OneOffJobController.java | 7 +++--- .../{engine => }/example/entity/Foo.java | 2 +- .../example/job/SpringBootDataflowJob.java | 6 ++--- ...SpringBootOccurErrorNoticeDingtalkJob.java | 2 +- .../SpringBootOccurErrorNoticeEmailJob.java | 2 +- .../SpringBootOccurErrorNoticeWechatJob.java | 2 +- .../example/job/SpringBootSimpleJob.java | 6 ++--- .../example/repository/FooRepository.java | 4 ++-- .../src/main/resources/application.yml | 10 ++++----- .../api/bootstrap/JobBootstrap.java | 2 +- .../bootstrap/impl/OneOffJobBootstrap.java | 10 ++++----- .../bootstrap/impl/ScheduleJobBootstrap.java | 8 +++---- ...tractDistributeOnceElasticJobListener.java | 4 ++-- .../api/registry/JobInstanceRegistry.java | 8 +++---- .../annotation/JobAnnotationBuilder.java | 2 +- .../internal/config/ConfigurationNode.java | 4 ++-- .../internal/config/ConfigurationService.java | 4 ++-- .../config/RescheduleListenerManager.java | 6 ++--- .../election/ElectionListenerManager.java | 12 +++++----- .../internal/election/LeaderNode.java | 4 ++-- .../internal/election/LeaderService.java | 8 +++---- .../failover/FailoverListenerManager.java | 18 +++++++-------- .../internal/failover/FailoverNode.java | 8 +++---- .../internal/failover/FailoverService.java | 14 ++++++------ .../guarantee/GuaranteeListenerManager.java | 6 ++--- .../internal/guarantee/GuaranteeNode.java | 4 ++-- .../internal/guarantee/GuaranteeService.java | 8 +++---- .../internal/instance/InstanceNode.java | 6 ++--- .../internal/instance/InstanceService.java | 8 +++---- .../instance/ShutdownListenerManager.java | 8 +++---- .../listener/AbstractListenerManager.java | 4 ++-- .../internal/listener/ListenerManager.java | 20 ++++++++--------- .../listener/ListenerNotifierManager.java | 2 +- ...RegistryCenterConnectionStateListener.java | 14 ++++++------ .../internal/reconcile/ReconcileService.java | 8 +++---- .../internal/schedule/JobRegistry.java | 4 ++-- .../schedule/JobScheduleController.java | 2 +- .../internal/schedule/JobScheduler.java | 12 +++++----- .../schedule/JobShutdownHookPlugin.java | 6 ++--- .../internal/schedule/JobTriggerListener.java | 6 ++--- .../internal/schedule/LiteJob.java | 2 +- .../internal/schedule/LiteJobFacade.java | 12 +++++----- .../internal/schedule/SchedulerFacade.java | 8 +++---- .../internal/server/ServerNode.java | 6 ++--- .../internal/server/ServerService.java | 8 +++---- .../internal/server/ServerStatus.java | 2 +- .../setup/DefaultJobClassNameProvider.java | 2 +- .../internal/setup/JobClassNameProvider.java | 2 +- .../setup/JobClassNameProviderFactory.java | 2 +- .../internal/setup/SetUpFacade.java | 12 +++++----- .../sharding/ExecutionContextService.java | 8 +++---- .../internal/sharding/ExecutionService.java | 8 +++---- .../MonitorExecutionListenerManager.java | 6 ++--- .../sharding/ShardingListenerManager.java | 16 +++++++------- .../internal/sharding/ShardingNode.java | 6 ++--- .../internal/sharding/ShardingService.java | 18 +++++++-------- .../internal/snapshot/SnapshotService.java | 4 ++-- .../internal/storage/JobNodePath.java | 2 +- .../internal/storage/JobNodeStorage.java | 4 ++-- .../trigger/TriggerListenerManager.java | 6 ++--- .../internal/trigger/TriggerNode.java | 6 ++--- .../internal/trigger/TriggerService.java | 4 ++-- .../internal/util/SensitiveInfoUtils.java | 2 +- .../impl/OneOffJobBootstrapTest.java | 8 +++---- .../DistributeOnceElasticJobListenerTest.java | 10 ++++----- .../fixture/ElasticJobListenerCaller.java | 2 +- .../TestDistributeOnceElasticJobListener.java | 4 ++-- .../fixture/TestElasticJobListener.java | 2 +- .../api/registry/JobInstanceRegistryTest.java | 2 +- .../fixture/EmbedTestingServer.java | 2 +- .../fixture/LiteYamlConstants.java | 2 +- .../executor/ClassedFooJobExecutor.java | 4 ++-- .../fixture/job/AnnotationSimpleJob.java | 2 +- .../fixture/job/AnnotationUnShardingJob.java | 2 +- .../fixture/job/DetailedFooJob.java | 2 +- .../fixture/job/FooJob.java | 2 +- .../integrate/BaseIntegrateTest.java | 16 +++++++------- .../disable/DisabledJobIntegrateTest.java | 12 +++++----- .../OneOffDisabledJobIntegrateTest.java | 2 +- .../ScheduleDisabledJobIntegrateTest.java | 8 +++---- .../enable/EnabledJobIntegrateTest.java | 10 ++++----- .../enable/OneOffEnabledJobIntegrateTest.java | 4 ++-- .../ScheduleEnabledJobIntegrateTest.java | 4 ++-- .../TestDistributeOnceElasticJobListener.java | 4 ++-- .../listener/TestElasticJobListener.java | 2 +- .../annotation/JobAnnotationBuilderTest.java | 4 ++-- .../integrate/BaseAnnotationTest.java | 18 +++++++-------- .../integrate/OneOffEnabledJobTest.java | 8 +++---- .../integrate/ScheduleEnabledJobTest.java | 8 +++---- .../config/ConfigurationNodeTest.java | 2 +- .../config/ConfigurationServiceTest.java | 10 ++++----- .../config/RescheduleListenerManagerTest.java | 12 +++++----- .../election/ElectionListenerManagerTest.java | 14 ++++++------ .../internal/election/LeaderNodeTest.java | 2 +- .../internal/election/LeaderServiceTest.java | 14 ++++++------ .../failover/FailoverListenerManagerTest.java | 22 +++++++++---------- .../internal/failover/FailoverNodeTest.java | 2 +- .../failover/FailoverServiceTest.java | 14 ++++++------ .../GuaranteeListenerManagerTest.java | 8 +++---- .../internal/guarantee/GuaranteeNodeTest.java | 2 +- .../guarantee/GuaranteeServiceTest.java | 10 ++++----- .../internal/instance/InstanceNodeTest.java | 4 ++-- .../instance/InstanceServiceTest.java | 10 ++++----- .../instance/ShutdownListenerManagerTest.java | 12 +++++----- .../listener/ListenerManagerTest.java | 22 +++++++++---------- .../listener/ListenerNotifierManagerTest.java | 2 +- ...stryCenterConnectionStateListenerTest.java | 16 +++++++------- .../reconcile/ReconcileServiceTest.java | 10 ++++----- .../internal/schedule/JobRegistryTest.java | 4 ++-- .../schedule/JobScheduleControllerTest.java | 4 ++-- .../schedule/JobTriggerListenerTest.java | 6 ++--- .../internal/schedule/LiteJobFacadeTest.java | 18 +++++++-------- .../schedule/SchedulerFacadeTest.java | 8 +++---- .../internal/server/ServerNodeTest.java | 4 ++-- .../internal/server/ServerServiceTest.java | 10 ++++----- .../DefaultJobClassNameProviderTest.java | 10 ++++----- .../JobClassNameProviderFactoryTest.java | 2 +- .../internal/setup/SetUpFacadeTest.java | 16 +++++++------- .../sharding/ExecutionContextServiceTest.java | 10 ++++----- .../sharding/ExecutionServiceTest.java | 10 ++++----- .../MonitorExecutionListenerManagerTest.java | 8 +++---- .../sharding/ShardingListenerManagerTest.java | 14 ++++++------ .../internal/sharding/ShardingNodeTest.java | 2 +- .../sharding/ShardingServiceTest.java | 20 ++++++++--------- .../snapshot/BaseSnapshotServiceTest.java | 10 ++++----- .../snapshot/SnapshotServiceDisableTest.java | 4 ++-- .../snapshot/SnapshotServiceEnableTest.java | 4 ++-- .../internal/snapshot/SocketUtils.java | 2 +- .../internal/storage/JobNodePathTest.java | 2 +- .../internal/storage/JobNodeStorageTest.java | 6 ++--- .../trigger/TriggerListenerManagerTest.java | 10 ++++----- .../internal/util/SensitiveInfoUtilsTest.java | 2 +- .../util/ReflectionUtils.java | 2 +- ....executor.item.impl.ClassedJobItemExecutor | 2 +- ...asticjob.infra.listener.ElasticJobListener | 8 +++---- kernel/src/test/resources/logback-test.xml | 2 +- .../internal/operate/JobOperateAPIImpl.java | 8 +++---- .../operate/ShardingOperateAPIImpl.java | 2 +- .../settings/JobConfigurationAPIImpl.java | 2 +- .../statistics/JobStatisticsAPIImpl.java | 2 +- .../statistics/ServerStatisticsAPIImpl.java | 2 +- .../statistics/ShardingStatisticsAPIImpl.java | 2 +- .../job/ElasticJobBootstrapConfiguration.java | 4 ++-- .../ScheduleJobBootstrapStartupRunner.java | 2 +- ...lasticJobSnapshotServiceConfiguration.java | 2 +- .../job/ElasticJobSpringBootScannerTest.java | 2 +- .../boot/job/ElasticJobSpringBootTest.java | 8 +++---- ...icJobSnapshotServiceConfigurationTest.java | 2 +- .../core/scanner/ClassPathJobScanner.java | 2 +- .../SpringProxyJobClassNameProvider.java | 2 +- ...ernel.internal.setup.JobClassNameProvider} | 0 .../JobClassNameProviderFactoryTest.java | 2 +- .../job/parser/JobBeanDefinitionParser.java | 4 ++-- .../parser/SnapshotBeanDefinitionParser.java | 2 +- .../fixture/listener/SimpleOnceListener.java | 2 +- .../job/AbstractJobSpringIntegrateTest.java | 2 +- .../AbstractOneOffJobSpringIntegrateTest.java | 4 ++-- .../job/JobSpringNamespaceWithRefTest.java | 2 +- .../job/JobSpringNamespaceWithTypeTest.java | 2 +- .../OneOffJobSpringNamespaceWithRefTest.java | 4 ++-- .../OneOffJobSpringNamespaceWithTypeTest.java | 4 ++-- .../AbstractJobSpringIntegrateTest.java | 2 +- .../SnapshotSpringNamespaceDisableTest.java | 2 +- 182 files changed, 555 insertions(+), 554 deletions(-) rename examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/EmbedZookeeperServer.java (96%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/fixture/entity/Foo.java (95%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/fixture/repository/FooRepository.java (93%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/fixture/repository/FooRepositoryFactory.java (92%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/job/dataflow/JavaDataflowJob.java (85%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/job/dataflow/SpringDataflowJob.java (89%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/job/simple/JavaOccurErrorJob.java (94%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/job/simple/JavaSimpleJob.java (82%) rename examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/job/simple/SpringSimpleJob.java (87%) rename examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/JavaMain.java (95%) rename examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/{lite => }/example/SpringMain.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/SpringBootMain.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/controller/OneOffJobController.java (94%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/entity/Foo.java (96%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/job/SpringBootDataflowJob.java (90%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/job/SpringBootOccurErrorNoticeDingtalkJob.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/job/SpringBootOccurErrorNoticeEmailJob.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/job/SpringBootOccurErrorNoticeWechatJob.java (95%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/job/SpringBootSimpleJob.java (89%) rename examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/{engine => }/example/repository/FooRepository.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/bootstrap/JobBootstrap.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/bootstrap/impl/OneOffJobBootstrap.java (89%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/bootstrap/impl/ScheduleJobBootstrap.java (90%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/listener/AbstractDistributeOnceElasticJobListener.java (97%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/registry/JobInstanceRegistry.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/annotation/JobAnnotationBuilder.java (98%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/config/ConfigurationNode.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/config/ConfigurationService.java (97%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/config/RescheduleListenerManager.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/election/ElectionListenerManager.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/election/LeaderNode.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/election/LeaderService.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/failover/FailoverListenerManager.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/failover/FailoverNode.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/failover/FailoverService.java (95%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/guarantee/GuaranteeListenerManager.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/guarantee/GuaranteeNode.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/guarantee/GuaranteeService.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/instance/InstanceNode.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/instance/InstanceService.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/instance/ShutdownListenerManager.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/listener/AbstractListenerManager.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/listener/ListenerManager.java (85%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/listener/ListenerNotifierManager.java (98%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/listener/RegistryCenterConnectionStateListener.java (86%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/reconcile/ReconcileService.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobRegistry.java (97%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobScheduleController.java (99%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobScheduler.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobShutdownHookPlugin.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobTriggerListener.java (88%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/LiteJob.java (95%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/LiteJobFacade.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/SchedulerFacade.java (88%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/server/ServerNode.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/server/ServerService.java (95%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/server/ServerStatus.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/setup/DefaultJobClassNameProvider.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/setup/JobClassNameProvider.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/setup/JobClassNameProviderFactory.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/setup/SetUpFacade.java (88%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ExecutionContextService.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ExecutionService.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/MonitorExecutionListenerManager.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ShardingListenerManager.java (89%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ShardingNode.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ShardingService.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/snapshot/SnapshotService.java (98%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/storage/JobNodePath.java (98%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/storage/JobNodeStorage.java (98%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/trigger/TriggerListenerManager.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/trigger/TriggerNode.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/trigger/TriggerService.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/util/SensitiveInfoUtils.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/bootstrap/impl/OneOffJobBootstrapTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/listener/DistributeOnceElasticJobListenerTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/listener/fixture/ElasticJobListenerCaller.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/listener/fixture/TestDistributeOnceElasticJobListener.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/listener/fixture/TestElasticJobListener.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/api/registry/JobInstanceRegistryTest.java (98%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/fixture/EmbedTestingServer.java (98%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/fixture/LiteYamlConstants.java (98%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/fixture/executor/ClassedFooJobExecutor.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/fixture/job/AnnotationSimpleJob.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/fixture/job/AnnotationUnShardingJob.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/fixture/job/DetailedFooJob.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/fixture/job/FooJob.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/BaseIntegrateTest.java (87%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/disable/DisabledJobIntegrateTest.java (88%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/disable/OneOffDisabledJobIntegrateTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/disable/ScheduleDisabledJobIntegrateTest.java (91%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/enable/EnabledJobIntegrateTest.java (90%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/enable/OneOffEnabledJobIntegrateTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/enable/ScheduleEnabledJobIntegrateTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/listener/TestDistributeOnceElasticJobListener.java (91%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/integrate/listener/TestElasticJobListener.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/annotation/JobAnnotationBuilderTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/annotation/integrate/BaseAnnotationTest.java (86%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/annotation/integrate/OneOffEnabledJobTest.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/annotation/integrate/ScheduleEnabledJobTest.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/config/ConfigurationNodeTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/config/ConfigurationServiceTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/config/RescheduleListenerManagerTest.java (91%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/election/ElectionListenerManagerTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/election/LeaderNodeTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/election/LeaderServiceTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/failover/FailoverListenerManagerTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/failover/FailoverNodeTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/failover/FailoverServiceTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/guarantee/GuaranteeListenerManagerTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/guarantee/GuaranteeNodeTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/guarantee/GuaranteeServiceTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/instance/InstanceNodeTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/instance/InstanceServiceTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/instance/ShutdownListenerManagerTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/listener/ListenerManagerTest.java (85%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/listener/ListenerNotifierManagerTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/listener/RegistryCenterConnectionStateListenerTest.java (90%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/reconcile/ReconcileServiceTest.java (91%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobRegistryTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobScheduleControllerTest.java (99%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/JobTriggerListenerTest.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/LiteJobFacadeTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/schedule/SchedulerFacadeTest.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/server/ServerNodeTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/server/ServerServiceTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/setup/DefaultJobClassNameProviderTest.java (86%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/setup/JobClassNameProviderFactoryTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/setup/SetUpFacadeTest.java (85%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ExecutionContextServiceTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ExecutionServiceTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/MonitorExecutionListenerManagerTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ShardingListenerManagerTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ShardingNodeTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/sharding/ShardingServiceTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/snapshot/BaseSnapshotServiceTest.java (89%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/snapshot/SnapshotServiceDisableTest.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/snapshot/SnapshotServiceEnableTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/snapshot/SocketUtils.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/storage/JobNodePathTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/storage/JobNodeStorageTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/trigger/TriggerListenerManagerTest.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/internal/util/SensitiveInfoUtilsTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/{engine => kernel}/util/ReflectionUtils.java (97%) rename spring/core/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider => org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProvider} (100%) diff --git a/docs/content/faq/_index.cn.md b/docs/content/faq/_index.cn.md index 66e8326067..3b8ee69468 100644 --- a/docs/content/faq/_index.cn.md +++ b/docs/content/faq/_index.cn.md @@ -78,7 +78,7 @@ ElasticJob 已将 IP 地址等敏感信息过滤,导出的信息可在公网 ElasticJob 执行任务会获取本机IP,首次可能存在获取IP较慢的情况。尝试设置 `-Djava.net.preferIPv4Stack=true`. -## 10. Windows环境下,运行ShardingSphere-ElasticJob-UI,找不到或无法加载主类 org.apache.shardingsphere.elasticjob.engine.ui.Bootstrap,如何解决? +## 10. Windows环境下,运行ShardingSphere-ElasticJob-UI,找不到或无法加载主类 org.apache.shardingsphere.elasticjob.kernel.ui.Bootstrap,如何解决? 回答: diff --git a/docs/content/faq/_index.en.md b/docs/content/faq/_index.en.md index daebc029bc..cfd93ec08e 100644 --- a/docs/content/faq/_index.en.md +++ b/docs/content/faq/_index.en.md @@ -79,7 +79,7 @@ Answer: ElasticJob will obtain the local IP when performing task scheduling, and it may be slow to obtain the IP for the first time. Try to set `-Djava.net.preferIPv4Stack=true`. -## 10. In Windows env, run ShardingSphere-ElasticJob-UI, could not find or load main class org.apache.shardingsphere.elasticjob.engine.ui.Bootstrap. Why? +## 10. In Windows env, run ShardingSphere-ElasticJob-UI, could not find or load main class org.apache.shardingsphere.elasticjob.kernel.ui.Bootstrap. Why? Answer: diff --git a/docs/content/user-manual/configuration/spring-boot-starter.cn.md b/docs/content/user-manual/configuration/spring-boot-starter.cn.md index c0de545e29..332702eacf 100644 --- a/docs/content/user-manual/configuration/spring-boot-starter.cn.md +++ b/docs/content/user-manual/configuration/spring-boot-starter.cn.md @@ -89,7 +89,7 @@ elasticjob.reg-center.server-lists=localhost:6181 elasticjob: jobs: simpleJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob + elasticJobClass: org.apache.shardingsphere.elasticjob.kernel.example.job.SpringBootSimpleJob cron: 0/5 * * * * ? timeZone: GMT+08:00 shardingTotalCount: 3 @@ -110,7 +110,7 @@ elasticjob: **Properties** ``` -elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob +elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.kernel.example.job.SpringBootSimpleJob elasticjob.jobs.simpleJob.cron=0/5 * * * * ? elasticjob.jobs.simpleJob.timeZone=GMT+08:00 elasticjob.jobs.simpleJob.sharding-total-count=3 diff --git a/docs/content/user-manual/configuration/spring-boot-starter.en.md b/docs/content/user-manual/configuration/spring-boot-starter.en.md index b294ca11cb..a50f584d55 100644 --- a/docs/content/user-manual/configuration/spring-boot-starter.en.md +++ b/docs/content/user-manual/configuration/spring-boot-starter.en.md @@ -90,7 +90,7 @@ Reference: elasticjob: jobs: simpleJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob + elasticJobClass: org.apache.shardingsphere.elasticjob.kernel.example.job.SpringBootSimpleJob cron: 0/5 * * * * ? timeZone: GMT+08:00 shardingTotalCount: 3 @@ -111,7 +111,7 @@ elasticjob: **Properties** ``` -elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob +elasticjob.jobs.simpleJob.elastic-job-class=org.apache.shardingsphere.elasticjob.kernel.example.job.SpringBootSimpleJob elasticjob.jobs.simpleJob.cron=0/5 * * * * ? elasticjob.jobs.simpleJob.timeZone=GMT+08:00 elasticjob.jobs.simpleJob.sharding-total-count=3 diff --git a/docs/content/user-manual/usage/job-api/spring-namespace.cn.md b/docs/content/user-manual/usage/job-api/spring-namespace.cn.md index 085df87267..485eb6c8b5 100644 --- a/docs/content/user-manual/usage/job-api/spring-namespace.cn.md +++ b/docs/content/user-manual/usage/job-api/spring-namespace.cn.md @@ -52,7 +52,7 @@ ElasticJob 提供自定义的 Spring 命名空间,可以与 Spring 容器配 ```xml - + ``` ```java diff --git a/docs/content/user-manual/usage/job-api/spring-namespace.en.md b/docs/content/user-manual/usage/job-api/spring-namespace.en.md index 0f4cb7a37e..f9fd35ccc5 100644 --- a/docs/content/user-manual/usage/job-api/spring-namespace.en.md +++ b/docs/content/user-manual/usage/job-api/spring-namespace.en.md @@ -53,7 +53,7 @@ Trigger the job by invoking `execute()` method manually. ```xml - + ``` ```java diff --git a/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/EmbedZookeeperServer.java b/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/example/EmbedZookeeperServer.java similarity index 96% rename from examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/EmbedZookeeperServer.java rename to examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/example/EmbedZookeeperServer.java index 7e62108643..9940bc7211 100644 --- a/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/EmbedZookeeperServer.java +++ b/examples/elasticjob-example-embed-zk/src/main/java/org/apache/shardingsphere/elasticjob/example/EmbedZookeeperServer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example; +package org.apache.shardingsphere.elasticjob.example; import org.apache.curator.test.TestingServer; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/entity/Foo.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/entity/Foo.java similarity index 95% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/entity/Foo.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/entity/Foo.java index 30a8cc1877..530d6e1b58 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/entity/Foo.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/entity/Foo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.fixture.entity; +package org.apache.shardingsphere.elasticjob.example.fixture.entity; import java.io.Serializable; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepository.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/repository/FooRepository.java similarity index 93% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepository.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/repository/FooRepository.java index 40ce742dc9..7e814a63d8 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepository.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/repository/FooRepository.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.fixture.repository; +package org.apache.shardingsphere.elasticjob.example.fixture.repository; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.springframework.stereotype.Repository; import java.util.ArrayList; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepositoryFactory.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/repository/FooRepositoryFactory.java similarity index 92% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepositoryFactory.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/repository/FooRepositoryFactory.java index 3aac7be913..12db547305 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/fixture/repository/FooRepositoryFactory.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/fixture/repository/FooRepositoryFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.fixture.repository; +package org.apache.shardingsphere.elasticjob.example.fixture.repository; public final class FooRepositoryFactory { diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java similarity index 85% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java index 7cde78a4e3..bc3e46d8e1 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/JavaDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job.dataflow; +package org.apache.shardingsphere.elasticjob.example.job.dataflow; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepositoryFactory; +import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepositoryFactory; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java similarity index 89% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java index 113ca2b921..02432b7a15 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/dataflow/SpringDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job.dataflow; +package org.apache.shardingsphere.elasticjob.example.job.dataflow; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; import javax.annotation.Resource; import java.text.SimpleDateFormat; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaOccurErrorJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java similarity index 94% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaOccurErrorJob.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java index 6800716cde..d249d12b72 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaOccurErrorJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job.simple; +package org.apache.shardingsphere.elasticjob.example.job.simple; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java similarity index 82% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java index 4559ca7b82..92dd4d1d60 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/JavaSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job.simple; +package org.apache.shardingsphere.elasticjob.example.job.simple; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepositoryFactory; +import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepositoryFactory; import java.text.SimpleDateFormat; import java.util.Date; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java similarity index 87% rename from examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java rename to examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java index 5cc613497a..f42c0a8455 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/job/simple/SpringSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job.simple; +package org.apache.shardingsphere.elasticjob.example.job.simple; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.entity.Foo; -import org.apache.shardingsphere.elasticjob.engine.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; import javax.annotation.Resource; import java.text.SimpleDateFormat; diff --git a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java similarity index 95% rename from examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java rename to examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index 5f68554367..d8cc2bbaeb 100644 --- a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java +++ b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example; +package org.apache.shardingsphere.elasticjob.example; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -23,12 +23,12 @@ import org.apache.shardingsphere.elasticjob.error.handler.dingtalk.DingtalkPropertiesConstants; import org.apache.shardingsphere.elasticjob.error.handler.email.EmailPropertiesConstants; import org.apache.shardingsphere.elasticjob.error.handler.wechat.WechatPropertiesConstants; +import org.apache.shardingsphere.elasticjob.example.job.dataflow.JavaDataflowJob; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.example.job.dataflow.JavaDataflowJob; -import org.apache.shardingsphere.elasticjob.engine.example.job.simple.JavaOccurErrorJob; -import org.apache.shardingsphere.elasticjob.engine.example.job.simple.JavaSimpleJob; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.example.job.simple.JavaOccurErrorJob; +import org.apache.shardingsphere.elasticjob.example.job.simple.JavaSimpleJob; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringMain.java b/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java similarity index 95% rename from examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringMain.java rename to examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java index ccbbaf638f..a83e6346ae 100644 --- a/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/SpringMain.java +++ b/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example; +package org.apache.shardingsphere.elasticjob.example; import org.springframework.context.support.ClassPathXmlApplicationContext; diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml b/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml index e937ea9bd1..4706d4fda0 100644 --- a/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml +++ b/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml @@ -27,7 +27,7 @@ http://shardingsphere.apache.org/schema/elasticjob http://shardingsphere.apache.org/schema/elasticjob/elasticjob.xsd "> - + - - + + - + @@ -87,7 +87,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/SpringBootMain.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/SpringBootMain.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java index 36904fd31c..d227274153 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/SpringBootMain.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example; +package org.apache.shardingsphere.elasticjob.example; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/controller/OneOffJobController.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java similarity index 94% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/controller/OneOffJobController.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java index aed8e8af8b..23a4ac01ce 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/controller/OneOffJobController.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java @@ -15,15 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.controller; +package org.apache.shardingsphere.elasticjob.example.controller; -import javax.annotation.Resource; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; +import javax.annotation.Resource; + @RestController public class OneOffJobController { diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/entity/Foo.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java similarity index 96% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/entity/Foo.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java index c51f0be5ed..219d5acc00 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/entity/Foo.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.entity; +package org.apache.shardingsphere.elasticjob.example.entity; import java.io.Serializable; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootDataflowJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java similarity index 90% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootDataflowJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java index 5da6e447ad..40a5e0ff84 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootDataflowJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job; +package org.apache.shardingsphere.elasticjob.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; -import org.apache.shardingsphere.elasticjob.engine.example.entity.Foo; -import org.apache.shardingsphere.elasticjob.engine.example.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.example.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeDingtalkJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeDingtalkJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java index 3317492a8b..fb33a35271 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeDingtalkJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job; +package org.apache.shardingsphere.elasticjob.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeEmailJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeEmailJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java index 575689075b..f6c7e69046 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeEmailJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job; +package org.apache.shardingsphere.elasticjob.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeWechatJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeWechatJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java index 41a08980d4..b998458a44 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootOccurErrorNoticeWechatJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job; +package org.apache.shardingsphere.elasticjob.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootSimpleJob.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java similarity index 89% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootSimpleJob.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java index cc15b3fb61..85109787ed 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/job/SpringBootSimpleJob.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.job; +package org.apache.shardingsphere.elasticjob.example.job; import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.engine.example.entity.Foo; -import org.apache.shardingsphere.elasticjob.engine.example.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.example.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/repository/FooRepository.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java similarity index 93% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/repository/FooRepository.java rename to examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java index 6dfe994a7a..fa1a2267f9 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/engine/example/repository/FooRepository.java +++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.example.repository; +package org.apache.shardingsphere.elasticjob.example.repository; -import org.apache.shardingsphere.elasticjob.engine.example.entity.Foo; +import org.apache.shardingsphere.elasticjob.example.entity.Foo; import org.springframework.stereotype.Repository; import java.util.ArrayList; diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml index f3be9ed814..c7c86494ef 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml +++ b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml @@ -10,12 +10,12 @@ elasticjob: namespace: elasticjob-springboot jobs: simpleJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootSimpleJob + elasticJobClass: org.apache.shardingsphere.elasticjob.kernel.example.job.SpringBootSimpleJob cron: 0/5 * * * * ? shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou dataflowJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootDataflowJob + elasticJobClass: org.apache.shardingsphere.elasticjob.kernel.example.job.SpringBootDataflowJob cron: 0/5 * * * * ? shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou @@ -32,7 +32,7 @@ elasticjob: props: script.command.line: "echo Manual SCRIPT Job: " occurErrorNoticeDingtalkJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootOccurErrorNoticeDingtalkJob + elasticJobClass: org.apache.shardingsphere.elasticjob.kernel.example.job.SpringBootOccurErrorNoticeDingtalkJob overwrite: true shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou @@ -46,7 +46,7 @@ elasticjob: connectTimeout: 3000 readTimeout: 5000 occurErrorNoticeWechatJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootOccurErrorNoticeWechatJob + elasticJobClass: org.apache.shardingsphere.elasticjob.kernel.kernel.job.SpringBootOccurErrorNoticeWechatJob overwrite: true shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou @@ -58,7 +58,7 @@ elasticjob: connectTimeout: 3000 readTimeout: 5000 occurErrorNoticeEmailJob: - elasticJobClass: org.apache.shardingsphere.elasticjob.engine.example.job.SpringBootOccurErrorNoticeEmailJob + elasticJobClass: org.apache.shardingsphere.elasticjob.kernel.kernel.job.SpringBootOccurErrorNoticeEmailJob overwrite: true shardingTotalCount: 3 shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/JobBootstrap.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/JobBootstrap.java index c734833fc1..b898b877d7 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/JobBootstrap.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/JobBootstrap.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.bootstrap; +package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap; /** * Job bootstrap. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrap.java similarity index 89% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrap.java index 499f5ffdbc..1119e57577 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrap.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrap.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.internal.annotation.JobAnnotationBuilder; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/ScheduleJobBootstrap.java similarity index 90% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/ScheduleJobBootstrap.java index a45116f23c..2632fa4926 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/ScheduleJobBootstrap.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/ScheduleJobBootstrap.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.internal.annotation.JobAnnotationBuilder; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java index 0ef6456c45..8a5970491d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.listener; +package org.apache.shardingsphere.elasticjob.kernel.api.listener; import lombok.Setter; import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeService; +import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; import java.util.Set; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistry.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistry.java index 1ae7873074..769e1076c3 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistry.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistry.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.registry; +package org.apache.shardingsphere.elasticjob.kernel.api.registry; import lombok.RequiredArgsConstructor; @@ -25,9 +25,9 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java index 991c7d3542..66a088323e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilder.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.annotation; +package org.apache.shardingsphere.elasticjob.kernel.internal.annotation; import com.google.common.base.Preconditions; import com.google.common.base.Strings; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationNode.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationNode.java index a436932d86..0c1b07233b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationNode.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.config; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; /** * Configuration node. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java index 745a3f4801..4c37a4b0f1 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.config; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.env.TimeService; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java index 6139485344..897160d634 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.config; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java index 94ec7762c5..b46ef9312c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.election; +package org.apache.shardingsphere.elasticjob.kernel.internal.election; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerNode; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderNode.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderNode.java index df9bdb97bd..748814a7e8 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderNode.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.election; +package org.apache.shardingsphere.elasticjob.kernel.internal.election; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; /** * Leader path node. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java index f83dff2640..628d99cbf6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.election; +package org.apache.shardingsphere.elasticjob.kernel.internal.election; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java index aec6e44787..81e0466449 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.failover; +package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationNode; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverNode.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverNode.java index b09863920c..1a12f28902 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.failover; +package org.apache.shardingsphere.elasticjob.kernel.internal.failover; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderNode; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingNode; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; /** * Failover node. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java index 8af02351e6..7499ee456d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.failover; +package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingNode; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java index 897ad134ef..d0c8937da4 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; +package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeNode.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeNode.java index c5a082e429..984100c932 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeNode.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; +package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; /** * Guarantee node. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java index 768f567f22..a1df049f67 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; +package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNode.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNode.java index fc21857837..be0aed258f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.instance; +package org.apache.shardingsphere.elasticjob.kernel.internal.instance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; /** * Instance node. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java index 47251c5157..dc1159a9c4 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.instance; +package org.apache.shardingsphere.elasticjob.kernel.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.internal.trigger.TriggerNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.trigger.TriggerNode; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.LinkedList; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManager.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManager.java index acd85f7c4f..dbf6c2f2b5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManager.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.instance; +package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.SchedulerFacade; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.SchedulerFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/AbstractListenerManager.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/AbstractListenerManager.java index f719094edf..2483ca4645 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/AbstractListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/AbstractListenerManager.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.listener; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java similarity index 85% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java index 729fa38e14..23e09bebd5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.config.RescheduleListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.election.ElectionListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.ShutdownListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.MonitorExecutionListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.internal.trigger.TriggerListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.RescheduleListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.ElectionListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.ShutdownListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.MonitorExecutionListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.trigger.TriggerListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Collection; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerNotifierManager.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerNotifierManager.java index 56a69af4f8..47afc5c41f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerNotifierManager.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.listener; import org.apache.curator.utils.ThreadUtils; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListener.java similarity index 86% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListener.java index 0077d815e1..b528e26971 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListener.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.listener; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileService.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileService.java index 6015797693..f336c40bf8 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.reconcile; +package org.apache.shardingsphere.elasticjob.kernel.internal.reconcile; import com.google.common.util.concurrent.AbstractScheduledService; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.concurrent.TimeUnit; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java index 9ac7482eda..9285a0aa27 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistry.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerNotifierManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerNotifierManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Map; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleController.java similarity index 99% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleController.java index 9f63fde606..00ad6a137f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleController.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleController.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import com.google.common.base.Preconditions; import com.google.common.base.Strings; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index bda4e794fd..62b0975b95 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import com.google.common.base.Preconditions; import com.google.common.base.Strings; @@ -29,11 +29,11 @@ import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListenerFactory; import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeService; -import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProviderFactory; -import org.apache.shardingsphere.elasticjob.engine.internal.setup.SetUpFacade; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; +import org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory; +import org.apache.shardingsphere.elasticjob.kernel.internal.setup.SetUpFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.quartz.JobBuilder; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobShutdownHookPlugin.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobShutdownHookPlugin.java index 13a6decf6e..dc81fcbb2c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobShutdownHookPlugin.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobShutdownHookPlugin.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.quartz.Scheduler; import org.quartz.SchedulerException; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobTriggerListener.java similarity index 88% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobTriggerListener.java index f233baa568..f32cd8cbea 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobTriggerListener.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.quartz.Trigger; import org.quartz.listeners.TriggerListenerSupport; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java index cb3821adb1..4d828f1d48 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJob.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import lombok.Setter; import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java index 7e790c346a..479f720da1 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionContextService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.executor.JobFacade; import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacade.java similarity index 88% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacade.java index 4868ede3be..7e1e45b33c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacade.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java index 912d3bc68d..6693d12c20 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.server; +package org.apache.shardingsphere.elasticjob.kernel.internal.server; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import java.util.Objects; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java index 864a0ea030..9aba51c8f6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.server; +package org.apache.shardingsphere.elasticjob.kernel.internal.server; import com.google.common.base.Strings; import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Collection; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerStatus.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerStatus.java index 63124f6b2d..92472d1e8e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerStatus.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerStatus.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.server; +package org.apache.shardingsphere.elasticjob.kernel.internal.server; /** * Server status. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProvider.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProvider.java index 8974b3138f..4700a24f3a 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.setup; +package org.apache.shardingsphere.elasticjob.kernel.internal.setup; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProvider.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProvider.java index cccca5c2e5..36730e4aa6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.setup; +package org.apache.shardingsphere.elasticjob.kernel.internal.setup; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactory.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactory.java index 1bf8afe819..d2d7cd634d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.setup; +package org.apache.shardingsphere.elasticjob.kernel.internal.setup; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java similarity index 88% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java index 6e1356c19d..d0c1e7be12 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.setup; +package org.apache.shardingsphere.elasticjob.kernel.internal.setup; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.reconcile.ReconcileService; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.reconcile.ReconcileService; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.Collection; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java index d980f68886..e989135c74 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.ShardingItemParameters; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java index da48bc6305..39d85cfa17 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import java.util.ArrayList; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java index 9d984e5f7b..f57b01d75f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationNode; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java similarity index 89% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java index a3e8ddc5e5..73249f596d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationNode; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerNode; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingNode.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingNode.java index ed4a96557f..c86912f782 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingNode.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderNode; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; /** * Sharding node. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java index 92787552ab..4bde6078a5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -24,14 +24,14 @@ import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategyFactory; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java index 48f1f48dc5..fdfe329514 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; +package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; import com.google.common.base.Preconditions; import lombok.extern.slf4j.Slf4j; import org.apache.curator.framework.recipes.cache.ChildData; import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.shardingsphere.elasticjob.engine.internal.util.SensitiveInfoUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.util.SensitiveInfoUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodePath.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodePath.java index 10c643ea1b..ad6221af1c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePath.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodePath.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.storage; +package org.apache.shardingsphere.elasticjob.kernel.internal.storage; import lombok.RequiredArgsConstructor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorage.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorage.java index 17f3429d8d..6ff43fe635 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorage.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorage.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.storage; +package org.apache.shardingsphere.elasticjob.kernel.internal.storage; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerNotifierManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerNotifierManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManager.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManager.java index 3acc24bc6e..f22fba49d4 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManager.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.trigger; +package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.AbstractListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java index d962d05b40..1588ae1700 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.trigger; +package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; /** * Trigger node. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerService.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerService.java index f05502b9cd..12421b8e9d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerService.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.trigger; +package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java index cc41d7a012..ae23f403f3 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtils.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.util; +package org.apache.shardingsphere.elasticjob.kernel.internal.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java index c0f67881bb..f7110eef75 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java index 80da4538ef..11e55d116e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.listener; +package org.apache.shardingsphere.elasticjob.kernel.api.listener; import com.google.common.collect.Sets; import org.apache.shardingsphere.elasticjob.infra.env.TimeService; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.ElasticJobListenerCaller; -import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeService; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/ElasticJobListenerCaller.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/ElasticJobListenerCaller.java index d0adda6526..021e163b83 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/ElasticJobListenerCaller.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/ElasticJobListenerCaller.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; public interface ElasticJobListenerCaller { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java index 971b0b2f39..abdd4f049c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestDistributeOnceElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; public final class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java index c2c66a9213..c21bb39f05 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/listener/fixture/TestElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistryTest.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistryTest.java index 41e1ab8cb7..0e5c8cb504 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/api/registry/JobInstanceRegistryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistryTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.api.registry; +package org.apache.shardingsphere.elasticjob.kernel.api.registry; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/EmbedTestingServer.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/EmbedTestingServer.java index 18f305d9a9..6c704fb401 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/EmbedTestingServer.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/EmbedTestingServer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.fixture; +package org.apache.shardingsphere.elasticjob.kernel.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/LiteYamlConstants.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/LiteYamlConstants.java index 9cedba22bf..c7820a9f46 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/LiteYamlConstants.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/LiteYamlConstants.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.fixture; +package org.apache.shardingsphere.elasticjob.kernel.fixture; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java index ed0ad4dcfb..7c033faafe 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/executor/ClassedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.fixture.executor; +package org.apache.shardingsphere.elasticjob.kernel.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.executor.JobFacade; import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; public final class ClassedFooJobExecutor implements ClassedJobItemExecutor { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java index 31f8549d9b..74aedd3b12 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationSimpleJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.fixture.job; +package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java index e235c59449..a75257759b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/AnnotationUnShardingJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.fixture.job; +package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java index 48ccb4a117..7d3f5087b6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/DetailedFooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.fixture.job; +package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java index 09f90f1bc5..f0fe640568 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/fixture/job/FooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.fixture.job; +package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.ShardingContext; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java similarity index 87% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java index 88f98ed8bb..a91788f42a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/BaseIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate; +package org.apache.shardingsphere.elasticjob.kernel.integrate; import lombok.AccessLevel; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java similarity index 88% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java index ddcc15c44a..9c52f28fc9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/DisabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.disable; +package org.apache.shardingsphere.elasticjob.kernel.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.engine.integrate.BaseIntegrateTest; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.integrate.BaseIntegrateTest; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.hamcrest.core.IsNull; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/OneOffDisabledJobIntegrateTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/OneOffDisabledJobIntegrateTest.java index 0bcbfe302c..4905aebc6e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/OneOffDisabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/OneOffDisabledJobIntegrateTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.disable; +package org.apache.shardingsphere.elasticjob.kernel.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/ScheduleDisabledJobIntegrateTest.java similarity index 91% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/ScheduleDisabledJobIntegrateTest.java index 139f83bace..a2fc80c17c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/disable/ScheduleDisabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/ScheduleDisabledJobIntegrateTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.disable; +package org.apache.shardingsphere.elasticjob.kernel.integrate.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java similarity index 90% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java index 347f7667a3..d163bab5b1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/EnabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.enable; +package org.apache.shardingsphere.elasticjob.kernel.integrate.enable; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.integrate.BaseIntegrateTest; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.integrate.BaseIntegrateTest; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.junit.jupiter.api.BeforeEach; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/OneOffEnabledJobIntegrateTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/OneOffEnabledJobIntegrateTest.java index 97ca2809b1..65b4301de7 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/OneOffEnabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/OneOffEnabledJobIntegrateTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.enable; +package org.apache.shardingsphere.elasticjob.kernel.integrate.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/ScheduleEnabledJobIntegrateTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/ScheduleEnabledJobIntegrateTest.java index 8c2def4db7..c4a6343723 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/enable/ScheduleEnabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/ScheduleEnabledJobIntegrateTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.enable; +package org.apache.shardingsphere.elasticjob.kernel.integrate.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestDistributeOnceElasticJobListener.java similarity index 91% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestDistributeOnceElasticJobListener.java index 834056f851..b0c654c77e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestDistributeOnceElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestDistributeOnceElasticJobListener.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.listener; +package org.apache.shardingsphere.elasticjob.kernel.integrate.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; public class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestElasticJobListener.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestElasticJobListener.java index b45e1fbeb1..81fe295709 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/integrate/listener/TestElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.integrate.listener; +package org.apache.shardingsphere.elasticjob.kernel.integrate.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java index d9ebaaf0d6..0582b14b61 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/JobAnnotationBuilderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.annotation; +package org.apache.shardingsphere.elasticjob.kernel.internal.annotation; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationSimpleJob; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java similarity index 86% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java index 9eae55a220..1e92e5a255 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/BaseAnnotationTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java @@ -15,20 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.kernel.internal.annotation.integrate; import lombok.AccessLevel; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.engine.internal.annotation.JobAnnotationBuilder; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java index 80fcf37d95..f0b5d7a214 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.kernel.internal.annotation.integrate; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.AnnotationUnShardingJob; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationUnShardingJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java index 919d855e1f..eb1c3cff11 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.kernel.internal.annotation.integrate; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.AnnotationSimpleJob; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationNodeTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationNodeTest.java index e86dd45811..1c56d09407 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.config; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java index 0963268060..d539de0c2d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/ConfigurationServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.config; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -23,9 +23,9 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -84,7 +84,7 @@ void assertLoadFromCacheButNull() { void assertSetUpJobConfigurationJobConfigurationForJobConflict() { assertThrows(JobConfigurationException.class, () -> { when(jobNodeStorage.isJobRootNodeExisted()).thenReturn(true); - when(jobNodeStorage.getJobRootNodeData()).thenReturn("org.apache.shardingsphere.elasticjob.engine.api.script.api.ScriptJob"); + when(jobNodeStorage.getJobRootNodeData()).thenReturn("org.apache.shardingsphere.elasticjob.kernel.api.script.api.ScriptJob"); try { configService.setUpJobConfiguration(null, JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build()); } finally { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java similarity index 91% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java index a46473049d..8b47c957a4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/config/RescheduleListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.config; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java index f4b7b86aed..3c9c8fdd8e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/ElectionListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.election; +package org.apache.shardingsphere.elasticjob.kernel.internal.election; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderNodeTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderNodeTest.java index adc4857455..a3e9fa33e7 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.election; +package org.apache.shardingsphere.elasticjob.kernel.internal.election; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java index f5a95a8eef..326a7bf21d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/election/LeaderServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.election; +package org.apache.shardingsphere.elasticjob.kernel.internal.election; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService.LeaderElectionExecutionCallback; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService.LeaderElectionExecutionCallback; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java index 2962561f0a..2fb30acdb6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java @@ -15,20 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.failover; +package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverNodeTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverNodeTest.java index ad7fe3abdf..d5ebecf6e2 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.failover; +package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java index ff6531c1ca..e124f2d2fb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/failover/FailoverServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.failover; +package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java index f0c9ecc69b..b51f851ea4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; +package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeNodeTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeNodeTest.java index 6478383955..955dbcd4aa 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; +package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java index e9c9925ac1..b57d475955 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/guarantee/GuaranteeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.guarantee; +package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java index 814dd850fe..e57360719f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.instance; +package org.apache.shardingsphere.elasticjob.kernel.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java index 9d6934fcc3..92a4c52288 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/InstanceServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.instance; +package org.apache.shardingsphere.elasticjob.kernel.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java index f8b372fc49..648c4905b6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/instance/ShutdownListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.instance; +package org.apache.shardingsphere.elasticjob.kernel.internal.instance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.SchedulerFacade; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.SchedulerFacade; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManagerTest.java similarity index 85% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManagerTest.java index a4faecfd72..3b24e005f8 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManagerTest.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.listener; -import org.apache.shardingsphere.elasticjob.engine.internal.config.RescheduleListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.election.ElectionListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.guarantee.GuaranteeListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.ShutdownListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.MonitorExecutionListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.internal.trigger.TriggerListenerManager; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.RescheduleListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.ElectionListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.ShutdownListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.MonitorExecutionListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.internal.trigger.TriggerListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerNotifierManagerTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerNotifierManagerTest.java index 5004bdf367..5d41011055 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/ListenerNotifierManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerNotifierManagerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.listener; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java similarity index 90% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java index 59bc43c88d..11addd1d5b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/listener/RegistryCenterConnectionStateListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.listener; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener.State; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java similarity index 91% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java index e739004deb..ed81011efe 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/reconcile/ReconcileServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.reconcile; +package org.apache.shardingsphere.elasticjob.kernel.internal.reconcile; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java index cf90da4558..faebd5eac3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobRegistryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java similarity index 99% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java index 954411397c..7638f6eae9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobScheduleControllerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobTriggerListenerTest.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobTriggerListenerTest.java index 83f7cd8856..2be655b2b0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/JobTriggerListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobTriggerListenerTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacadeTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacadeTest.java index a038e08b6a..79a25322cf 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/LiteJobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacadeTest.java @@ -15,20 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.ElasticJobListenerCaller; -import org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestElasticJobListener; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.failover.FailoverService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionContextService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ExecutionService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java index 20808cdc9f..bed1745ce6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/schedule/SchedulerFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java index e5c65f3b3c..ee4f7e88f5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.server; +package org.apache.shardingsphere.elasticjob.kernel.internal.server; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java index 8b73f171e7..f6e7d99a9c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/server/ServerServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.server; +package org.apache.shardingsphere.elasticjob.kernel.internal.server; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProviderTest.java similarity index 86% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProviderTest.java index 8677c40555..03cd4941eb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/DefaultJobClassNameProviderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/DefaultJobClassNameProviderTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.setup; +package org.apache.shardingsphere.elasticjob.kernel.internal.setup; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledForJreRange; import org.junit.jupiter.api.condition.JRE; @@ -32,7 +32,7 @@ class DefaultJobClassNameProviderTest { void assertGetOrdinaryClassJobName() { JobClassNameProvider jobClassNameProvider = new DefaultJobClassNameProvider(); String result = jobClassNameProvider.getJobClassName(new DetailedFooJob()); - assertThat(result, is("org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob")); + assertThat(result, is("org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob")); } // TODO OpenJDK 21 breaks this unit test. @@ -43,6 +43,6 @@ void assertGetLambdaJobName() { FooJob lambdaFooJob = shardingContext -> { }; String result = jobClassNameProvider.getJobClassName(lambdaFooJob); - assertThat(result, is("org.apache.shardingsphere.elasticjob.engine.internal.setup.DefaultJobClassNameProviderTest$$Lambda$")); + assertThat(result, is("org.apache.shardingsphere.elasticjob.kernel.internal.setup.DefaultJobClassNameProviderTest$$Lambda$")); } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactoryTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactoryTest.java index 9abcb65459..55ce2a9989 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/JobClassNameProviderFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactoryTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.setup; +package org.apache.shardingsphere.elasticjob.kernel.internal.setup; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java similarity index 85% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java index 9a75384159..3f99581c74 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/setup/SetUpFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.setup; +package org.apache.shardingsphere.elasticjob.kernel.internal.setup; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerManager; -import org.apache.shardingsphere.elasticjob.engine.internal.reconcile.ReconcileService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerManager; +import org.apache.shardingsphere.elasticjob.kernel.internal.reconcile.ReconcileService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java index e9c592c709..23a2e4db46 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionContextServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java index b994a17350..9abcf8e311 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ExecutionServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java index 5b7b87069f..20fa06d6dd 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/MonitorExecutionListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; -import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java index 7a2c29e56d..e8e6fee1df 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.fixture.LiteYamlConstants; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingNodeTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingNodeTest.java index b017950f6d..eccc117990 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingNodeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java index f41bc8dadf..9f38576a74 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/sharding/ShardingServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.config.ConfigurationService; -import org.apache.shardingsphere.elasticjob.engine.internal.election.LeaderService; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceNode; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java similarity index 89% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java index d515d6837d..98309a2cfa 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/BaseSnapshotServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; +package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; import lombok.AccessLevel; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.fixture.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java index 418081d3d6..62c5a02fbe 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceDisableTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; +package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceEnableTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceEnableTest.java index e366fd6847..3c40dcaa52 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SnapshotServiceEnableTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceEnableTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; +package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; -import org.apache.shardingsphere.elasticjob.engine.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SocketUtils.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SocketUtils.java index 39ec76d93e..130c10288a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/snapshot/SocketUtils.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SocketUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.snapshot; +package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodePathTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodePathTest.java index ab920776c8..a49243cfbc 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodePathTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodePathTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.storage; +package org.apache.shardingsphere.elasticjob.kernel.internal.storage; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java index 3d32f5b7ff..2d43bcb628 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/storage/JobNodeStorageTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.storage; +package org.apache.shardingsphere.elasticjob.kernel.internal.storage; -import org.apache.shardingsphere.elasticjob.engine.internal.listener.ListenerNotifierManager; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerNotifierManager; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; import org.apache.shardingsphere.elasticjob.reg.exception.RegException; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java index 0f17628c27..f30045eb30 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/trigger/TriggerListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.trigger; +package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduleController; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.engine.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; +import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtilsTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtilsTest.java index cc1771b949..e21dae37d9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/internal/util/SensitiveInfoUtilsTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.internal.util; +package org.apache.shardingsphere.elasticjob.kernel.internal.util; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/util/ReflectionUtils.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/util/ReflectionUtils.java index fe4639b48d..cc93be2bec 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/engine/util/ReflectionUtils.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/util/ReflectionUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.engine.util; +package org.apache.shardingsphere.elasticjob.kernel.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor index 7302c9a357..bb119fea59 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.fixture.executor.ClassedFooJobExecutor +org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index cc9b221927..69fd14c6e0 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -15,7 +15,7 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestDistributeOnceElasticJobListener -org.apache.shardingsphere.elasticjob.engine.api.listener.fixture.TestElasticJobListener -org.apache.shardingsphere.elasticjob.engine.integrate.listener.TestDistributeOnceElasticJobListener -org.apache.shardingsphere.elasticjob.engine.integrate.listener.TestElasticJobListener +org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener +org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestElasticJobListener +org.apache.shardingsphere.elasticjob.kernel.integrate.listener.TestDistributeOnceElasticJobListener +org.apache.shardingsphere.elasticjob.kernel.integrate.listener.TestElasticJobListener diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index 3910420a37..bbddeff36a 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -36,7 +36,7 @@ - + diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java index 899a2e7b13..3ba3e6922b 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java @@ -20,10 +20,10 @@ import com.google.common.base.Preconditions; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.instance.InstanceService; -import org.apache.shardingsphere.elasticjob.engine.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; +import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImpl.java index 58ea9020f7..ececf03ba2 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/ShardingOperateAPIImpl.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.operate; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java index 39150556cc..5f2405ba70 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java @@ -21,7 +21,7 @@ import com.google.common.base.Strings; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index 7e745eb95e..a1e978f95a 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; import org.apache.shardingsphere.elasticjob.lifecycle.domain.JobBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java index edbe7b3815..95cd969323 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java @@ -20,7 +20,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI; import org.apache.shardingsphere.elasticjob.lifecycle.domain.ServerBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java index 097dd652dd..32b91f473e 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java @@ -20,7 +20,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.engine.internal.storage.JobNodePath; +import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI; import org.apache.shardingsphere.elasticjob.lifecycle.domain.ShardingInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index 2895efde50..a8d157f0e6 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -23,8 +23,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java index 423f37e7eb..9896f3e389 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java @@ -19,7 +19,7 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.springframework.boot.CommandLineRunner; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java index 1fdaf4dc0a..0466bb69db 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfiguration.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot; -import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java index a8e2984215..2e4a8630fa 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.AnnotationCustomJob; import org.apache.shardingsphere.elasticjob.spring.core.scanner.ElasticJobScan; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 4d9860908c..4decf24348 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -19,10 +19,10 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob; import org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java index 49a570005a..ac3bfea062 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot; -import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java index f17f70badb..a811f4b843 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java @@ -19,7 +19,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.RuntimeBeanReference; diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/setup/SpringProxyJobClassNameProvider.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/setup/SpringProxyJobClassNameProvider.java index 7ea11d493a..69f9e80eeb 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/setup/SpringProxyJobClassNameProvider.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/setup/SpringProxyJobClassNameProvider.java @@ -19,7 +19,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider; +import org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProvider; import org.apache.shardingsphere.elasticjob.spring.core.util.AopTargetUtils; import org.springframework.aop.support.AopUtils; diff --git a/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider b/spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProvider similarity index 100% rename from spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProvider rename to spring/core/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProvider diff --git a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/setup/JobClassNameProviderFactoryTest.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/setup/JobClassNameProviderFactoryTest.java index 2aab5fed07..aa073a278f 100644 --- a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/setup/JobClassNameProviderFactoryTest.java +++ b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/setup/JobClassNameProviderFactoryTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.core.setup; -import org.apache.shardingsphere.elasticjob.engine.internal.setup.JobClassNameProviderFactory; +import org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java index c7da27b158..335deb77de 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java @@ -19,8 +19,8 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.namespace.job.tag.JobBeanDefinitionTag; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java index bcc4efd400..a61504fa69 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/parser/SnapshotBeanDefinitionParser.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot.parser; -import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.spring.namespace.snapshot.tag.SnapshotBeanDefinitionTag; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java index 58a9b7cf8a..8336f7ecda 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.engine.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java index 9278d7f688..0fe0e9f515 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.FooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index 7ba171ff51..d690c6b49b 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.FooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 9d64011a41..3443e123f2 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index 55a28af43c..e33cd687c7 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index 36d5417fc5..c2e5c17d31 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index 153c52bdb0..784cbada79 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.engine.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.awaitility.Awaitility; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index abe9ec754b..a28f60b4cc 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.scanner; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.engine.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java index 38d79cea6b..126a792343 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot; -import org.apache.shardingsphere.elasticjob.engine.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.junit.jupiter.api.Test; import org.springframework.test.context.ContextConfiguration; From 26e0af683183a927b185b9a199fd9d6e888b394b Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 15:37:20 +0800 Subject: [PATCH 068/178] Refactor example module structure --- .../pom.xml | 2 +- .../apache/shardingsphere/elasticjob/example/JavaMain.java | 2 +- .../src/main/resources/logback.xml | 2 +- .../src/main/resources/script/demo.bat | 0 .../src/main/resources/script/demo.sh | 0 .../pom.xml | 2 +- .../shardingsphere/elasticjob/example/SpringMain.java | 0 .../src/main/resources/META-INF/application-context.xml | 0 .../src/main/resources/conf/job.properties | 2 +- .../src/main/resources/conf/reg.properties | 2 +- .../src/main/resources/logback.xml | 2 +- .../src/main/resources/script/demo.bat | 0 .../src/main/resources/script/demo.sh | 0 .../pom.xml | 2 +- .../shardingsphere/elasticjob/example/SpringBootMain.java | 0 .../elasticjob/example/controller/OneOffJobController.java | 0 .../shardingsphere/elasticjob/example/entity/Foo.java | 0 .../elasticjob/example/job/SpringBootDataflowJob.java | 0 .../example/job/SpringBootOccurErrorNoticeDingtalkJob.java | 0 .../example/job/SpringBootOccurErrorNoticeEmailJob.java | 0 .../example/job/SpringBootOccurErrorNoticeWechatJob.java | 0 .../elasticjob/example/job/SpringBootSimpleJob.java | 0 .../elasticjob/example/repository/FooRepository.java | 0 .../src/main/resources/application-dev.yml | 0 .../src/main/resources/application-prod.yml | 0 .../src/main/resources/application.yml | 0 .../src/main/resources/logback.xml | 2 +- examples/pom.xml | 6 +++--- 28 files changed, 12 insertions(+), 12 deletions(-) rename examples/{elasticjob-example-lite-java => elasticjob-example-java}/pom.xml (98%) rename examples/{elasticjob-example-lite-java => elasticjob-example-java}/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java (99%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-java}/src/main/resources/logback.xml (95%) rename examples/{elasticjob-example-lite-java => elasticjob-example-java}/src/main/resources/script/demo.bat (100%) rename examples/{elasticjob-example-lite-java => elasticjob-example-java}/src/main/resources/script/demo.sh (100%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-spring}/pom.xml (98%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-spring}/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java (100%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-spring}/src/main/resources/META-INF/application-context.xml (100%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-spring}/src/main/resources/conf/job.properties (98%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-spring}/src/main/resources/conf/reg.properties (95%) rename examples/{elasticjob-example-lite-java => elasticjob-example-spring}/src/main/resources/logback.xml (95%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-spring}/src/main/resources/script/demo.bat (100%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-spring}/src/main/resources/script/demo.sh (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/pom.xml (98%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/resources/application-dev.yml (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/resources/application-prod.yml (100%) rename examples/{elasticjob-example-lite-springboot => elasticjob-example-springboot}/src/main/resources/application.yml (100%) rename examples/{elasticjob-example-lite-spring => elasticjob-example-springboot}/src/main/resources/logback.xml (95%) diff --git a/examples/elasticjob-example-lite-java/pom.xml b/examples/elasticjob-example-java/pom.xml similarity index 98% rename from examples/elasticjob-example-lite-java/pom.xml rename to examples/elasticjob-example-java/pom.xml index e64fd59d3a..8a5186c8a3 100644 --- a/examples/elasticjob-example-lite-java/pom.xml +++ b/examples/elasticjob-example-java/pom.xml @@ -25,7 +25,7 @@ elasticjob-example ${revision} - elasticjob-example-lite-java + elasticjob-example-java ${project.artifactId} diff --git a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java similarity index 99% rename from examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java rename to examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index d8cc2bbaeb..c7f6d49354 100644 --- a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java +++ b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -48,7 +48,7 @@ public final class JavaMain { private static final String ZOOKEEPER_CONNECTION_STRING = "localhost:" + EMBED_ZOOKEEPER_PORT; - private static final String JOB_NAMESPACE = "elasticjob-example-lite-java"; + private static final String JOB_NAMESPACE = "elasticjob-example-java"; // switch to MySQL by yourself // private static final String EVENT_RDB_STORAGE_DRIVER = "com.mysql.cj.jdbc.Driver"; diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/logback.xml b/examples/elasticjob-example-java/src/main/resources/logback.xml similarity index 95% rename from examples/elasticjob-example-lite-springboot/src/main/resources/logback.xml rename to examples/elasticjob-example-java/src/main/resources/logback.xml index 64ecc5a970..133a8717b6 100644 --- a/examples/elasticjob-example-lite-springboot/src/main/resources/logback.xml +++ b/examples/elasticjob-example-java/src/main/resources/logback.xml @@ -18,7 +18,7 @@ - + diff --git a/examples/elasticjob-example-lite-java/src/main/resources/script/demo.bat b/examples/elasticjob-example-java/src/main/resources/script/demo.bat similarity index 100% rename from examples/elasticjob-example-lite-java/src/main/resources/script/demo.bat rename to examples/elasticjob-example-java/src/main/resources/script/demo.bat diff --git a/examples/elasticjob-example-lite-java/src/main/resources/script/demo.sh b/examples/elasticjob-example-java/src/main/resources/script/demo.sh similarity index 100% rename from examples/elasticjob-example-lite-java/src/main/resources/script/demo.sh rename to examples/elasticjob-example-java/src/main/resources/script/demo.sh diff --git a/examples/elasticjob-example-lite-spring/pom.xml b/examples/elasticjob-example-spring/pom.xml similarity index 98% rename from examples/elasticjob-example-lite-spring/pom.xml rename to examples/elasticjob-example-spring/pom.xml index 4f3b2043f7..bdba0392f5 100644 --- a/examples/elasticjob-example-lite-spring/pom.xml +++ b/examples/elasticjob-example-spring/pom.xml @@ -25,7 +25,7 @@ elasticjob-example ${revision} - elasticjob-example-lite-spring + elasticjob-example-spring ${project.artifactId} diff --git a/examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java b/examples/elasticjob-example-spring/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java similarity index 100% rename from examples/elasticjob-example-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java rename to examples/elasticjob-example-spring/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringMain.java diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml b/examples/elasticjob-example-spring/src/main/resources/META-INF/application-context.xml similarity index 100% rename from examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml rename to examples/elasticjob-example-spring/src/main/resources/META-INF/application-context.xml diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/conf/job.properties b/examples/elasticjob-example-spring/src/main/resources/conf/job.properties similarity index 98% rename from examples/elasticjob-example-lite-spring/src/main/resources/conf/job.properties rename to examples/elasticjob-example-spring/src/main/resources/conf/job.properties index 3a5d8dbbaa..d825ade30c 100644 --- a/examples/elasticjob-example-lite-spring/src/main/resources/conf/job.properties +++ b/examples/elasticjob-example-spring/src/main/resources/conf/job.properties @@ -45,7 +45,7 @@ dataflow.overwrite=true script.id=springScriptJob # need absolute path -script.scriptCommandLine=your_path/elasticjob/elasticjob-example/elasticjob-example-lite-spring/src/main/resources/script/demo.sh +script.scriptCommandLine=your_path/elasticjob/elasticjob-example/elasticjob-example-spring/src/main/resources/script/demo.sh script.cron=0/5 * * * * ? script.shardingTotalCount=3 diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/conf/reg.properties b/examples/elasticjob-example-spring/src/main/resources/conf/reg.properties similarity index 95% rename from examples/elasticjob-example-lite-spring/src/main/resources/conf/reg.properties rename to examples/elasticjob-example-spring/src/main/resources/conf/reg.properties index d572bdc040..71795b3fec 100644 --- a/examples/elasticjob-example-lite-spring/src/main/resources/conf/reg.properties +++ b/examples/elasticjob-example-spring/src/main/resources/conf/reg.properties @@ -16,7 +16,7 @@ # serverLists=localhost:5181 -namespace=elasticjob-example-lite-spring +namespace=elasticjob-example-spring baseSleepTimeMilliseconds=1000 maxSleepTimeMilliseconds=3000 maxRetries=3 diff --git a/examples/elasticjob-example-lite-java/src/main/resources/logback.xml b/examples/elasticjob-example-spring/src/main/resources/logback.xml similarity index 95% rename from examples/elasticjob-example-lite-java/src/main/resources/logback.xml rename to examples/elasticjob-example-spring/src/main/resources/logback.xml index 64ecc5a970..133a8717b6 100644 --- a/examples/elasticjob-example-lite-java/src/main/resources/logback.xml +++ b/examples/elasticjob-example-spring/src/main/resources/logback.xml @@ -18,7 +18,7 @@ - + diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/script/demo.bat b/examples/elasticjob-example-spring/src/main/resources/script/demo.bat similarity index 100% rename from examples/elasticjob-example-lite-spring/src/main/resources/script/demo.bat rename to examples/elasticjob-example-spring/src/main/resources/script/demo.bat diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/script/demo.sh b/examples/elasticjob-example-spring/src/main/resources/script/demo.sh similarity index 100% rename from examples/elasticjob-example-lite-spring/src/main/resources/script/demo.sh rename to examples/elasticjob-example-spring/src/main/resources/script/demo.sh diff --git a/examples/elasticjob-example-lite-springboot/pom.xml b/examples/elasticjob-example-springboot/pom.xml similarity index 98% rename from examples/elasticjob-example-lite-springboot/pom.xml rename to examples/elasticjob-example-springboot/pom.xml index 125be9b2e8..f7c39a0b56 100644 --- a/examples/elasticjob-example-lite-springboot/pom.xml +++ b/examples/elasticjob-example-springboot/pom.xml @@ -25,7 +25,7 @@ elasticjob-example ${revision} - elasticjob-example-lite-springboot + elasticjob-example-springboot ${project.artifactId} diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/SpringBootMain.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/entity/Foo.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java rename to examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/repository/FooRepository.java diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/application-dev.yml b/examples/elasticjob-example-springboot/src/main/resources/application-dev.yml similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/resources/application-dev.yml rename to examples/elasticjob-example-springboot/src/main/resources/application-dev.yml diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/application-prod.yml b/examples/elasticjob-example-springboot/src/main/resources/application-prod.yml similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/resources/application-prod.yml rename to examples/elasticjob-example-springboot/src/main/resources/application-prod.yml diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml b/examples/elasticjob-example-springboot/src/main/resources/application.yml similarity index 100% rename from examples/elasticjob-example-lite-springboot/src/main/resources/application.yml rename to examples/elasticjob-example-springboot/src/main/resources/application.yml diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/logback.xml b/examples/elasticjob-example-springboot/src/main/resources/logback.xml similarity index 95% rename from examples/elasticjob-example-lite-spring/src/main/resources/logback.xml rename to examples/elasticjob-example-springboot/src/main/resources/logback.xml index 64ecc5a970..133a8717b6 100644 --- a/examples/elasticjob-example-lite-spring/src/main/resources/logback.xml +++ b/examples/elasticjob-example-springboot/src/main/resources/logback.xml @@ -18,7 +18,7 @@ - + diff --git a/examples/pom.xml b/examples/pom.xml index 15918249c6..35960d578e 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -30,9 +30,9 @@ elasticjob-example-jobs elasticjob-example-embed-zk - elasticjob-example-lite-java - elasticjob-example-lite-spring - elasticjob-example-lite-springboot + elasticjob-example-java + elasticjob-example-spring + elasticjob-example-springboot From a8149de8211a53ef867187bd8a3c457b9d85a375 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 16:47:18 +0800 Subject: [PATCH 069/178] Refactor log dependencies --- ecosystem/error-handler/type/dingtalk/pom.xml | 14 -------------- ecosystem/error-handler/type/email/pom.xml | 15 +-------------- ecosystem/error-handler/type/general/pom.xml | 5 ----- ecosystem/error-handler/type/wechat/pom.xml | 14 -------------- ecosystem/executor/type/http/pom.xml | 1 - ecosystem/tracing/api/pom.xml | 15 --------------- ecosystem/tracing/rdb/pom.xml | 10 ---------- infra/pom.xml | 16 ---------------- kernel/pom.xml | 16 ---------------- lifecycle/pom.xml | 15 --------------- pom.xml | 4 ++++ registry-center/api/pom.xml | 15 --------------- .../provider/zookeeper-curator/pom.xml | 10 ---------- 13 files changed, 5 insertions(+), 145 deletions(-) diff --git a/ecosystem/error-handler/type/dingtalk/pom.xml b/ecosystem/error-handler/type/dingtalk/pom.xml index f925e4664a..82dc2ef285 100644 --- a/ecosystem/error-handler/type/dingtalk/pom.xml +++ b/ecosystem/error-handler/type/dingtalk/pom.xml @@ -43,10 +43,6 @@ test - - org.slf4j - slf4j-api - org.apache.httpcomponents httpclient @@ -60,15 +56,5 @@ logback-classic test - - org.slf4j - log4j-over-slf4j - test - - - org.slf4j - jcl-over-slf4j - test - diff --git a/ecosystem/error-handler/type/email/pom.xml b/ecosystem/error-handler/type/email/pom.xml index 22f36be9f1..c62ede59df 100644 --- a/ecosystem/error-handler/type/email/pom.xml +++ b/ecosystem/error-handler/type/email/pom.xml @@ -36,10 +36,7 @@ elasticjob-error-handler-general ${project.parent.version} - - org.slf4j - slf4j-api - + com.sun.mail javax.mail @@ -50,15 +47,5 @@ logback-classic test - - org.slf4j - log4j-over-slf4j - test - - - org.slf4j - jcl-over-slf4j - test - diff --git a/ecosystem/error-handler/type/general/pom.xml b/ecosystem/error-handler/type/general/pom.xml index df581f134f..f474b8ac72 100644 --- a/ecosystem/error-handler/type/general/pom.xml +++ b/ecosystem/error-handler/type/general/pom.xml @@ -37,11 +37,6 @@ ${project.parent.version} - - org.slf4j - slf4j-api - - ch.qos.logback logback-classic diff --git a/ecosystem/error-handler/type/wechat/pom.xml b/ecosystem/error-handler/type/wechat/pom.xml index 46a8696620..ef8b213a56 100644 --- a/ecosystem/error-handler/type/wechat/pom.xml +++ b/ecosystem/error-handler/type/wechat/pom.xml @@ -43,10 +43,6 @@ test - - org.slf4j - slf4j-api - org.apache.httpcomponents httpclient @@ -60,15 +56,5 @@ logback-classic test - - org.slf4j - log4j-over-slf4j - test - - - org.slf4j - jcl-over-slf4j - test - diff --git a/ecosystem/executor/type/http/pom.xml b/ecosystem/executor/type/http/pom.xml index ceba1b6ca5..7bcd9c0ce8 100644 --- a/ecosystem/executor/type/http/pom.xml +++ b/ecosystem/executor/type/http/pom.xml @@ -49,7 +49,6 @@ org.awaitility awaitility - test diff --git a/ecosystem/tracing/api/pom.xml b/ecosystem/tracing/api/pom.xml index 2a4caf1904..6468d95931 100644 --- a/ecosystem/tracing/api/pom.xml +++ b/ecosystem/tracing/api/pom.xml @@ -42,22 +42,7 @@ org.apache.commons commons-lang3 - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - ch.qos.logback logback-classic diff --git a/ecosystem/tracing/rdb/pom.xml b/ecosystem/tracing/rdb/pom.xml index dd4d492c7f..1e6c64bbe9 100644 --- a/ecosystem/tracing/rdb/pom.xml +++ b/ecosystem/tracing/rdb/pom.xml @@ -33,16 +33,6 @@ ${project.parent.version} - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - ch.qos.logback logback-classic diff --git a/infra/pom.xml b/infra/pom.xml index bc8f70d631..43fd2f36fd 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -45,22 +45,7 @@ com.google.code.gson gson - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - ch.qos.logback logback-classic @@ -69,7 +54,6 @@ org.awaitility awaitility - test diff --git a/kernel/pom.xml b/kernel/pom.xml index 83a8561039..1bf670c004 100644 --- a/kernel/pom.xml +++ b/kernel/pom.xml @@ -94,25 +94,9 @@ org.apache.curator curator-test - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - - - ch.qos.logback - logback-classic - test - org.awaitility awaitility - test diff --git a/lifecycle/pom.xml b/lifecycle/pom.xml index 0ee436659d..c9b00630ed 100644 --- a/lifecycle/pom.xml +++ b/lifecycle/pom.xml @@ -47,20 +47,5 @@ org.apache.curator curator-test - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - - - ch.qos.logback - logback-classic - test - diff --git a/pom.xml b/pom.xml index b6cbdc27ba..38760cbe6d 100644 --- a/pom.xml +++ b/pom.xml @@ -353,6 +353,10 @@ com.google.guava guava + + org.slf4j + slf4j-api + org.projectlombok diff --git a/registry-center/api/pom.xml b/registry-center/api/pom.xml index e92a2ce428..315f755418 100644 --- a/registry-center/api/pom.xml +++ b/registry-center/api/pom.xml @@ -27,21 +27,6 @@ ${project.artifactId} - - org.slf4j - slf4j-api - - - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - ch.qos.logback logback-classic diff --git a/registry-center/provider/zookeeper-curator/pom.xml b/registry-center/provider/zookeeper-curator/pom.xml index e0176829a1..6b0a906c31 100644 --- a/registry-center/provider/zookeeper-curator/pom.xml +++ b/registry-center/provider/zookeeper-curator/pom.xml @@ -50,16 +50,6 @@ org.apache.curator curator-test - - org.slf4j - jcl-over-slf4j - test - - - org.slf4j - log4j-over-slf4j - test - ch.qos.logback logback-classic From d213fbafddd8e27171ce601f3ec6f8f2a5cc1ac7 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 15 Oct 2023 17:00:21 +0800 Subject: [PATCH 070/178] Refactor log dependencies --- ecosystem/error-handler/type/dingtalk/pom.xml | 5 ----- ecosystem/error-handler/type/email/pom.xml | 6 ------ ecosystem/error-handler/type/general/pom.xml | 6 ------ ecosystem/error-handler/type/wechat/pom.xml | 5 ----- ecosystem/executor/kernel/pom.xml | 6 ------ ecosystem/tracing/api/pom.xml | 6 ------ ecosystem/tracing/rdb/pom.xml | 5 ----- infra/pom.xml | 5 ----- pom.xml | 5 +++++ registry-center/api/pom.xml | 8 -------- registry-center/provider/zookeeper-curator/pom.xml | 5 ----- 11 files changed, 5 insertions(+), 57 deletions(-) diff --git a/ecosystem/error-handler/type/dingtalk/pom.xml b/ecosystem/error-handler/type/dingtalk/pom.xml index 82dc2ef285..1805e72790 100644 --- a/ecosystem/error-handler/type/dingtalk/pom.xml +++ b/ecosystem/error-handler/type/dingtalk/pom.xml @@ -51,10 +51,5 @@ org.apache.httpcomponents httpcore - - ch.qos.logback - logback-classic - test - diff --git a/ecosystem/error-handler/type/email/pom.xml b/ecosystem/error-handler/type/email/pom.xml index c62ede59df..add0f0569c 100644 --- a/ecosystem/error-handler/type/email/pom.xml +++ b/ecosystem/error-handler/type/email/pom.xml @@ -41,11 +41,5 @@ com.sun.mail javax.mail - - - ch.qos.logback - logback-classic - test - diff --git a/ecosystem/error-handler/type/general/pom.xml b/ecosystem/error-handler/type/general/pom.xml index f474b8ac72..3ba89be212 100644 --- a/ecosystem/error-handler/type/general/pom.xml +++ b/ecosystem/error-handler/type/general/pom.xml @@ -36,11 +36,5 @@ elasticjob-infra ${project.parent.version} - - - ch.qos.logback - logback-classic - test - diff --git a/ecosystem/error-handler/type/wechat/pom.xml b/ecosystem/error-handler/type/wechat/pom.xml index ef8b213a56..531af35e0f 100644 --- a/ecosystem/error-handler/type/wechat/pom.xml +++ b/ecosystem/error-handler/type/wechat/pom.xml @@ -51,10 +51,5 @@ org.apache.httpcomponents httpcore - - ch.qos.logback - logback-classic - test - diff --git a/ecosystem/executor/kernel/pom.xml b/ecosystem/executor/kernel/pom.xml index 77b8c2a6a3..6b285ae819 100644 --- a/ecosystem/executor/kernel/pom.xml +++ b/ecosystem/executor/kernel/pom.xml @@ -47,11 +47,5 @@ elasticjob-error-handler-general ${project.parent.version} - - - ch.qos.logback - logback-classic - test - diff --git a/ecosystem/tracing/api/pom.xml b/ecosystem/tracing/api/pom.xml index 6468d95931..db999d0723 100644 --- a/ecosystem/tracing/api/pom.xml +++ b/ecosystem/tracing/api/pom.xml @@ -42,11 +42,5 @@ org.apache.commons commons-lang3 - - - ch.qos.logback - logback-classic - test - diff --git a/ecosystem/tracing/rdb/pom.xml b/ecosystem/tracing/rdb/pom.xml index 1e6c64bbe9..1dab41bf0c 100644 --- a/ecosystem/tracing/rdb/pom.xml +++ b/ecosystem/tracing/rdb/pom.xml @@ -33,11 +33,6 @@ ${project.parent.version} - - ch.qos.logback - logback-classic - test - org.apache.commons commons-dbcp2 diff --git a/infra/pom.xml b/infra/pom.xml index 43fd2f36fd..b2cc16cb07 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -46,11 +46,6 @@ gson - - ch.qos.logback - logback-classic - test - org.awaitility awaitility diff --git a/pom.xml b/pom.xml index 38760cbe6d..7a40f8b82d 100644 --- a/pom.xml +++ b/pom.xml @@ -388,6 +388,11 @@ mockito-junit-jupiter test + + ch.qos.logback + logback-classic + test + diff --git a/registry-center/api/pom.xml b/registry-center/api/pom.xml index 315f755418..bfb3dab209 100644 --- a/registry-center/api/pom.xml +++ b/registry-center/api/pom.xml @@ -25,12 +25,4 @@ elasticjob-registry-center-api ${project.artifactId} - - - - ch.qos.logback - logback-classic - test - - diff --git a/registry-center/provider/zookeeper-curator/pom.xml b/registry-center/provider/zookeeper-curator/pom.xml index 6b0a906c31..fb7221feef 100644 --- a/registry-center/provider/zookeeper-curator/pom.xml +++ b/registry-center/provider/zookeeper-curator/pom.xml @@ -50,10 +50,5 @@ org.apache.curator curator-test - - ch.qos.logback - logback-classic - test - From fffabf55f36c42737befcc90f4779c10356d36a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 Oct 2023 17:01:06 +0800 Subject: [PATCH 071/178] Bump org.springframework.boot:spring-boot-starter-web (#2300) Bumps [org.springframework.boot:spring-boot-starter-web](https://github.com/spring-projects/spring-boot) from 2.3.1.RELEASE to 2.5.12. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.3.1.RELEASE...v2.5.12) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-web dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/elasticjob-example-springboot/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/elasticjob-example-springboot/pom.xml b/examples/elasticjob-example-springboot/pom.xml index f7c39a0b56..9e6c287e12 100644 --- a/examples/elasticjob-example-springboot/pom.xml +++ b/examples/elasticjob-example-springboot/pom.xml @@ -29,7 +29,7 @@ ${project.artifactId} - 2.3.1.RELEASE + 2.5.12 5.2.7.RELEASE From 95720d8eefc4bb0eee4f13e79ee570988ed16599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Sun, 15 Oct 2023 17:43:37 +0800 Subject: [PATCH 072/178] Refactor : refactor the release note (#2302) --- RELEASE-NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 88b720f403..f32ac216ed 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,7 +1,7 @@ ## 3.0.4 ## Dependencies Upgrade -1. Update dependencies to avoid CVE +1. Update dependencies to fix CVE ## Enhancements 1. Support for building with OpenJDK 21 From f0c685297d66322d815f3f0ddbeb285671fc2651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 18 Oct 2023 16:06:42 +0800 Subject: [PATCH 073/178] Document : update the elasticjob download page --- docs/content/downloads/_index.cn.md | 6 +++--- docs/content/downloads/_index.en.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/content/downloads/_index.cn.md b/docs/content/downloads/_index.cn.md index fb618730b7..3cf193290d 100644 --- a/docs/content/downloads/_index.cn.md +++ b/docs/content/downloads/_index.cn.md @@ -13,10 +13,10 @@ extracss = true ElasticJob 的发布版包括源码包及其对应的二进制包。 由于下载内容分布在镜像服务器上,所以下载后应该进行 GPG 或 SHA-512 校验,以此来保证内容没有被篡改。 -##### ElasticJob - 版本: 3.0.3 ( 发布日期: Mar 31, 2023 ) +##### ElasticJob - 版本: 3.0.4 ( 发布日期: Oct 18, 2023 ) -- 源码: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.sha512) ] -- ElasticJob 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] +- 源码: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-src.zip.sha512) ] +- ElasticJob 二进制包: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-lite-bin.tar.gz.sha512) ] ##### ElasticJob-UI - 版本: 3.0.2 ( 发布日期: Oct 31, 2022 ) diff --git a/docs/content/downloads/_index.en.md b/docs/content/downloads/_index.en.md index 3f98eae068..658e271948 100644 --- a/docs/content/downloads/_index.en.md +++ b/docs/content/downloads/_index.en.md @@ -13,10 +13,10 @@ extracss = true ElasticJob is released as source code tarballs with corresponding binary tarballs for convenience. The downloads are distributed via mirror sites and should be checked for tampering using GPG or SHA-512. -##### ElasticJob - Version: 3.0.3 ( Release Date: Mar 31, 2023 ) +##### ElasticJob - Version: 3.0.4 ( Release Date: Oct 18, 2023 ) -- Source Codes: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-src.zip.sha512) ] -- ElasticJob Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.3/apache-shardingsphere-elasticjob-3.0.3-lite-bin.tar.gz.sha512) ] +- Source Codes: [ [SRC](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-src.zip) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-src.zip.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-src.zip.sha512) ] +- ElasticJob Binary Distribution: [ [TAR](https://www.apache.org/dyn/closer.lua/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-lite-bin.tar.gz) ] [ [ASC](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-lite-bin.tar.gz.asc) ] [ [SHA512](https://downloads.apache.org/shardingsphere/elasticjob-3.0.4/apache-shardingsphere-elasticjob-3.0.4-lite-bin.tar.gz.sha512) ] ##### ElasticJob-UI - Version: 3.0.2 ( Release Date: Oct 31, 2022 ) From a3565bbd36ca919bc2f474319b64fc2552d5c4db Mon Sep 17 00:00:00 2001 From: shoito <37051+shoito@users.noreply.github.com> Date: Sat, 21 Oct 2023 00:46:03 +0900 Subject: [PATCH 074/178] Fix status badge URLs (#2305) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e97dd8749..a83aaed314 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ You are welcome to communicate with the community via the [mailing list](mailto: [![GitHub release](https://img.shields.io/github/release/apache/shardingsphere-elasticjob.svg)](https://github.com/apache/shardingsphere-elasticjob/releases) [![Maven Status](https://maven-badges.herokuapp.com/maven-central/org.apache.shardingsphere.elasticjob/elasticjob/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.shardingsphere.elasticjob/elasticjob) -[![Build Status](https://secure.travis-ci.org/apache/shardingsphere-elasticjob.png?branch=master)](https://travis-ci.org/apache/shardingsphere-elasticjob) -[![GitHub Workflow](https://img.shields.io/github/workflow/status/apache/shardingsphere-elasticjob/Java%20CI%20with%20Maven%20on%20macOS/master)](https://github.com/apache/shardingsphere-elasticjob/actions?query=workflow%3A%22Java+CI+with+Maven+on+macOS%22) +[![Build Status](https://api.travis-ci.com/apache/shardingsphere-elasticjob.svg?branch=master)](https://travis-ci.org/apache/shardingsphere-elasticjob) +[![GitHub Workflow](https://img.shields.io/github/actions/workflow/status/apache/shardingsphere-elasticjob/maven.yml?branch=master)](https://github.com/apache/shardingsphere-elasticjob/actions/workflows/maven.yml?query=branch%3Amaster) [![codecov](https://codecov.io/gh/apache/shardingsphere-elasticjob/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/shardingsphere-elasticjob) [![Maintainability](https://cloud.quality-gate.com/dashboard/api/badge?projectName=apache_shardingsphere-elasticjob&branchName=master)](https://cloud.quality-gate.com/dashboard/branches/396041#overview) From b781c7620097bef62cdb4c7b181c881228200b22 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 24 Oct 2023 07:53:28 +0800 Subject: [PATCH 075/178] Reuse ShardingSphereServiceLoader to instead of ElasticJobServiceLoader (#2308) * Remove JobErrorHandlerFactory * Remove JobErrorHandlerFactory * Remove JobErrorHandlerFactory * Remove JobErrorHandlerFactory * Remove JobErrorHandlerFactory * Refactor SPI for Reloadable * Refactor SPI for Reloadable * Refactor SPI for TypedJobItemExecutor * Refactor SPI for JobErrorHandlerPropertiesValidator * Refactor SPI for ElasticJobListener * Refactor SPI for JobShardingStrategy * Refactor SPI for JobExecutorServiceHandler * Refactor SPI for JobExecutorServiceHandler * Remove ElasticJobServiceLoader * Remove ElasticJobServiceLoader * Fix checkstyle * Fix spotless --- .../error/handler/JobErrorHandler.java | 8 +- .../JobErrorHandlerPropertiesValidator.java | 15 ++- ...obErrorHandlerPropertiesValidatorTest.java | 27 ++---- .../dingtalk/DingtalkJobErrorHandlerTest.java | 6 +- ...obErrorHandlerPropertiesValidatorTest.java | 27 ++---- .../email/EmailJobErrorHandlerTest.java | 6 +- .../error/handler/JobErrorHandlerFactory.java | 53 ---------- .../handler/JobErrorHandlerReloadable.java | 27 ++---- .../general/IgnoreJobErrorHandler.java | 6 -- .../handler/general/LogJobErrorHandler.java | 11 +-- .../handler/general/ThrowJobErrorHandler.java | 6 -- .../handler/JobErrorHandlerFactoryTest.java | 47 --------- .../JobErrorHandlerReloadableTest.java | 70 ++++++------- .../general/IgnoreJobErrorHandlerTest.java | 7 +- .../general/LogJobErrorHandlerTest.java | 6 +- .../general/ThrowJobErrorHandlerTest.java | 7 +- ...obErrorHandlerPropertiesValidatorTest.java | 27 ++---- .../wechat/WechatJobErrorHandlerTest.java | 6 +- .../executor/ElasticJobExecutor.java | 4 +- .../executor/context/ExecutorContext.java | 33 ++----- .../executor/item/JobItemExecutorFactory.java | 16 +-- .../item/impl/TypedJobItemExecutor.java | 4 +- .../item/JobItemExecutorFactoryTest.java | 11 --- infra/pom.xml | 5 + .../concurrent/ExecutorServiceReloadable.java | 32 +++--- .../elasticjob/infra/context/Reloadable.java | 18 +++- .../context/ReloadablePostProcessor.java | 33 ------- .../handler/sharding/JobShardingStrategy.java | 2 +- .../sharding/JobShardingStrategyFactory.java | 51 ---------- .../AverageAllocationJobShardingStrategy.java | 7 +- .../threadpool/JobExecutorServiceHandler.java | 4 +- .../JobExecutorServiceHandlerFactory.java | 51 ---------- .../CPUUsageJobExecutorServiceHandler.java | 5 + .../infra/listener/ElasticJobListener.java | 2 +- .../listener/ElasticJobListenerFactory.java | 9 +- .../infra/spi/ElasticJobServiceLoader.java | 97 ------------------- .../infra/spi/SPIPostProcessor.java | 33 ------- .../elasticjob/infra/spi/TypedSPI.java | 31 ------ .../ServiceLoaderInstantiationException.java | 30 ------ .../validator/JobPropertiesValidator.java | 35 ------- .../ExecutorServiceReloadableTest.java | 45 +++++---- .../JobShardingStrategyFactoryTest.java | 45 --------- .../JobExecutorServiceHandlerFactoryTest.java | 45 --------- ...CPUUsageJobExecutorServiceHandlerTest.java | 7 +- ...leThreadJobExecutorServiceHandlerTest.java | 7 +- .../ElasticJobListenerFactoryTest.java | 39 -------- .../fixture/FooElasticJobListener.java | 37 ------- .../spi/ElasticJobServiceLoaderTest.java | 71 -------------- .../infra/spi/fixture/TypedFooService.java | 23 ----- .../fixture/UnRegisteredTypedFooService.java | 23 ----- .../spi/fixture/impl/TypedFooServiceImpl.java | 28 ------ .../impl/UnRegisteredTypedFooServiceImpl.java | 28 ------ ...asticjob.infra.spi.fixture.TypedFooService | 18 ---- ...ra.spi.fixture.UnRegisteredTypedFooService | 18 ---- .../internal/schedule/JobScheduler.java | 13 +-- .../internal/sharding/ShardingService.java | 4 +- pom.xml | 6 ++ .../job/parser/JobBeanDefinitionParser.java | 15 ++- 58 files changed, 223 insertions(+), 1124 deletions(-) delete mode 100644 ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java delete mode 100644 ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java delete mode 100644 infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService delete mode 100644 infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService diff --git a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java b/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java index 1b9f67fb3b..868621306a 100644 --- a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java +++ b/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java @@ -17,15 +17,14 @@ package org.apache.shardingsphere.elasticjob.error.handler; -import org.apache.shardingsphere.elasticjob.infra.spi.SPIPostProcessor; -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import java.io.Closeable; /** * Job error handler. */ -public interface JobErrorHandler extends TypedSPI, SPIPostProcessor, Closeable { +public interface JobErrorHandler extends TypedSPI, Closeable { /** * Handle exception. @@ -35,6 +34,9 @@ public interface JobErrorHandler extends TypedSPI, SPIPostProcessor, Closeable { */ void handleException(String jobName, Throwable cause); + @Override + String getType(); + @Override default void close() { } diff --git a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java index bcc26b2667..d668554e07 100644 --- a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java @@ -17,10 +17,21 @@ package org.apache.shardingsphere.elasticjob.error.handler; -import org.apache.shardingsphere.elasticjob.infra.validator.JobPropertiesValidator; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; + +import java.util.Properties; /** * Job error handler properties validator. */ -public interface JobErrorHandlerPropertiesValidator extends JobPropertiesValidator { +@SingletonSPI +public interface JobErrorHandlerPropertiesValidator extends TypedSPI { + + /** + * Validate job properties. + * + * @param props job properties + */ + void validate(Properties props); } diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index 7cac93132b..4ee20ef25d 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -18,8 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.junit.jupiter.api.BeforeEach; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import java.util.Properties; @@ -30,40 +29,26 @@ class DingtalkJobErrorHandlerPropertiesValidatorTest { - @BeforeEach - void startup() { - ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); - } - @Test void assertValidateWithNormal() { Properties properties = new Properties(); properties.setProperty(DingtalkPropertiesConstants.WEBHOOK, "webhook"); properties.setProperty(DingtalkPropertiesConstants.READ_TIMEOUT_MILLISECONDS, "1000"); properties.setProperty(DingtalkPropertiesConstants.CONNECT_TIMEOUT_MILLISECONDS, "2000"); - DingtalkJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(properties); + TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "DINGTALK").validate(properties); } @Test void assertValidateWithPropsIsNull() { - assertThrows(NullPointerException.class, () -> { - DingtalkJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(null); - }); + assertThrows(NullPointerException.class, () -> TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "DINGTALK").validate(null)); } @Test void assertValidateWithWebhookIsNull() { - DingtalkJobErrorHandlerPropertiesValidator actual = getValidator(); try { - actual.validate(new Properties()); - } catch (NullPointerException e) { - assertThat(e.getMessage(), is(String.format("The property `%s` is required.", DingtalkPropertiesConstants.WEBHOOK))); + TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "DINGTALK").validate(new Properties()); + } catch (final NullPointerException ex) { + assertThat(ex.getMessage(), is(String.format("The property `%s` is required.", DingtalkPropertiesConstants.WEBHOOK))); } } - - private DingtalkJobErrorHandlerPropertiesValidator getValidator() { - return (DingtalkJobErrorHandlerPropertiesValidator) ElasticJobServiceLoader.newTypedServiceInstance(JobErrorHandlerPropertiesValidator.class, "DINGTALK", null).get(); - } } diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index cf971e3a7a..c8d9aa7445 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -20,12 +20,12 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.error.handler.dingtalk.fixture.DingtalkInternalController; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -124,7 +124,7 @@ void assertHandleExceptionWithNoSign() { } private DingtalkJobErrorHandler getDingtalkJobErrorHandler(final Properties props) { - return (DingtalkJobErrorHandler) JobErrorHandlerFactory.createHandler("DINGTALK", props).orElseThrow(() -> new JobConfigurationException("DINGTALK error handler not found.")); + return (DingtalkJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "DINGTALK", props); } private Properties createConfigurationProperties(final String webhook) { diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index 8fd94190f5..b4d614b9dc 100644 --- a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -18,8 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.junit.jupiter.api.BeforeEach; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import java.util.Properties; @@ -30,11 +29,6 @@ class EmailJobErrorHandlerPropertiesValidatorTest { - @BeforeEach - void startup() { - ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); - } - @Test void assertValidateWithNormal() { Properties properties = new Properties(); @@ -45,29 +39,20 @@ void assertValidateWithNormal() { properties.setProperty(EmailPropertiesConstants.PASSWORD, "password"); properties.setProperty(EmailPropertiesConstants.FROM, "from@xxx.xx"); properties.setProperty(EmailPropertiesConstants.TO, "to@xxx.xx"); - EmailJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(properties); + TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "EMAIL").validate(properties); } @Test void assertValidateWithPropsIsNull() { - assertThrows(NullPointerException.class, () -> { - EmailJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(null); - }); + assertThrows(NullPointerException.class, () -> TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "EMAIL").validate(null)); } @Test void assertValidateWithHostIsNull() { - EmailJobErrorHandlerPropertiesValidator actual = getValidator(); try { - actual.validate(new Properties()); - } catch (NullPointerException e) { - assertThat(e.getMessage(), is(String.format("The property `%s` is required.", EmailPropertiesConstants.HOST))); + TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "EMAIL").validate(new Properties()); + } catch (final NullPointerException ex) { + assertThat(ex.getMessage(), is(String.format("The property `%s` is required.", EmailPropertiesConstants.HOST))); } } - - private EmailJobErrorHandlerPropertiesValidator getValidator() { - return (EmailJobErrorHandlerPropertiesValidator) ElasticJobServiceLoader.newTypedServiceInstance(JobErrorHandlerPropertiesValidator.class, "EMAIL", null).get(); - } } diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index 169f022872..78a1cf3597 100644 --- a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -21,8 +21,8 @@ import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -97,7 +97,7 @@ void assertHandleExceptionSucceedInSendingEmail() { } private EmailJobErrorHandler getEmailJobErrorHandler(final Properties props) { - return (EmailJobErrorHandler) JobErrorHandlerFactory.createHandler("EMAIL", props).orElseThrow(() -> new JobConfigurationException("EMAIL error handler not found.")); + return (EmailJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "EMAIL", props); } private void setUpMockSession(final Session session) { diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java deleted file mode 100644 index 5e77909bc5..0000000000 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.elasticjob.error.handler; - -import com.google.common.base.Strings; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; - -import java.util.Optional; -import java.util.Properties; - -/** - * Job error handler factory. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class JobErrorHandlerFactory { - - public static final String DEFAULT_HANDLER = "LOG"; - - static { - ElasticJobServiceLoader.registerTypedService(JobErrorHandler.class); - } - - /** - * Get job error handler. - * - * @param type job error handler type - * @param props job properties - * @return job error handler - */ - public static Optional createHandler(final String type, final Properties props) { - if (Strings.isNullOrEmpty(type)) { - return ElasticJobServiceLoader.newTypedServiceInstance(JobErrorHandler.class, DEFAULT_HANDLER, props); - } - return ElasticJobServiceLoader.newTypedServiceInstance(JobErrorHandler.class, type, props); - } -} diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java index 1256561037..f81bfc91b4 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java +++ b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java @@ -17,12 +17,10 @@ package org.apache.shardingsphere.elasticjob.error.handler; -import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; -import org.apache.shardingsphere.elasticjob.infra.context.ReloadablePostProcessor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Optional; import java.util.Properties; @@ -31,9 +29,7 @@ * JobErrorHandler reloadable. */ @Slf4j -public final class JobErrorHandlerReloadable implements Reloadable, ReloadablePostProcessor { - - private String jobErrorHandlerType; +public final class JobErrorHandlerReloadable implements Reloadable { private Properties props; @@ -41,28 +37,23 @@ public final class JobErrorHandlerReloadable implements Reloadable new JobConfigurationException("Cannot find job error handler type '%s'.", jobErrorHandlerType)); + jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobConfig.getJobErrorHandlerType(), props); } @Override public synchronized void reloadIfNecessary(final JobConfiguration jobConfig) { - String newJobErrorHandlerType = Strings.isNullOrEmpty(jobConfig.getJobErrorHandlerType()) ? JobErrorHandlerFactory.DEFAULT_HANDLER : jobConfig.getJobErrorHandlerType(); - if (newJobErrorHandlerType.equals(jobErrorHandlerType) && props.equals(jobConfig.getProps())) { + if (jobErrorHandler.getType().equals(jobConfig.getJobErrorHandlerType()) && props.equals(jobConfig.getProps())) { return; } - log.debug("JobErrorHandler reload occurred in the job '{}'. Change from '{}' to '{}'.", jobConfig.getJobName(), jobErrorHandlerType, newJobErrorHandlerType); - reload(newJobErrorHandlerType, jobConfig.getProps()); + log.debug("JobErrorHandler reload occurred in the job '{}'. Change from '{}' to '{}'.", jobConfig.getJobName(), jobErrorHandler.getType(), jobConfig.getJobErrorHandlerType()); + reload(jobConfig.getJobErrorHandlerType(), jobConfig.getProps()); } private void reload(final String jobErrorHandlerType, final Properties props) { jobErrorHandler.close(); - this.jobErrorHandlerType = jobErrorHandlerType; this.props = (Properties) props.clone(); - jobErrorHandler = JobErrorHandlerFactory.createHandler(jobErrorHandlerType, props) - .orElseThrow(() -> new JobConfigurationException("Cannot find job error handler type '%s'.", jobErrorHandlerType)); + jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobErrorHandlerType, props); } @Override @@ -71,8 +62,8 @@ public JobErrorHandler getInstance() { } @Override - public String getType() { - return JobErrorHandler.class.getName(); + public Class getType() { + return JobErrorHandler.class; } @Override diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java index 5eaab152de..5a7978e21c 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java +++ b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java @@ -19,17 +19,11 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; -import java.util.Properties; - /** * Job error handler for ignore exception. */ public final class IgnoreJobErrorHandler implements JobErrorHandler { - @Override - public void init(final Properties props) { - } - @Override public void handleException(final String jobName, final Throwable cause) { } diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java index 2d98f0f454..75723b7103 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java +++ b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java @@ -20,18 +20,12 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; -import java.util.Properties; - /** * Job error handler for log error message. */ @Slf4j public final class LogJobErrorHandler implements JobErrorHandler { - @Override - public void init(final Properties props) { - } - @Override public void handleException(final String jobName, final Throwable cause) { log.error(String.format("Job '%s' exception occur in job processing", jobName), cause); @@ -41,4 +35,9 @@ public void handleException(final String jobName, final Throwable cause) { public String getType() { return "LOG"; } + + @Override + public boolean isDefault() { + return true; + } } diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java index ffa3299405..8883e8e5f5 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java +++ b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java @@ -20,17 +20,11 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import java.util.Properties; - /** * Job error handler for throw exception. */ public final class ThrowJobErrorHandler implements JobErrorHandler { - @Override - public void init(final Properties props) { - } - @Override public void handleException(final String jobName, final Throwable cause) { throw new JobSystemException(cause); diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java deleted file mode 100644 index d715f9dc94..0000000000 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerFactoryTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.elasticjob.error.handler; - -import org.apache.shardingsphere.elasticjob.error.handler.general.LogJobErrorHandler; -import org.apache.shardingsphere.elasticjob.error.handler.general.ThrowJobErrorHandler; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.junit.jupiter.api.Test; - -import java.util.Properties; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - -class JobErrorHandlerFactoryTest { - - @Test - void assertGetDefaultHandler() { - assertThat(JobErrorHandlerFactory.createHandler("", new Properties()).orElse(null), instanceOf(LogJobErrorHandler.class)); - } - - @Test - void assertGetInvalidHandler() { - assertThrows(JobConfigurationException.class, () -> JobErrorHandlerFactory.createHandler("INVALID", new Properties()).orElseThrow(() -> new JobConfigurationException(""))); - } - - @Test - void assertGetHandler() { - assertThat(JobErrorHandlerFactory.createHandler("THROW", new Properties()).orElse(null), instanceOf(ThrowJobErrorHandler.class)); - } -} diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java index c574986ba3..61973a9493 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java +++ b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java @@ -29,66 +29,68 @@ import java.lang.reflect.Field; import java.util.Properties; -import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class JobErrorHandlerReloadableTest { @Mock - private JobErrorHandler mockJobErrorHandler; + private JobErrorHandler jobErrorHandler; @Test void assertInitialize() { - JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); - String jobErrorHandlerType = "IGNORE"; - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(jobErrorHandlerType).build(); - assertNull(jobErrorHandlerReloadable.getInstance()); - jobErrorHandlerReloadable.init(jobConfig); - JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); - assertNotNull(actual); - assertThat(actual.getType(), equalTo(jobErrorHandlerType)); - assertTrue(actual instanceof IgnoreJobErrorHandler); + try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + assertNull(jobErrorHandlerReloadable.getInstance()); + jobErrorHandlerReloadable.init(jobConfig); + JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); + assertNotNull(actual); + assertThat(actual.getType(), is("IGNORE")); + assertTrue(actual instanceof IgnoreJobErrorHandler); + } } @Test void assertReload() { - JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); - setField(jobErrorHandlerReloadable, "jobErrorHandler", mockJobErrorHandler); - setField(jobErrorHandlerReloadable, "jobErrorHandlerType", "mock"); - setField(jobErrorHandlerReloadable, "props", new Properties()); - String newJobErrorHandlerType = "LOG"; - JobConfiguration newJobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(newJobErrorHandlerType).build(); - jobErrorHandlerReloadable.reloadIfNecessary(newJobConfig); - verify(mockJobErrorHandler).close(); - JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); - assertThat(actual.getType(), equalTo(newJobErrorHandlerType)); - assertTrue(actual instanceof LogJobErrorHandler); + try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { + when(jobErrorHandler.getType()).thenReturn("mock"); + setField(jobErrorHandlerReloadable, "jobErrorHandler", jobErrorHandler); + setField(jobErrorHandlerReloadable, "props", new Properties()); + String newJobErrorHandlerType = "LOG"; + JobConfiguration newJobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(newJobErrorHandlerType).build(); + jobErrorHandlerReloadable.reloadIfNecessary(newJobConfig); + verify(jobErrorHandler).close(); + JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); + assertThat(actual.getType(), is(newJobErrorHandlerType)); + assertTrue(actual instanceof LogJobErrorHandler); + } } @Test void assertUnnecessaryToReload() { - JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); - String jobErrorHandlerType = "IGNORE"; - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(jobErrorHandlerType).build(); - jobErrorHandlerReloadable.init(jobConfig); - JobErrorHandler expected = jobErrorHandlerReloadable.getInstance(); - jobErrorHandlerReloadable.reloadIfNecessary(jobConfig); - JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); - assertThat(actual, is(expected)); + try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + jobErrorHandlerReloadable.init(jobConfig); + JobErrorHandler expected = jobErrorHandlerReloadable.getInstance(); + jobErrorHandlerReloadable.reloadIfNecessary(jobConfig); + JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); + assertThat(actual, is(expected)); + } } @Test void assertShutdown() { - JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable(); - setField(jobErrorHandlerReloadable, "jobErrorHandler", mockJobErrorHandler); - jobErrorHandlerReloadable.close(); - verify(mockJobErrorHandler).close(); + try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { + setField(jobErrorHandlerReloadable, "jobErrorHandler", jobErrorHandler); + jobErrorHandlerReloadable.close(); + verify(jobErrorHandler).close(); + } } @SneakyThrows diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java index fb92dbbe22..7bb3f14d98 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.error.handler.general; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import java.util.Properties; @@ -27,7 +27,6 @@ class IgnoreJobErrorHandlerTest { @Test void assertHandleException() { - JobErrorHandlerFactory.createHandler("IGNORE", new Properties()) - .orElseThrow(() -> new JobConfigurationException("IGNORE error handler not found.")).handleException("test_job", new RuntimeException("test")); + TypedSPILoader.getService(JobErrorHandler.class, "IGNORE", new Properties()).handleException("test_job", new RuntimeException("test")); } } diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java index f5bf335124..64bd48d023 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java @@ -20,8 +20,8 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -52,7 +52,7 @@ void setUp() { @Test void assertHandleException() { - LogJobErrorHandler actual = (LogJobErrorHandler) JobErrorHandlerFactory.createHandler("LOG", new Properties()).orElseThrow(() -> new JobConfigurationException("LOG error handler not found.")); + LogJobErrorHandler actual = (LogJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "LOG", new Properties()); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java index c9bfaa7d47..8b8da22380 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.error.handler.general; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import java.util.Properties; @@ -30,7 +30,6 @@ class ThrowJobErrorHandlerTest { @Test void assertHandleException() { - assertThrows(JobSystemException.class, () -> JobErrorHandlerFactory.createHandler("THROW", new Properties()) - .orElseThrow(() -> new JobConfigurationException("THROW error handler not found.")).handleException("test_job", new RuntimeException("test"))); + assertThrows(JobSystemException.class, () -> TypedSPILoader.getService(JobErrorHandler.class, "THROW", new Properties()).handleException("test_job", new RuntimeException("test"))); } } diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index 590ede1cbe..05882b65de 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -18,8 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; -import org.junit.jupiter.api.BeforeEach; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import java.util.Properties; @@ -30,40 +29,26 @@ class WechatJobErrorHandlerPropertiesValidatorTest { - @BeforeEach - void startup() { - ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); - } - @Test void assertValidateWithNormal() { Properties properties = new Properties(); properties.setProperty(WechatPropertiesConstants.WEBHOOK, "webhook"); properties.setProperty(WechatPropertiesConstants.READ_TIMEOUT_MILLISECONDS, "1000"); properties.setProperty(WechatPropertiesConstants.CONNECT_TIMEOUT_MILLISECONDS, "2000"); - WechatJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(properties); + TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "WECHAT").validate(properties); } @Test void assertValidateWithPropsIsNull() { - assertThrows(NullPointerException.class, () -> { - WechatJobErrorHandlerPropertiesValidator actual = getValidator(); - actual.validate(null); - }); + assertThrows(NullPointerException.class, () -> TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "WECHAT").validate(null)); } @Test void assertValidateWithWebhookIsNull() { - WechatJobErrorHandlerPropertiesValidator actual = getValidator(); try { - actual.validate(new Properties()); - } catch (NullPointerException e) { - assertThat(e.getMessage(), is(String.format("The property `%s` is required.", WechatPropertiesConstants.WEBHOOK))); + TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "WECHAT").validate(new Properties()); + } catch (final NullPointerException ex) { + assertThat(ex.getMessage(), is(String.format("The property `%s` is required.", WechatPropertiesConstants.WEBHOOK))); } } - - private WechatJobErrorHandlerPropertiesValidator getValidator() { - return (WechatJobErrorHandlerPropertiesValidator) ElasticJobServiceLoader.newTypedServiceInstance(JobErrorHandlerPropertiesValidator.class, "WECHAT", null).get(); - } } diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index b477210d45..72226574a3 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -20,12 +20,12 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerFactory; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture.WechatInternalController; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -114,7 +114,7 @@ void assertHandleExceptionWithUrlIsNotFound() { } private WechatJobErrorHandler getWechatJobErrorHandler(final Properties props) { - return (WechatJobErrorHandler) JobErrorHandlerFactory.createHandler("WECHAT", props).orElseThrow(() -> new JobConfigurationException("WECHAT error handler not found.")); + return (WechatJobErrorHandler) TypedSPILoader.getService(JobErrorHandler.class, "WECHAT", props); } private Properties createConfigurationProperties(final String webhook) { diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java index b43cc29764..5c3e7dbb5f 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java @@ -24,6 +24,7 @@ import org.apache.shardingsphere.elasticjob.executor.context.ExecutorContext; import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor; import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutorFactory; +import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; @@ -31,6 +32,7 @@ import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent.ExecutionSource; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Collection; import java.util.Map; @@ -59,7 +61,7 @@ public ElasticJobExecutor(final ElasticJob elasticJob, final JobConfiguration jo } public ElasticJobExecutor(final String type, final JobConfiguration jobConfig, final JobFacade jobFacade) { - this(null, jobConfig, jobFacade, JobItemExecutorFactory.getExecutor(type)); + this(null, jobConfig, jobFacade, TypedSPILoader.getService(TypedJobItemExecutor.class, type)); } private ElasticJobExecutor(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final JobItemExecutor jobItemExecutor) { diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java index 38786c619c..2e5c1ba04e 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java @@ -19,14 +19,11 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; -import org.apache.shardingsphere.elasticjob.infra.context.ReloadablePostProcessor; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; import java.util.Properties; -import java.util.ServiceLoader; /** * Executor context. @@ -36,22 +33,10 @@ */ public final class ExecutorContext { - static { - ElasticJobServiceLoader.registerTypedService(Reloadable.class); - } - - private final Map> reloadableItems = new LinkedHashMap<>(); - public ExecutorContext(final JobConfiguration jobConfig) { - ServiceLoader.load(Reloadable.class).forEach(each -> { - ElasticJobServiceLoader.newTypedServiceInstance(Reloadable.class, each.getType(), new Properties()) - .ifPresent(reloadable -> reloadableItems.put(reloadable.getType(), reloadable)); - }); - initReloadable(jobConfig); - } - - private void initReloadable(final JobConfiguration jobConfig) { - reloadableItems.values().stream().filter(each -> each instanceof ReloadablePostProcessor).forEach(each -> ((ReloadablePostProcessor) each).init(jobConfig)); + for (Reloadable each : ShardingSphereServiceLoader.getServiceInstances(Reloadable.class)) { + each.init(jobConfig); + } } /** @@ -60,26 +45,26 @@ private void initReloadable(final JobConfiguration jobConfig) { * @param jobConfiguration job configuration */ public void reloadIfNecessary(final JobConfiguration jobConfiguration) { - reloadableItems.values().forEach(each -> each.reloadIfNecessary(jobConfiguration)); + ShardingSphereServiceLoader.getServiceInstances(Reloadable.class).forEach(each -> each.reloadIfNecessary(jobConfiguration)); } /** * Get instance. * * @param targetClass target class - * @param target type + * @param target type * @return instance */ @SuppressWarnings("unchecked") public T get(final Class targetClass) { - return (T) reloadableItems.get(targetClass.getName()).getInstance(); + return (T) TypedSPILoader.getService(Reloadable.class, targetClass, new Properties()).getInstance(); } /** * Shutdown all closeable instances. */ public void shutdown() { - for (Reloadable each : reloadableItems.values()) { + for (Reloadable each : ShardingSphereServiceLoader.getServiceInstances(Reloadable.class)) { try { each.close(); } catch (final IOException ignored) { diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java index 4d4ed138ff..9bf125e441 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java @@ -20,10 +20,8 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; +import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import java.util.HashMap; import java.util.Map; @@ -40,7 +38,6 @@ public final class JobItemExecutorFactory { private static final Map CLASSED_EXECUTORS = new HashMap<>(); static { - ElasticJobServiceLoader.registerTypedService(TypedJobItemExecutor.class); ServiceLoader.load(ClassedJobItemExecutor.class).forEach(each -> CLASSED_EXECUTORS.put(each.getElasticJobClass(), each)); } @@ -59,15 +56,4 @@ public static JobItemExecutor getExecutor(final Class elas } throw new JobConfigurationException("Can not find executor for elastic job class `%s`", elasticJobClass.getName()); } - - /** - * Get executor. - * - * @param elasticJobType elastic job type - * @return job item executor - */ - public static JobItemExecutor getExecutor(final String elasticJobType) { - return ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedJobItemExecutor.class, elasticJobType) - .orElseThrow(() -> new JobConfigurationException("Cannot find executor for elastic job type `%s`", elasticJobType)); - } } diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java index fba87a4d6a..32091f40a0 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java @@ -19,10 +19,12 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor; -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** * Typed job item executor. */ +@SingletonSPI public interface TypedJobItemExecutor extends JobItemExecutor, TypedSPI { } diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java index bd6b3dd158..0695a8bd24 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java +++ b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.executor.item; import org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor; -import org.apache.shardingsphere.elasticjob.executor.fixture.executor.TypedFooJobExecutor; import org.apache.shardingsphere.elasticjob.executor.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.executor.fixture.job.FailedJob; import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob; @@ -45,14 +44,4 @@ void assertGetExecutorByClassSuccessWithCurrentClass() { void assertGetExecutorByClassSuccessWithSubClass() { assertThat(JobItemExecutorFactory.getExecutor(DetailedFooJob.class), instanceOf(ClassedFooJobExecutor.class)); } - - @Test - void assertGetExecutorByTypeFailureWithInvalidType() { - assertThrows(JobConfigurationException.class, () -> JobItemExecutorFactory.getExecutor("FAIL")); - } - - @Test - void assertGetExecutorByTypeSuccess() { - assertThat(JobItemExecutorFactory.getExecutor("FOO"), instanceOf(TypedFooJobExecutor.class)); - } } diff --git a/infra/pom.xml b/infra/pom.xml index b2cc16cb07..3e57c5d383 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -33,6 +33,11 @@ ${project.parent.version} + + org.apache.shardingsphere + shardingsphere-infra-spi + + org.apache.commons commons-lang3 diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java index 31de960583..f504f96627 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java @@ -17,12 +17,11 @@ package org.apache.shardingsphere.elasticjob.infra.concurrent; -import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; -import org.apache.shardingsphere.elasticjob.infra.context.ReloadablePostProcessor; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandlerFactory; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Optional; import java.util.concurrent.ExecutorService; @@ -31,36 +30,31 @@ * Executor service reloadable. */ @Slf4j -public final class ExecutorServiceReloadable implements Reloadable, ReloadablePostProcessor { +public final class ExecutorServiceReloadable implements Reloadable { - private String jobExecutorServiceHandlerType; + private JobExecutorServiceHandler jobExecutorServiceHandler; private ExecutorService executorService; @Override public void init(final JobConfiguration jobConfig) { - jobExecutorServiceHandlerType = Strings.isNullOrEmpty(jobConfig.getJobExecutorServiceHandlerType()) - ? JobExecutorServiceHandlerFactory.DEFAULT_HANDLER - : jobConfig.getJobExecutorServiceHandlerType(); - executorService = JobExecutorServiceHandlerFactory.getHandler(jobExecutorServiceHandlerType).createExecutorService(jobConfig.getJobName()); + jobExecutorServiceHandler = TypedSPILoader.getService(JobExecutorServiceHandler.class, jobConfig.getJobExecutorServiceHandlerType()); + executorService = jobExecutorServiceHandler.createExecutorService(jobConfig.getJobName()); } @Override public synchronized void reloadIfNecessary(final JobConfiguration jobConfig) { - String newJobExecutorServiceHandlerType = Strings.isNullOrEmpty(jobConfig.getJobExecutorServiceHandlerType()) - ? JobExecutorServiceHandlerFactory.DEFAULT_HANDLER - : jobConfig.getJobExecutorServiceHandlerType(); - if (newJobExecutorServiceHandlerType.equals(jobExecutorServiceHandlerType)) { + if (jobExecutorServiceHandler.getType().equals(jobConfig.getJobExecutorServiceHandlerType())) { return; } - log.debug("JobExecutorServiceHandler reload occurred in the job '{}'. Change from '{}' to '{}'.", jobConfig.getJobName(), jobExecutorServiceHandlerType, newJobExecutorServiceHandlerType); - reload(newJobExecutorServiceHandlerType, jobConfig.getJobName()); + log.debug("JobExecutorServiceHandler reload occurred in the job '{}'. Change from '{}' to '{}'.", + jobConfig.getJobName(), jobExecutorServiceHandler.getType(), jobConfig.getJobExecutorServiceHandlerType()); + reload(jobConfig.getJobExecutorServiceHandlerType(), jobConfig.getJobName()); } private void reload(final String jobExecutorServiceHandlerType, final String jobName) { executorService.shutdown(); - this.jobExecutorServiceHandlerType = jobExecutorServiceHandlerType; - executorService = JobExecutorServiceHandlerFactory.getHandler(jobExecutorServiceHandlerType).createExecutorService(jobName); + executorService = TypedSPILoader.getService(JobExecutorServiceHandler.class, jobExecutorServiceHandlerType).createExecutorService(jobName); } @Override @@ -74,7 +68,7 @@ public void close() { } @Override - public String getType() { - return ExecutorService.class.getName(); + public Class getType() { + return ExecutorService.class; } } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java index 22e9015006..f0a5d52188 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java @@ -18,7 +18,8 @@ package org.apache.shardingsphere.elasticjob.infra.context; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import java.io.Closeable; @@ -27,14 +28,22 @@ * * @param reload target */ +@SingletonSPI public interface Reloadable extends TypedSPI, Closeable { + /** + * Initialize reloadable. + * + * @param jobConfig job configuration + */ + void init(JobConfiguration jobConfig); + /** * Reload if necessary. * - * @param jobConfiguration job configuration + * @param jobConfig job configuration */ - void reloadIfNecessary(JobConfiguration jobConfiguration); + void reloadIfNecessary(JobConfiguration jobConfig); /** * Get target instance. @@ -42,4 +51,7 @@ public interface Reloadable extends TypedSPI, Closeable { * @return instance */ T getInstance(); + + @Override + Class getType(); } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java deleted file mode 100644 index 8dc86d20c3..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ReloadablePostProcessor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.elasticjob.infra.context; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; - -/** - * Reloadable post processor. - */ -public interface ReloadablePostProcessor { - - /** - * Initialize reloadable. - * - * @param jobConfig job configuration - */ - void init(JobConfiguration jobConfig); -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java index 70e4b704a6..d230c09a11 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.handler.sharding; -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import java.util.List; import java.util.Map; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java deleted file mode 100644 index 628e0f43e0..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.elasticjob.infra.handler.sharding; - -import com.google.common.base.Strings; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; - -/** - * Job sharding strategy factory. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class JobShardingStrategyFactory { - - private static final String DEFAULT_STRATEGY = "AVG_ALLOCATION"; - - static { - ElasticJobServiceLoader.registerTypedService(JobShardingStrategy.class); - } - - /** - * Get job sharding strategy. - * - * @param type job sharding strategy type - * @return job sharding strategy - */ - public static JobShardingStrategy getStrategy(final String type) { - if (Strings.isNullOrEmpty(type)) { - return ElasticJobServiceLoader.getCachedTypedServiceInstance(JobShardingStrategy.class, DEFAULT_STRATEGY).get(); - } - return ElasticJobServiceLoader.getCachedTypedServiceInstance(JobShardingStrategy.class, type) - .orElseThrow(() -> new JobConfigurationException("Cannot find sharding strategy using type '%s'.", type)); - } -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java index 3e2bcc2c2b..27c24fe856 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java @@ -32,9 +32,7 @@ *

* If the job server number and sharding count cannot be divided, * the redundant sharding item that cannot be divided will be added to the server with small sequence number in turn. - * * For example: - * * 1. If there are 3 job servers and the total sharding count is 9, each job server is divided into: 1=[0,1,2], 2=[3,4,5], 3=[6,7,8]; * 2. If there are 3 job servers and the total sharding count is 8, each job server is divided into: 1=[0,1,6], 2=[2,3,7], 3=[4,5]; * 3. If there are 3 job servers and the total sharding count is 10, each job server is divided into: 1=[0,1,2,9], 2=[3,4,5], 3=[6,7,8]. @@ -82,4 +80,9 @@ private void addAliquant(final List shardingUnits, final int shardi public String getType() { return "AVG_ALLOCATION"; } + + @Override + public boolean isDefault() { + return true; + } } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java index 39c1f642a5..4b26511fd7 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java @@ -17,13 +17,15 @@ package org.apache.shardingsphere.elasticjob.infra.handler.threadpool; -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import java.util.concurrent.ExecutorService; /** * Job executor service handler. */ +@SingletonSPI public interface JobExecutorServiceHandler extends TypedSPI { /** diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java deleted file mode 100644 index 839c7baffd..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.elasticjob.infra.handler.threadpool; - -import com.google.common.base.Strings; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; - -/** - * Job executor service handler factory. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class JobExecutorServiceHandlerFactory { - - public static final String DEFAULT_HANDLER = "CPU"; - - static { - ElasticJobServiceLoader.registerTypedService(JobExecutorServiceHandler.class); - } - - /** - * Get job executor service handler. - * - * @param type executor service handler type - * @return executor service handler - */ - public static JobExecutorServiceHandler getHandler(final String type) { - if (Strings.isNullOrEmpty(type)) { - return ElasticJobServiceLoader.getCachedTypedServiceInstance(JobExecutorServiceHandler.class, DEFAULT_HANDLER).get(); - } - return ElasticJobServiceLoader.getCachedTypedServiceInstance(JobExecutorServiceHandler.class, type) - .orElseThrow(() -> new JobConfigurationException("Cannot find executor service handler using type '%s'.", type)); - } -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java index 959f84505b..70d39ce645 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java @@ -31,4 +31,9 @@ protected int getPoolSize() { public String getType() { return "CPU"; } + + @Override + public boolean isDefault() { + return true; + } } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java index 4fc1b249d8..87eabd3f13 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.listener; -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** * ElasticJob listener. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java index b5aab2459a..a6fe70e0cb 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java @@ -19,10 +19,9 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Optional; -import java.util.Properties; /** * Job listener factory. @@ -30,10 +29,6 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class ElasticJobListenerFactory { - static { - ElasticJobServiceLoader.registerTypedService(ElasticJobListener.class); - } - /** * Create a job listener instance. * @@ -41,6 +36,6 @@ public final class ElasticJobListenerFactory { * @return optional job listener instance */ public static Optional createListener(final String type) { - return ElasticJobServiceLoader.newTypedServiceInstance(ElasticJobListener.class, type, new Properties()); + return TypedSPILoader.findService(ElasticJobListener.class, type); } } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java deleted file mode 100644 index 6ba4cfaf38..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoader.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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.elasticjob.infra.spi; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.spi.exception.ServiceLoaderInstantiationException; - -import java.lang.reflect.InvocationTargetException; -import java.util.Optional; -import java.util.Properties; -import java.util.ServiceLoader; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - -/** - * ElasticJob service loader. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ElasticJobServiceLoader { - - private static final ConcurrentMap, ConcurrentMap> TYPED_SERVICES = new ConcurrentHashMap<>(); - - private static final ConcurrentMap, ConcurrentMap>> TYPED_SERVICE_CLASSES = new ConcurrentHashMap<>(); - - /** - * Register typeSPI service. - * - * @param typedService typed service - * @param class of service - */ - public static void registerTypedService(final Class typedService) { - if (TYPED_SERVICES.containsKey(typedService)) { - return; - } - ServiceLoader.load(typedService).forEach(each -> registerTypedServiceClass(typedService, each)); - } - - private static void registerTypedServiceClass(final Class typedService, final TypedSPI instance) { - TYPED_SERVICES.computeIfAbsent(typedService, unused -> new ConcurrentHashMap<>()).putIfAbsent(instance.getType(), instance); - TYPED_SERVICE_CLASSES.computeIfAbsent(typedService, unused -> new ConcurrentHashMap<>()).putIfAbsent(instance.getType(), instance.getClass()); - } - - /** - * Get cached typed instance. - * - * @param typedServiceInterface typed service interface - * @param type type - * @param class of service - * @return cached typed service instance - */ - public static Optional getCachedTypedServiceInstance(final Class typedServiceInterface, final String type) { - return Optional.ofNullable(TYPED_SERVICES.get(typedServiceInterface)).map(services -> (T) services.get(type)); - } - - /** - * New typed instance. - * - * @param typedServiceInterface typed service interface - * @param type type - * @param props properties - * @param class of service - * @return new typed service instance - */ - public static Optional newTypedServiceInstance(final Class typedServiceInterface, final String type, final Properties props) { - Optional result = Optional.ofNullable(TYPED_SERVICE_CLASSES.get(typedServiceInterface)).map(serviceClasses -> serviceClasses.get(type)).map(clazz -> (T) newServiceInstance(clazz)); - if (result.isPresent() && result.get() instanceof SPIPostProcessor) { - ((SPIPostProcessor) result.get()).init(props); - } - return result; - } - - private static Object newServiceInstance(final Class clazz) { - try { - return clazz.getConstructor().newInstance(); - } catch (final InstantiationException | NoSuchMethodException | IllegalAccessException ex) { - throw new ServiceLoaderInstantiationException(clazz, ex); - } catch (final InvocationTargetException ex) { - throw new ServiceLoaderInstantiationException(clazz, ex.getCause()); - } - } -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java deleted file mode 100644 index 1c4d27e20b..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/SPIPostProcessor.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.elasticjob.infra.spi; - -import java.util.Properties; - -/** - * SPI post processor. - */ -public interface SPIPostProcessor { - - /** - * Initialize SPI instance. - * - * @param props properties - */ - void init(Properties props); -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java deleted file mode 100644 index e322e94d1c..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/TypedSPI.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.infra.spi; - -/** - * Type based SPI. - */ -public interface TypedSPI { - - /** - * Get type. - * - * @return type - */ - String getType(); -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java deleted file mode 100644 index 37ba5f0062..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/spi/exception/ServiceLoaderInstantiationException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.elasticjob.infra.spi.exception; - -/** - * Service loader instantiation exception. - */ -public final class ServiceLoaderInstantiationException extends RuntimeException { - - private static final long serialVersionUID = -2949903598320994076L; - - public ServiceLoaderInstantiationException(final Class clazz, final Throwable cause) { - super(String.format("Can not find public no args constructor for SPI class `%s`", clazz.getName()), cause); - } -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java deleted file mode 100644 index f3cbfd1ed3..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidator.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.elasticjob.infra.validator; - -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; - -import java.util.Properties; - -/** - * Job properties validator. - */ -public interface JobPropertiesValidator extends TypedSPI { - - /** - * Validate job properties. - * - * @param props job properties - */ - void validate(Properties props); -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java index c7856ef707..4c30370b81 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java @@ -19,6 +19,7 @@ import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; @@ -32,7 +33,9 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class ExecutorServiceReloadableTest { @@ -42,22 +45,25 @@ class ExecutorServiceReloadableTest { @Test void assertInitialize() { - ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); - String jobExecutorServiceHandlerType = "SINGLE_THREAD"; - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType).build(); - assertNull(executorServiceReloadable.getInstance()); - executorServiceReloadable.init(jobConfig); - ExecutorService actual = executorServiceReloadable.getInstance(); - assertNotNull(actual); - assertFalse(actual.isShutdown()); - assertFalse(actual.isTerminated()); - actual.shutdown(); + try (ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable()) { + String jobExecutorServiceHandlerType = "SINGLE_THREAD"; + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType).build(); + assertNull(executorServiceReloadable.getInstance()); + executorServiceReloadable.init(jobConfig); + ExecutorService actual = executorServiceReloadable.getInstance(); + assertNotNull(actual); + assertFalse(actual.isShutdown()); + assertFalse(actual.isTerminated()); + actual.shutdown(); + } } @Test void assertReload() { ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); - setField(executorServiceReloadable, "jobExecutorServiceHandlerType", "mock"); + JobExecutorServiceHandler jobExecutorServiceHandler = mock(JobExecutorServiceHandler.class); + when(jobExecutorServiceHandler.getType()).thenReturn("mock"); + setField(executorServiceReloadable, "jobExecutorServiceHandler", jobExecutorServiceHandler); setField(executorServiceReloadable, "executorService", mockExecutorService); JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).build(); executorServiceReloadable.reloadIfNecessary(jobConfig); @@ -70,14 +76,15 @@ void assertReload() { @Test void assertUnnecessaryToReload() { - ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).build(); - executorServiceReloadable.init(jobConfig); - ExecutorService expected = executorServiceReloadable.getInstance(); - executorServiceReloadable.reloadIfNecessary(jobConfig); - ExecutorService actual = executorServiceReloadable.getInstance(); - assertThat(actual, is(expected)); - actual.shutdown(); + try (ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable()) { + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorServiceHandlerType("CPU").build(); + executorServiceReloadable.init(jobConfig); + ExecutorService expected = executorServiceReloadable.getInstance(); + executorServiceReloadable.reloadIfNecessary(jobConfig); + ExecutorService actual = executorServiceReloadable.getInstance(); + assertThat(actual, is(expected)); + actual.shutdown(); + } } @Test diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java deleted file mode 100644 index 9db6376abc..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategyFactoryTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.elasticjob.infra.handler.sharding; - -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl.AverageAllocationJobShardingStrategy; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl.OdevitySortByNameJobShardingStrategy; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - -class JobShardingStrategyFactoryTest { - - @Test - void assertGetDefaultStrategy() { - assertThat(JobShardingStrategyFactory.getStrategy(null), instanceOf(AverageAllocationJobShardingStrategy.class)); - } - - @Test - void assertGetInvalidStrategy() { - assertThrows(JobConfigurationException.class, () -> JobShardingStrategyFactory.getStrategy("INVALID")); - } - - @Test - void assertGetStrategy() { - assertThat(JobShardingStrategyFactory.getStrategy("ODEVITY"), instanceOf(OdevitySortByNameJobShardingStrategy.class)); - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java deleted file mode 100644 index 25758af9ec..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.elasticjob.infra.handler.threadpool; - -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl.CPUUsageJobExecutorServiceHandler; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl.SingleThreadJobExecutorServiceHandler; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - -class JobExecutorServiceHandlerFactoryTest { - - @Test - void assertGetDefaultHandler() { - assertThat(JobExecutorServiceHandlerFactory.getHandler(""), instanceOf(CPUUsageJobExecutorServiceHandler.class)); - } - - @Test - void assertGetInvalidHandler() { - assertThrows(JobConfigurationException.class, () -> JobExecutorServiceHandlerFactory.getHandler("INVALID")); - } - - @Test - void assertGetHandler() { - assertThat(JobExecutorServiceHandlerFactory.getHandler("SINGLE_THREAD"), instanceOf(SingleThreadJobExecutorServiceHandler.class)); - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java index 6bea560a9f..ff9d776399 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java @@ -17,7 +17,8 @@ package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandlerFactory; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -27,8 +28,6 @@ class CPUUsageJobExecutorServiceHandlerTest { @Test void assertGetPoolSizeAndType() { - CPUUsageJobExecutorServiceHandler cpuUsageJobExecutorServiceHandler = (CPUUsageJobExecutorServiceHandler) JobExecutorServiceHandlerFactory.getHandler("CPU"); - assertThat(cpuUsageJobExecutorServiceHandler.getPoolSize(), is(Runtime.getRuntime().availableProcessors() * 2)); - assertThat(cpuUsageJobExecutorServiceHandler.getType(), is("CPU")); + assertThat(((CPUUsageJobExecutorServiceHandler) TypedSPILoader.getService(JobExecutorServiceHandler.class, "CPU")).getPoolSize(), is(Runtime.getRuntime().availableProcessors() * 2)); } } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java index d0dd4ff31e..45f754a151 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java @@ -17,7 +17,8 @@ package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandlerFactory; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -27,8 +28,6 @@ class SingleThreadJobExecutorServiceHandlerTest { @Test void assertGetPoolSizeAndType() { - SingleThreadJobExecutorServiceHandler singleThreadJobExecutorServiceHandler = (SingleThreadJobExecutorServiceHandler) JobExecutorServiceHandlerFactory.getHandler("SINGLE_THREAD"); - assertThat(singleThreadJobExecutorServiceHandler.getPoolSize(), is(1)); - assertThat(singleThreadJobExecutorServiceHandler.getType(), is("SINGLE_THREAD")); + assertThat(((SingleThreadJobExecutorServiceHandler) TypedSPILoader.getService(JobExecutorServiceHandler.class, "SINGLE_THREAD")).getPoolSize(), is(1)); } } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java deleted file mode 100644 index 669316cc8a..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactoryTest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.elasticjob.infra.listener; - -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.listener.fixture.FooElasticJobListener; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - -class ElasticJobListenerFactoryTest { - - @Test - void assertCreateInvalidJobListener() { - assertThrows(JobConfigurationException.class, () -> ElasticJobListenerFactory.createListener("INVALID").orElseThrow(() -> new JobConfigurationException("Invalid elastic job listener!"))); - } - - @Test - void assertCreatJobListener() { - assertThat(ElasticJobListenerFactory.createListener("fooElasticJobListener").orElse(null), instanceOf(FooElasticJobListener.class)); - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java deleted file mode 100644 index f53ce97d25..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/fixture/FooElasticJobListener.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.elasticjob.infra.listener.fixture; - -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; - -public final class FooElasticJobListener implements ElasticJobListener { - - @Override - public void beforeJobExecuted(final ShardingContexts shardingContexts) { - } - - @Override - public void afterJobExecuted(final ShardingContexts shardingContexts) { - } - - @Override - public String getType() { - return "fooElasticJobListener"; - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java deleted file mode 100644 index e21af0f174..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/ElasticJobServiceLoaderTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.elasticjob.infra.spi; - -import org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService; -import org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import java.util.Properties; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; - -class ElasticJobServiceLoaderTest { - - @BeforeAll - static void register() { - ElasticJobServiceLoader.registerTypedService(TypedFooService.class); - } - - @Test - void assertGetCacheTypedService() { - assertThat(ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "typedFooServiceImpl").orElse(null), instanceOf(TypedFooService.class)); - } - - @Test - void assertNewTypedServiceInstance() { - assertThat(ElasticJobServiceLoader.getCachedTypedServiceInstance(TypedFooService.class, "typedFooServiceImpl").orElse(null), instanceOf(TypedFooService.class)); - } - - @Test - void assertGetCacheTypedServiceFailureWithUnRegisteredServiceInterface() { - Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( - UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl").orElseThrow(IllegalArgumentException::new)); - } - - @Test - void assertGetCacheTypedServiceFailureWithInvalidType() { - Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.getCachedTypedServiceInstance( - TypedFooService.class, "INVALID").orElseThrow(IllegalArgumentException::new)); - } - - @Test - void assertNewTypedServiceInstanceFailureWithUnRegisteredServiceInterface() { - Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader - .newTypedServiceInstance(UnRegisteredTypedFooService.class, "unRegisteredTypedFooServiceImpl", new Properties()).orElseThrow(IllegalArgumentException::new)); - } - - @Test - void assertNewTypedServiceInstanceFailureWithInvalidType() { - Assertions.assertThrows(IllegalArgumentException.class, () -> ElasticJobServiceLoader.newTypedServiceInstance( - TypedFooService.class, "INVALID", new Properties()).orElseThrow(IllegalArgumentException::new)); - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java deleted file mode 100644 index 5ed5219bb1..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/TypedFooService.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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.elasticjob.infra.spi.fixture; - -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; - -public interface TypedFooService extends TypedSPI { -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java deleted file mode 100644 index 32891da473..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/UnRegisteredTypedFooService.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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.elasticjob.infra.spi.fixture; - -import org.apache.shardingsphere.elasticjob.infra.spi.TypedSPI; - -public interface UnRegisteredTypedFooService extends TypedSPI { -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java deleted file mode 100644 index 02fef28610..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/TypedFooServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.elasticjob.infra.spi.fixture.impl; - -import org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService; - -public final class TypedFooServiceImpl implements TypedFooService { - - @Override - public String getType() { - return "typedFooServiceImpl"; - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java deleted file mode 100644 index c53e043b17..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/spi/fixture/impl/UnRegisteredTypedFooServiceImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.elasticjob.infra.spi.fixture.impl; - -import org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService; - -public final class UnRegisteredTypedFooServiceImpl implements UnRegisteredTypedFooService { - - @Override - public String getType() { - return "unRegisteredTypedFooServiceImpl"; - } -} diff --git a/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService b/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService deleted file mode 100644 index 9470ce82d5..0000000000 --- a/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.TypedFooService +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.infra.spi.fixture.impl.TypedFooServiceImpl diff --git a/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService b/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService deleted file mode 100644 index 2d955a7c59..0000000000 --- a/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.spi.fixture.UnRegisteredTypedFooService +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.infra.spi.fixture.impl.UnRegisteredTypedFooServiceImpl diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 62b0975b95..76ef8fd7d3 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -27,8 +27,6 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListenerFactory; -import org.apache.shardingsphere.elasticjob.infra.spi.ElasticJobServiceLoader; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; @@ -36,6 +34,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.setup.SetUpFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.Scheduler; @@ -53,10 +52,6 @@ */ public final class JobScheduler { - static { - ElasticJobServiceLoader.registerTypedService(JobErrorHandlerPropertiesValidator.class); - } - private static final String JOB_EXECUTOR_DATA_MAP_KEY = "jobExecutor"; @Getter @@ -111,9 +106,7 @@ private JobConfiguration setUpJobConfiguration(final CoordinatorRegistryCenter r } private Collection getElasticJobListeners(final JobConfiguration jobConfig) { - return jobConfig.getJobListenerTypes().stream() - .map(type -> ElasticJobListenerFactory.createListener(type).orElseThrow(() -> new IllegalArgumentException(String.format("Can not find job listener type '%s'.", type)))) - .collect(Collectors.toList()); + return jobConfig.getJobListenerTypes().stream().map(each -> TypedSPILoader.getService(ElasticJobListener.class, each)).collect(Collectors.toList()); } private Optional> findTracingConfiguration() { @@ -126,7 +119,7 @@ private void validateJobProperties() { private void validateJobErrorHandlerProperties() { if (null != jobConfig.getJobErrorHandlerType()) { - ElasticJobServiceLoader.newTypedServiceInstance(JobErrorHandlerPropertiesValidator.class, jobConfig.getJobErrorHandlerType(), jobConfig.getProps()) + TypedSPILoader.findService(JobErrorHandlerPropertiesValidator.class, jobConfig.getJobErrorHandlerType(), jobConfig.getProps()) .ifPresent(validator -> validator.validate(jobConfig.getProps())); } } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java index 4bde6078a5..ca46e01522 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java @@ -22,7 +22,6 @@ import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategyFactory; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; @@ -34,6 +33,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -121,7 +121,7 @@ public void shardingIfNecessary() { log.debug("Job '{}' sharding begin.", jobName); jobNodeStorage.fillEphemeralJobNode(ShardingNode.PROCESSING, ""); resetShardingInfo(shardingTotalCount); - JobShardingStrategy jobShardingStrategy = JobShardingStrategyFactory.getStrategy(jobConfig.getJobShardingStrategyType()); + JobShardingStrategy jobShardingStrategy = TypedSPILoader.getService(JobShardingStrategy.class, jobConfig.getJobShardingStrategyType()); jobNodeStorage.executeInTransaction(getShardingResultTransactionOperations(jobShardingStrategy.sharding(availableJobInstances, jobName, shardingTotalCount))); log.debug("Job '{}' sharding complete.", jobName); } diff --git a/pom.xml b/pom.xml index 7a40f8b82d..8bafe34355 100644 --- a/pom.xml +++ b/pom.xml @@ -49,6 +49,7 @@ UTF-8 + 5.4.1 32.1.2-jre 3.12.0 1.16.0 @@ -123,6 +124,11 @@ + + org.apache.shardingsphere + shardingsphere-infra-spi + ${shardingsphere.version} + com.google.guava guava diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java index 335deb77de..1a4172efa2 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java @@ -28,7 +28,7 @@ import org.springframework.beans.factory.support.ManagedList; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.util.StringUtils; +import org.springframework.util.ObjectUtils; import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; @@ -75,10 +75,15 @@ private BeanDefinition createJobConfigurationBeanDefinition(final Element elemen result.addConstructorArgValue(element.getAttribute(JobBeanDefinitionTag.MISFIRE_ATTRIBUTE)); result.addConstructorArgValue(element.getAttribute(JobBeanDefinitionTag.MAX_TIME_DIFF_SECONDS_ATTRIBUTE)); result.addConstructorArgValue(element.getAttribute(JobBeanDefinitionTag.RECONCILE_INTERVAL_MINUTES)); - result.addConstructorArgValue(element.getAttribute(JobBeanDefinitionTag.JOB_SHARDING_STRATEGY_TYPE_ATTRIBUTE)); - result.addConstructorArgValue(element.getAttribute(JobBeanDefinitionTag.JOB_EXECUTOR_SERVICE_HANDLER_TYPE_ATTRIBUTE)); - result.addConstructorArgValue(element.getAttribute(JobBeanDefinitionTag.JOB_ERROR_HANDLER_TYPE_ATTRIBUTE)); - if (StringUtils.isEmpty(element.getAttribute(JobBeanDefinitionTag.JOB_LISTENER_TYPES_ATTRIBUTE).trim())) { + result.addConstructorArgValue( + element.hasAttribute(JobBeanDefinitionTag.JOB_SHARDING_STRATEGY_TYPE_ATTRIBUTE) ? element.getAttribute(JobBeanDefinitionTag.JOB_SHARDING_STRATEGY_TYPE_ATTRIBUTE) : null); + result.addConstructorArgValue( + element.hasAttribute(JobBeanDefinitionTag.JOB_EXECUTOR_SERVICE_HANDLER_TYPE_ATTRIBUTE) + ? element.getAttribute(JobBeanDefinitionTag.JOB_EXECUTOR_SERVICE_HANDLER_TYPE_ATTRIBUTE) + : null); + result.addConstructorArgValue( + element.hasAttribute(JobBeanDefinitionTag.JOB_ERROR_HANDLER_TYPE_ATTRIBUTE) ? element.getAttribute(JobBeanDefinitionTag.JOB_ERROR_HANDLER_TYPE_ATTRIBUTE) : null); + if (ObjectUtils.isEmpty(element.getAttribute(JobBeanDefinitionTag.JOB_LISTENER_TYPES_ATTRIBUTE).trim())) { result.addConstructorArgValue(Collections.emptyList()); } else { result.addConstructorArgValue(Arrays.asList(element.getAttribute(JobBeanDefinitionTag.JOB_LISTENER_TYPES_ATTRIBUTE).split(","))); From c9f9059b5cdbaeb5e8c50c15bcd7aaf61d673f5c Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 10:21:19 +0800 Subject: [PATCH 076/178] Add NopStatusListener in logback-test.xml --- .../type/dingtalk/src/test/resources/logback-test.xml | 1 + .../type/email/src/test/resources/logback-test.xml | 1 + .../type/general/src/test/resources/logback-test.xml | 1 + .../type/wechat/src/test/resources/logback-test.xml | 1 + ecosystem/tracing/api/src/test/resources/logback-test.xml | 2 ++ ecosystem/tracing/rdb/src/test/resources/logback-test.xml | 2 ++ infra/src/test/resources/logback-test.xml | 2 ++ kernel/src/test/resources/logback-test.xml | 2 ++ lifecycle/src/test/resources/logback-test.xml | 2 ++ .../zookeeper-curator/src/test/resources/logback-test.xml | 2 ++ .../elasticjob/spring/boot/job/ElasticJobSpringBootTest.java | 5 ++--- spring/boot-starter/src/test/resources/logback-test.xml | 2 ++ spring/core/src/test/resources/META-INF/logback-test.xml | 2 ++ spring/namespace/src/test/resources/logback-test.xml | 2 ++ 14 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml index a33f47dff7..df652e0168 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml +++ b/ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml @@ -17,6 +17,7 @@ --> + diff --git a/ecosystem/error-handler/type/email/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/email/src/test/resources/logback-test.xml index dafd4e3061..3d28126905 100644 --- a/ecosystem/error-handler/type/email/src/test/resources/logback-test.xml +++ b/ecosystem/error-handler/type/email/src/test/resources/logback-test.xml @@ -17,6 +17,7 @@ --> + diff --git a/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml index a0c3fbb71b..daeed13adc 100644 --- a/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml +++ b/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml @@ -17,6 +17,7 @@ --> + diff --git a/ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml index 624641fd53..c4ade4bd4f 100644 --- a/ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml +++ b/ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml @@ -17,6 +17,7 @@ --> + diff --git a/ecosystem/tracing/api/src/test/resources/logback-test.xml b/ecosystem/tracing/api/src/test/resources/logback-test.xml index ee3f508d5a..3e655a24db 100644 --- a/ecosystem/tracing/api/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/api/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ERROR diff --git a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml index 17942473ec..01eb3fb3ac 100644 --- a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ERROR diff --git a/infra/src/test/resources/logback-test.xml b/infra/src/test/resources/logback-test.xml index 0184fdda63..57283bfcaa 100644 --- a/infra/src/test/resources/logback-test.xml +++ b/infra/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ERROR diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index bbddeff36a..72a2eade8a 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ERROR diff --git a/lifecycle/src/test/resources/logback-test.xml b/lifecycle/src/test/resources/logback-test.xml index 0e0ccda830..1e0e6dafca 100644 --- a/lifecycle/src/test/resources/logback-test.xml +++ b/lifecycle/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ERROR diff --git a/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml b/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml index 28c1cb65cc..85f1d61dd0 100644 --- a/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml +++ b/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ERROR diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 4decf24348..6774eb45c2 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -23,11 +23,11 @@ import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob; import org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; @@ -48,7 +48,6 @@ import java.util.Set; import java.util.concurrent.TimeUnit; -import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -122,7 +121,7 @@ void assertElasticJobProperties() { assertThat(customTestJobProperties.getShardingTotalCount(), is(3)); assertNull(customTestJobProperties.getElasticJobType()); assertThat(customTestJobProperties.getJobListenerTypes().size(), is(2)); - assertThat(customTestJobProperties.getJobListenerTypes(), equalTo(Arrays.asList("NOOP", "LOG"))); + assertThat(customTestJobProperties.getJobListenerTypes(), is(Arrays.asList("NOOP", "LOG"))); ElasticJobConfigurationProperties printTestJobProperties = elasticJobProperties.getJobs().get("printTestJob"); assertNotNull(printTestJobProperties); assertNull(printTestJobProperties.getElasticJobClass()); diff --git a/spring/boot-starter/src/test/resources/logback-test.xml b/spring/boot-starter/src/test/resources/logback-test.xml index 63d4703210..65c90ee7cf 100644 --- a/spring/boot-starter/src/test/resources/logback-test.xml +++ b/spring/boot-starter/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ${log.pattern} diff --git a/spring/core/src/test/resources/META-INF/logback-test.xml b/spring/core/src/test/resources/META-INF/logback-test.xml index 9d1601c9f6..c169e22ca8 100644 --- a/spring/core/src/test/resources/META-INF/logback-test.xml +++ b/spring/core/src/test/resources/META-INF/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ${log.pattern} diff --git a/spring/namespace/src/test/resources/logback-test.xml b/spring/namespace/src/test/resources/logback-test.xml index 9d1601c9f6..c169e22ca8 100644 --- a/spring/namespace/src/test/resources/logback-test.xml +++ b/spring/namespace/src/test/resources/logback-test.xml @@ -23,6 +23,8 @@ ${log.context.name} + + ${log.pattern} From 24b07cadffcca4043080e77964f8bbd5e5595316 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 22:07:03 +0800 Subject: [PATCH 077/178] Refactor JobClassNameProviderFactory --- .../internal/setup/JobClassNameProvider.java | 2 ++ .../setup/JobClassNameProviderFactory.java | 16 ++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProvider.java index 36730e4aa6..99bc7a7194 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProvider.java @@ -18,10 +18,12 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.setup; import org.apache.shardingsphere.elasticjob.api.ElasticJob; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** * Job class name provider. */ +@SingletonSPI public interface JobClassNameProvider { /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactory.java index d2d7cd634d..914b1ecea1 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/JobClassNameProviderFactory.java @@ -19,10 +19,9 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; -import java.util.LinkedList; -import java.util.List; -import java.util.ServiceLoader; +import java.util.Collection; /** * Job class name provider factory. @@ -30,22 +29,15 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class JobClassNameProviderFactory { - private static final List PROVIDERS = new LinkedList<>(); - private static final JobClassNameProvider DEFAULT_PROVIDER = new DefaultJobClassNameProvider(); - static { - for (JobClassNameProvider each : ServiceLoader.load(JobClassNameProvider.class)) { - PROVIDERS.add(each); - } - } - /** * Get the first job class name provider. * * @return job class name provider */ public static JobClassNameProvider getProvider() { - return PROVIDERS.isEmpty() ? DEFAULT_PROVIDER : PROVIDERS.get(0); + Collection jobClassNameProviders = ShardingSphereServiceLoader.getServiceInstances(JobClassNameProvider.class); + return jobClassNameProviders.isEmpty() ? DEFAULT_PROVIDER : jobClassNameProviders.iterator().next(); } } From f48ed07125132f002d45e99d3226b7b3d5a3f0ad Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 22:15:09 +0800 Subject: [PATCH 078/178] Remove TracingListenerFactory --- .../tracing/JobTracingEventBus.java | 9 ++- .../TracingListenerConfiguration.java | 11 ++-- .../listener/TracingListenerFactory.java | 58 ------------------- .../listener/TracingListenerFactoryTest.java | 47 --------------- 4 files changed, 12 insertions(+), 113 deletions(-) delete mode 100644 ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java delete mode 100644 ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java index 8f39d39ca6..67d4e8c548 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java @@ -25,7 +25,8 @@ import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobEvent; import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerFactory; +import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; @@ -64,9 +65,13 @@ private static ExecutorService createExecutorService(final int threadSize) { return MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService(threadPoolExecutor)); } + @SuppressWarnings("unchecked") private void register(final TracingConfiguration tracingConfig) { try { - eventBus.register(TracingListenerFactory.getListener(tracingConfig)); + if (null == tracingConfig.getTracingStorageConfiguration()) { + throw new TracingConfigurationException(String.format("Can not find executor service handler type '%s'.", tracingConfig.getType())); + } + eventBus.register(TypedSPILoader.getService(TracingListenerConfiguration.class, tracingConfig.getType()).createTracingListener(tracingConfig.getTracingStorageConfiguration().getStorage())); isRegistered = true; } catch (final TracingConfigurationException ex) { log.error("Elastic job: create tracing listener failure, error is: ", ex); diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java index 3fbb124e09..190dce213a 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java @@ -18,13 +18,16 @@ package org.apache.shardingsphere.elasticjob.tracing.listener; import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** * Tracing listener configuration. * * @param type of tracing storage */ -public interface TracingListenerConfiguration { +@SingletonSPI +public interface TracingListenerConfiguration extends TypedSPI { /** * Create tracing listener. @@ -35,10 +38,6 @@ public interface TracingListenerConfiguration { */ TracingListener createTracingListener(T storage) throws TracingConfigurationException; - /** - * Get tracing type. - * - * @return tracing type - */ + @Override String getType(); } diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java deleted file mode 100644 index f4c451cee0..0000000000 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.elasticjob.tracing.listener; - -import com.google.common.base.Strings; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; - -import java.util.HashMap; -import java.util.Map; -import java.util.ServiceLoader; - -/** - * Tracing listener factory. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class TracingListenerFactory { - - private static final Map LISTENER_CONFIGS = new HashMap<>(); - - static { - for (TracingListenerConfiguration each : ServiceLoader.load(TracingListenerConfiguration.class)) { - LISTENER_CONFIGS.put(each.getType(), each); - } - } - - /** - * Get tracing listener. - * - * @param tracingConfig tracing configuration - * @return tracing listener - * @throws TracingConfigurationException tracing configuration exception - */ - @SuppressWarnings("unchecked") - public static TracingListener getListener(final TracingConfiguration tracingConfig) throws TracingConfigurationException { - if (null == tracingConfig.getTracingStorageConfiguration() || Strings.isNullOrEmpty(tracingConfig.getType()) || !LISTENER_CONFIGS.containsKey(tracingConfig.getType())) { - throw new TracingConfigurationException(String.format("Can not find executor service handler type '%s'.", tracingConfig.getType())); - } - return LISTENER_CONFIGS.get(tracingConfig.getType()).createTracingListener(tracingConfig.getTracingStorageConfiguration().getStorage()); - } -} diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java deleted file mode 100644 index f6ab431e9c..0000000000 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.elasticjob.tracing.listener; - -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCallerConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListener; -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - -class TracingListenerFactoryTest { - - @Test - void assertGetListenerWithNullType() { - assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("", null))); - } - - @Test - void assertGetInvalidListener() { - assertThrows(TracingConfigurationException.class, () -> TracingListenerFactory.getListener(new TracingConfiguration<>("INVALID", null))); - } - - @Test - void assertGetListener() throws TracingConfigurationException { - assertThat(TracingListenerFactory.getListener(new TracingConfiguration<>("TEST", new JobEventCallerConfiguration(() -> { - }))), instanceOf(TestTracingListener.class)); - } -} From 4ee87542ccde51a06f5626b3f494d5dd4da0bfaf Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 22:20:41 +0800 Subject: [PATCH 079/178] Refactor TracingStorageConverterFactory --- .../tracing/storage/TracingStorageConverter.java | 2 ++ .../storage/TracingStorageConverterFactory.java | 15 ++++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java index d7686cbe72..559821e4e9 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java @@ -18,12 +18,14 @@ package org.apache.shardingsphere.elasticjob.tracing.storage; import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** * Tracing storage converter. * * @param storage type */ +@SingletonSPI public interface TracingStorageConverter { /** diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java index 30c1004846..b326c1ee39 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java @@ -19,11 +19,9 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; -import java.util.LinkedList; -import java.util.List; import java.util.Optional; -import java.util.ServiceLoader; /** * Factory for {@link TracingStorageConverter}. @@ -31,21 +29,16 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class TracingStorageConverterFactory { - private static final List> CONVERTERS = new LinkedList<>(); - - static { - ServiceLoader.load(TracingStorageConverter.class).forEach(CONVERTERS::add); - } - /** * Find {@link TracingStorageConverter} for specific storage type. * * @param storageType storage type - * @param storage type + * @param storage type * @return instance of {@link TracingStorageConverter} */ @SuppressWarnings("unchecked") public static Optional> findConverter(final Class storageType) { - return CONVERTERS.stream().filter(each -> each.storageType().isAssignableFrom(storageType)).map(each -> (TracingStorageConverter) each).findFirst(); + return ShardingSphereServiceLoader.getServiceInstances(TracingStorageConverter.class).stream() + .filter(each -> each.storageType().isAssignableFrom(storageType)).map(each -> (TracingStorageConverter) each).findFirst(); } } From 6f156629b626026c2d1abbeff6448dfd0f5d6e24 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 22:28:29 +0800 Subject: [PATCH 080/178] Refactor RegExceptionHandler --- registry-center/api/pom.xml | 7 +++++++ .../reg/exception/IgnoredExceptionProvider.java | 3 +++ .../reg/exception/RegExceptionHandler.java | 15 +++------------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/registry-center/api/pom.xml b/registry-center/api/pom.xml index bfb3dab209..a5a5ef9d77 100644 --- a/registry-center/api/pom.xml +++ b/registry-center/api/pom.xml @@ -25,4 +25,11 @@ elasticjob-registry-center-api ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-spi + + diff --git a/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java index 1f52a6b07b..21e683afc2 100644 --- a/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java +++ b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/IgnoredExceptionProvider.java @@ -17,11 +17,14 @@ package org.apache.shardingsphere.elasticjob.reg.exception; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; + import java.util.Collection; /** * Ignored exception provider. */ +@SingletonSPI public interface IgnoredExceptionProvider { /** diff --git a/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java index 2100a0fd49..42f59f8f67 100644 --- a/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java +++ b/registry-center/api/src/main/java/org/apache/shardingsphere/elasticjob/reg/exception/RegExceptionHandler.java @@ -20,24 +20,15 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.ServiceLoader; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; /** * Registry center exception handler. */ -@Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) +@Slf4j public final class RegExceptionHandler { - private static final Collection> IGNORED_EXCEPTIONS = new LinkedList<>(); - - static { - ServiceLoader.load(IgnoredExceptionProvider.class).forEach(each -> IGNORED_EXCEPTIONS.addAll(each.getIgnoredExceptions())); - } - /** * Handle exception. * @@ -57,6 +48,6 @@ public static void handleException(final Exception cause) { } private static boolean isIgnoredException(final Throwable cause) { - return IGNORED_EXCEPTIONS.stream().anyMatch(each -> each.isInstance(cause)); + return ShardingSphereServiceLoader.getServiceInstances(IgnoredExceptionProvider.class).stream().flatMap(each -> each.getIgnoredExceptions().stream()).anyMatch(each -> each.isInstance(cause)); } } From 8de64126b898eb459de24c642aeb4965fa67180a Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 22:35:52 +0800 Subject: [PATCH 081/178] Refactor DatabaseType --- .../tracing/rdb/storage/RDBJobEventStorage.java | 13 ++----------- .../tracing/rdb/type/DatabaseType.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 18f05eb349..9680901d38 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -25,6 +25,7 @@ import org.apache.shardingsphere.elasticjob.tracing.exception.WrapException; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DefaultDatabaseType; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; import javax.sql.DataSource; import java.sql.Connection; @@ -36,10 +37,8 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.ServiceLoader; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; @@ -56,8 +55,6 @@ public final class RDBJobEventStorage { private static final String TASK_ID_STATE_INDEX = "TASK_ID_STATE_INDEX"; - private static final Map DATABASE_TYPES = new HashMap<>(); - private static final Map STORAGE_MAP = new ConcurrentHashMap<>(); private final DataSource dataSource; @@ -66,12 +63,6 @@ public final class RDBJobEventStorage { private final RDBStorageSQLMapper sqlMapper; - static { - for (DatabaseType each : ServiceLoader.load(DatabaseType.class)) { - DATABASE_TYPES.put(each.getType(), each); - } - } - private RDBJobEventStorage(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; databaseType = getDatabaseType(dataSource); @@ -117,7 +108,7 @@ public static RDBJobEventStorage wrapException(final Supplier Date: Tue, 24 Oct 2023 22:43:41 +0800 Subject: [PATCH 082/178] Refactor JDBCParameterDecorator --- .../rdb/datasource/DataSourceConfiguration.java | 14 ++------------ .../rdb/datasource/JDBCParameterDecorator.java | 10 ++++------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java index 3b9bc86187..63434bf611 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java @@ -25,6 +25,7 @@ import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import javax.sql.DataSource; import java.lang.reflect.Method; @@ -35,7 +36,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Optional; -import java.util.ServiceLoader; /** * Data source configuration. @@ -121,20 +121,10 @@ public DataSource createDataSource() { setterMethod.get().invoke(result, entry.getValue()); } } - Optional decorator = findJDBCParameterDecorator(result); + Optional decorator = TypedSPILoader.findService(JDBCParameterDecorator.class, result.getClass()); return decorator.isPresent() ? decorator.get().decorate(result) : result; } - @SuppressWarnings("rawtypes") - private Optional findJDBCParameterDecorator(final DataSource dataSource) { - for (JDBCParameterDecorator each : ServiceLoader.load(JDBCParameterDecorator.class)) { - if (each.getType() == dataSource.getClass()) { - return Optional.of(each); - } - } - return Optional.empty(); - } - private Optional findSetterMethod(final Method[] methods, final String property) { String setterMethodName = Joiner.on("").join(SETTER_PREFIX, CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, property)); for (Method each : methods) { diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java index 95fad6118e..e924b01eff 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java @@ -17,6 +17,8 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; + import javax.sql.DataSource; /** @@ -24,7 +26,7 @@ * * @param type of data source */ -public interface JDBCParameterDecorator { +public interface JDBCParameterDecorator extends TypedSPI { /** * Decorate data source. @@ -34,10 +36,6 @@ public interface JDBCParameterDecorator { */ T decorate(T dataSource); - /** - * Get data source type. - * - * @return data source type - */ + @Override Class getType(); } From 25a0e02f6aa3b7acfe15a8ec5f945cb05168c0ac Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 23:10:56 +0800 Subject: [PATCH 083/178] Refactor YamlConfigurationConverter --- .../YamlTracingConfigurationConverter.java | 17 +++--- ...lJobEventCallerConfigurationConverter.java | 2 +- .../YamlDataSourceConfigurationConverter.java | 2 +- .../infra/pojo/JobConfigurationPOJO.java | 8 +-- .../config/YamlConfigurationConverter.java | 14 ++--- .../YamlConfigurationConverterFactory.java | 52 ------------------- ...YamlConfigurationConverterFactoryTest.java | 33 ------------ 7 files changed, 20 insertions(+), 108 deletions(-) delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java index 5d7bf346ae..85e02e697c 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java @@ -18,10 +18,9 @@ package org.apache.shardingsphere.elasticjob.tracing.yaml; import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverterFactory; -import org.apache.shardingsphere.elasticjob.infra.yaml.exception.YamlConfigurationConverterNotFoundException; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; /** * Converter to convert {@link TracingConfiguration} to {@link YamlTracingConfiguration}. @@ -32,21 +31,19 @@ public final class YamlTracingConfigurationConverter implements YamlConfigurationConverter, YamlTracingConfiguration> { @Override - public YamlTracingConfiguration convertToYamlConfiguration(final TracingConfiguration tracingConfiguration) { + public YamlTracingConfiguration convertToYamlConfiguration(final TracingConfiguration tracingConfig) { YamlTracingConfiguration result = new YamlTracingConfiguration<>(); - result.setType(tracingConfiguration.getType()); - result.setTracingStorageConfiguration(convertTracingStorageConfiguration(tracingConfiguration.getTracingStorageConfiguration())); + result.setType(tracingConfig.getType()); + result.setTracingStorageConfiguration(convertTracingStorageConfiguration(tracingConfig.getTracingStorageConfiguration())); return result; } - private YamlTracingStorageConfiguration convertTracingStorageConfiguration(final TracingStorageConfiguration tracingStorageConfiguration) { - return YamlConfigurationConverterFactory - ., YamlTracingStorageConfiguration>findConverter((Class>) tracingStorageConfiguration.getClass()) - .orElseThrow(() -> new YamlConfigurationConverterNotFoundException(tracingStorageConfiguration.getClass())).convertToYamlConfiguration(tracingStorageConfiguration); + private YamlTracingStorageConfiguration convertTracingStorageConfiguration(final TracingStorageConfiguration tracingStorageConfig) { + return (YamlTracingStorageConfiguration) TypedSPILoader.getService(YamlConfigurationConverter.class, tracingStorageConfig.getClass()).convertToYamlConfiguration(tracingStorageConfig); } @Override - public Class configurationType() { + public Class getType() { return TracingConfiguration.class; } } diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java index 22d282c183..b25b87ebfa 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java +++ b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java @@ -36,7 +36,7 @@ public YamlTracingStorageConfiguration convertToYamlConfiguratio } @Override - public Class configurationType() { + public Class getType() { return JobEventCallerConfiguration.class; } } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java index 15ca4c5f3b..7d4154dcdc 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java @@ -40,7 +40,7 @@ public YamlTracingStorageConfiguration convertToYamlConfiguration(fi } @Override - public Class configurationType() { + public Class getType() { return DataSourceConfiguration.class; } } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java index 3cdfd35d49..4d3fa13c96 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java @@ -22,8 +22,8 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverterFactory; -import org.apache.shardingsphere.elasticjob.infra.yaml.exception.YamlConfigurationConverterNotFoundException; +import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.ArrayList; import java.util.Collection; @@ -125,8 +125,8 @@ public static JobConfigurationPOJO fromJobConfiguration(final JobConfiguration j result.setJobExecutorServiceHandlerType(jobConfiguration.getJobExecutorServiceHandlerType()); result.setJobErrorHandlerType(jobConfiguration.getJobErrorHandlerType()); result.setJobListenerTypes(jobConfiguration.getJobListenerTypes()); - jobConfiguration.getExtraConfigurations().stream().map(each -> YamlConfigurationConverterFactory.findConverter((Class) each.getClass()) - .orElseThrow(() -> new YamlConfigurationConverterNotFoundException(each.getClass())).convertToYamlConfiguration(each)).forEach(result.getJobExtraConfigurations()::add); + jobConfiguration.getExtraConfigurations().stream() + .map(each -> TypedSPILoader.getService(YamlConfigurationConverter.class, each.getClass()).convertToYamlConfiguration(each)).forEach(result.getJobExtraConfigurations()::add); result.setDescription(jobConfiguration.getDescription()); result.setProps(jobConfiguration.getProps()); result.setDisabled(jobConfiguration.isDisabled()); diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java index c15f208464..29ad03bb71 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java @@ -17,13 +17,17 @@ package org.apache.shardingsphere.elasticjob.infra.yaml.config; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; +import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; + /** * YAML configuration converter. * * @param type of original configuration object * @param type of YAML configuration */ -public interface YamlConfigurationConverter> { +@SingletonSPI +public interface YamlConfigurationConverter> extends TypedSPI { /** * Convert to YAML configuration. @@ -33,10 +37,6 @@ public interface YamlConfigurationConverter> { */ Y convertToYamlConfiguration(T data); - /** - * Get type of Configuration. - * - * @return configuration type - */ - Class configurationType(); + @Override + Class getType(); } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java deleted file mode 100644 index 7303894ceb..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.elasticjob.infra.yaml.config; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Optional; -import java.util.ServiceLoader; - -/** - * Factory for {@link YamlConfigurationConverter}. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class YamlConfigurationConverterFactory { - - private static final Map, YamlConfigurationConverter> CONVERTERS = new LinkedHashMap<>(); - - static { - ServiceLoader.load(YamlConfigurationConverter.class).forEach(each -> CONVERTERS.put(each.configurationType(), each)); - } - - /** - * Find {@link YamlConfigurationConverter} for specific configuration type. - * - * @param configurationType type of configuration - * @param type of configuration - * @param type of YAML configuration - * @return converter for specific configuration type - */ - @SuppressWarnings("unchecked") - public static > Optional> findConverter(final Class configurationType) { - return Optional.ofNullable((YamlConfigurationConverter) CONVERTERS.get(configurationType)); - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java deleted file mode 100644 index 7d2a2f0946..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverterFactoryTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.elasticjob.infra.yaml.config; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertFalse; - -class YamlConfigurationConverterFactoryTest { - - @Test - void assertConverterNotFound() { - assertFalse(YamlConfigurationConverterFactory.findConverter(AClassWithoutCorrespondingConverter.class).isPresent()); - } - - private static class AClassWithoutCorrespondingConverter { - } -} From 0878e784475a7a21e9697099e3fe0a17f80757d9 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 23:13:23 +0800 Subject: [PATCH 084/178] Refactor JobItemExecutorFactory --- .../executor/item/JobItemExecutorFactory.java | 18 ++++-------------- .../item/impl/ClassedJobItemExecutor.java | 2 ++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java index 9bf125e441..4632f8ce36 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java @@ -22,11 +22,7 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.ServiceLoader; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; /** * Job item executor factory. @@ -35,12 +31,6 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class JobItemExecutorFactory { - private static final Map CLASSED_EXECUTORS = new HashMap<>(); - - static { - ServiceLoader.load(ClassedJobItemExecutor.class).forEach(each -> CLASSED_EXECUTORS.put(each.getElasticJobClass(), each)); - } - /** * Get executor. * @@ -49,9 +39,9 @@ public final class JobItemExecutorFactory { */ @SuppressWarnings("unchecked") public static JobItemExecutor getExecutor(final Class elasticJobClass) { - for (Entry entry : CLASSED_EXECUTORS.entrySet()) { - if (entry.getKey().isAssignableFrom(elasticJobClass)) { - return entry.getValue(); + for (ClassedJobItemExecutor each : ShardingSphereServiceLoader.getServiceInstances(ClassedJobItemExecutor.class)) { + if (each.getElasticJobClass().isAssignableFrom(elasticJobClass)) { + return each; } } throw new JobConfigurationException("Can not find executor for elastic job class `%s`", elasticJobClass.getName()); diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java index 1627f6967d..63b8a06881 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java @@ -19,12 +19,14 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** * Classed job item executor. * * @param type of ElasticJob */ +@SingletonSPI public interface ClassedJobItemExecutor extends JobItemExecutor { /** From 71cf3f96a3eb3894e857ff1570ec1b48a9c06cbc Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 23:21:01 +0800 Subject: [PATCH 085/178] Use ShardingSphereServiceLoader to instead of JDK ServiceLoader --- .../deserializer/RequestBodyDeserializerFactory.java | 6 +++--- .../restful/deserializer/factory/DeserializerFactory.java | 2 ++ .../impl/DefaultTextPlainRequestBodyDeserializer.java | 2 ++ .../restful/serializer/ResponseBodySerializer.java | 3 +++ .../restful/serializer/ResponseBodySerializerFactory.java | 6 +++--- .../restful/serializer/factory/SerializerFactory.java | 2 ++ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java index 5b5df09b7f..015ae524e9 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/RequestBodyDeserializerFactory.java @@ -20,10 +20,10 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.restful.deserializer.factory.DeserializerFactory; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; import java.util.Map; import java.util.Optional; -import java.util.ServiceLoader; import java.util.concurrent.ConcurrentHashMap; /** @@ -50,10 +50,10 @@ public T deserialize(final Class targetType, final byte[] requestBodyByte }; static { - for (RequestBodyDeserializer deserializer : ServiceLoader.load(RequestBodyDeserializer.class)) { + for (RequestBodyDeserializer deserializer : ShardingSphereServiceLoader.getServiceInstances(RequestBodyDeserializer.class)) { REQUEST_BODY_DESERIALIZERS.put(deserializer.mimeType(), deserializer); } - for (DeserializerFactory factory : ServiceLoader.load(DeserializerFactory.class)) { + for (DeserializerFactory factory : ShardingSphereServiceLoader.getServiceInstances(DeserializerFactory.class)) { DEFAULT_REQUEST_BODY_DESERIALIZER_FACTORIES.put(factory.mimeType(), factory); } } diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java index 5106d85dd0..db61b536ae 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/factory/DeserializerFactory.java @@ -18,6 +18,7 @@ package org.apache.shardingsphere.elasticjob.restful.deserializer.factory; import org.apache.shardingsphere.elasticjob.restful.deserializer.RequestBodyDeserializer; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** * Deserializer factory. @@ -25,6 +26,7 @@ * @see RequestBodyDeserializer * @see org.apache.shardingsphere.elasticjob.restful.deserializer.RequestBodyDeserializerFactory */ +@SingletonSPI public interface DeserializerFactory { /** diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java index d27c76197d..ccaa133a62 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultTextPlainRequestBodyDeserializer.java @@ -19,6 +19,7 @@ import io.netty.handler.codec.http.HttpHeaderValues; import org.apache.shardingsphere.elasticjob.restful.deserializer.RequestBodyDeserializer; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import java.nio.charset.StandardCharsets; import java.text.MessageFormat; @@ -26,6 +27,7 @@ /** * Default deserializer for text/plain. */ +@SingletonSPI public final class DefaultTextPlainRequestBodyDeserializer implements RequestBodyDeserializer { @Override diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java index 2aefd3cb16..4ce24a6000 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializer.java @@ -17,9 +17,12 @@ package org.apache.shardingsphere.elasticjob.restful.serializer; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; + /** * Serializer for serializing response body with specific MIME type. */ +@SingletonSPI public interface ResponseBodySerializer { /** diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java index 33e221912c..909652bf8d 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/ResponseBodySerializerFactory.java @@ -20,10 +20,10 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.restful.serializer.factory.SerializerFactory; +import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; import java.util.Map; import java.util.Optional; -import java.util.ServiceLoader; import java.util.concurrent.ConcurrentHashMap; /** @@ -50,10 +50,10 @@ public byte[] serialize(final Object responseBody) { }; static { - for (ResponseBodySerializer serializer : ServiceLoader.load(ResponseBodySerializer.class)) { + for (ResponseBodySerializer serializer : ShardingSphereServiceLoader.getServiceInstances(ResponseBodySerializer.class)) { RESPONSE_BODY_SERIALIZERS.put(serializer.mimeType(), serializer); } - for (SerializerFactory factory : ServiceLoader.load(SerializerFactory.class)) { + for (SerializerFactory factory : ShardingSphereServiceLoader.getServiceInstances(SerializerFactory.class)) { RESPONSE_BODY_SERIALIZER_FACTORIES.put(factory.mimeType(), factory); } } diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java index 4f10d92f24..ee1fc329fc 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/factory/SerializerFactory.java @@ -18,6 +18,7 @@ package org.apache.shardingsphere.elasticjob.restful.serializer.factory; import org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer; +import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** * Serializer factory. @@ -25,6 +26,7 @@ * @see ResponseBodySerializer * @see org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializerFactory */ +@SingletonSPI public interface SerializerFactory { /** From 175a2ff608677cea25cdc20a231b57b2b6630e35 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 24 Oct 2023 23:28:10 +0800 Subject: [PATCH 086/178] For checkstyle --- .../shardingsphere/elasticjob/tracing/JobTracingEventBus.java | 3 ++- .../tracing/yaml/YamlTracingConfigurationConverter.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java index 67d4e8c548..003e03837c 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java @@ -71,7 +71,8 @@ private void register(final TracingConfiguration tracingConfig) { if (null == tracingConfig.getTracingStorageConfiguration()) { throw new TracingConfigurationException(String.format("Can not find executor service handler type '%s'.", tracingConfig.getType())); } - eventBus.register(TypedSPILoader.getService(TracingListenerConfiguration.class, tracingConfig.getType()).createTracingListener(tracingConfig.getTracingStorageConfiguration().getStorage())); + eventBus.register( + TypedSPILoader.getService(TracingListenerConfiguration.class, tracingConfig.getType()).createTracingListener(tracingConfig.getTracingStorageConfiguration().getStorage())); isRegistered = true; } catch (final TracingConfigurationException ex) { log.error("Elastic job: create tracing listener failure, error is: ", ex); diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java index 85e02e697c..d605fcce51 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java @@ -39,7 +39,7 @@ public YamlTracingConfiguration convertToYamlConfiguration(final TracingConfi } private YamlTracingStorageConfiguration convertTracingStorageConfiguration(final TracingStorageConfiguration tracingStorageConfig) { - return (YamlTracingStorageConfiguration) TypedSPILoader.getService(YamlConfigurationConverter.class, tracingStorageConfig.getClass()).convertToYamlConfiguration(tracingStorageConfig); + return (YamlTracingStorageConfiguration) TypedSPILoader.getService(YamlConfigurationConverter.class, tracingStorageConfig.getClass()).convertToYamlConfiguration(tracingStorageConfig); } @Override From ce236d9e375927626bf1addf32683d8eeb316f2f Mon Sep 17 00:00:00 2001 From: zhangliang Date: Wed, 25 Oct 2023 11:21:06 +0800 Subject: [PATCH 087/178] Simplify variable name from configuration to config --- .../wechat/WechatJobErrorHandlerTest.java | 8 +-- .../executor/context/ExecutorContext.java | 6 +-- .../http/executor/HttpJobExecutorTest.java | 8 +-- .../tracing/api/TracingConfiguration.java | 2 +- .../yaml/YamlTracingConfiguration.java | 2 +- ...YamlTracingConfigurationConverterTest.java | 7 ++- .../rdb/datasource/DataSourceRegistry.java | 12 ++--- .../rdb/yaml/YamlDataSourceConfiguration.java | 2 +- .../YamlDataSourceConfigurationConverter.java | 6 +-- .../datasource/DataSourceRegistryTest.java | 24 ++++----- ...DataSourceTracingStorageConverterTest.java | 4 +- ...lDataSourceConfigurationConverterTest.java | 6 +-- .../infra/pojo/JobConfigurationPOJO.java | 48 +++++++++--------- .../infra/pojo/JobConfigurationPOJOTest.java | 4 +- .../annotation/JobAnnotationBuilder.java | 12 +++-- .../config/RescheduleListenerManager.java | 6 +-- .../internal/sharding/ExecutionService.java | 6 +-- .../annotation/JobAnnotationBuilderTest.java | 36 ++++++------- .../lifecycle/api/JobConfigurationAPI.java | 2 +- .../settings/JobConfigurationAPIImplTest.java | 50 +++++++++---------- .../restful/NettyRestfulService.java | 14 +++--- .../RestfulServiceChannelInitializer.java | 8 +-- .../pipeline/NettyRestfulServiceTest.java | 10 ++-- ...ulServiceTrailingSlashInsensitiveTest.java | 8 +-- ...tfulServiceTrailingSlashSensitiveTest.java | 10 ++-- .../job/ElasticJobBootstrapConfiguration.java | 2 +- .../parser/ZookeeperBeanDefinitionParser.java | 20 ++++---- 27 files changed, 161 insertions(+), 162 deletions(-) diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index 72226574a3..b39cda94d0 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -51,10 +51,10 @@ class WechatJobErrorHandlerTest { @SuppressWarnings({"unchecked", "rawtypes"}) @BeforeAll static void init() { - NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); - configuration.setHost(HOST); - configuration.addControllerInstances(new WechatInternalController()); - restfulService = new NettyRestfulService(configuration); + NettyRestfulServiceConfiguration config = new NettyRestfulServiceConfiguration(PORT); + config.setHost(HOST); + config.addControllerInstances(new WechatInternalController()); + restfulService = new NettyRestfulService(config); restfulService.startup(); ch.qos.logback.classic.Logger log = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(WechatJobErrorHandler.class); ListAppender appender = (ListAppender) log.getAppender("WechatJobErrorHandlerTestAppender"); diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java index 2e5c1ba04e..b43c77a678 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java @@ -42,10 +42,10 @@ public ExecutorContext(final JobConfiguration jobConfig) { /** * Reload all reloadable item if necessary. * - * @param jobConfiguration job configuration + * @param jobConfig job configuration */ - public void reloadIfNecessary(final JobConfiguration jobConfiguration) { - ShardingSphereServiceLoader.getServiceInstances(Reloadable.class).forEach(each -> each.reloadIfNecessary(jobConfiguration)); + public void reloadIfNecessary(final JobConfiguration jobConfig) { + ShardingSphereServiceLoader.getServiceInstances(Reloadable.class).forEach(each -> each.reloadIfNecessary(jobConfig)); } /** diff --git a/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index f025ef231d..0472fd25d1 100644 --- a/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -73,10 +73,10 @@ class HttpJobExecutorTest { @BeforeAll static void init() { - NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); - configuration.setHost(HOST); - configuration.addControllerInstances(new InternalController()); - restfulService = new NettyRestfulService(configuration); + NettyRestfulServiceConfiguration config = new NettyRestfulServiceConfiguration(PORT); + config.setHost(HOST); + config.addControllerInstances(new InternalController()); + restfulService = new NettyRestfulService(config); restfulService.startup(); } diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java index 46b0efdfe1..7bd2343d69 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java @@ -28,8 +28,8 @@ * * @param type of tracing storage */ -@Getter @RequiredArgsConstructor +@Getter public final class TracingConfiguration implements JobExtraConfiguration { private final String type; diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java index fa4e81f2be..8069c4416e 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java @@ -28,9 +28,9 @@ * * @param type of storage */ +@NoArgsConstructor @Getter @Setter -@NoArgsConstructor public final class YamlTracingConfiguration implements YamlConfiguration> { private static final long serialVersionUID = -6625535892000287729L; diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java index 3c14e97c6e..3398e210d0 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -30,11 +30,10 @@ class YamlTracingConfigurationConverterTest { @Test void assertConvertTracingConfiguration() { - JobEventCaller expectedStorage = () -> { - }; - TracingConfiguration tracingConfiguration = new TracingConfiguration<>("TEST", expectedStorage); + JobEventCaller expectedStorage = () -> { }; + TracingConfiguration tracingConfig = new TracingConfiguration<>("TEST", expectedStorage); YamlTracingConfigurationConverter converter = new YamlTracingConfigurationConverter<>(); - YamlTracingConfiguration actual = converter.convertToYamlConfiguration(tracingConfiguration); + YamlTracingConfiguration actual = converter.convertToYamlConfiguration(tracingConfig); assertThat(actual.getType(), is("TEST")); assertNotNull(actual.getTracingStorageConfiguration()); assertTrue(actual.getTracingStorageConfiguration() instanceof YamlJobEventCallerConfiguration); diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java index 1102486ab9..f42152c514 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java @@ -51,17 +51,17 @@ public static DataSourceRegistry getInstance() { return instance; } - void registerDataSource(final DataSourceConfiguration configuration, final DataSource dataSource) { - dataSources.putIfAbsent(configuration, dataSource); + void registerDataSource(final DataSourceConfiguration dataSourceConfig, final DataSource dataSource) { + dataSources.putIfAbsent(dataSourceConfig, dataSource); } /** - * Get {@link DataSource} by {@link TracingStorageConfiguration}. + * Get {@link DataSource} by {@link DataSourceConfiguration}. * - * @param configuration {@link TracingStorageConfiguration} + * @param dataSourceConfig data source configuration * @return instance of {@link DataSource} */ - public DataSource getDataSource(final DataSourceConfiguration configuration) { - return dataSources.computeIfAbsent(configuration, DataSourceConfiguration::createDataSource); + public DataSource getDataSource(final DataSourceConfiguration dataSourceConfig) { + return dataSources.computeIfAbsent(dataSourceConfig, DataSourceConfiguration::createDataSource); } } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java index 0db44a0916..253d954efd 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java @@ -28,7 +28,7 @@ import java.util.Map; /** - * YAML DataSourceConfiguration. + * YAML Data source configuration. */ @Setter @Getter diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java index 7d4154dcdc..28ec2d65af 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java @@ -32,10 +32,10 @@ public final class YamlDataSourceConfigurationConverter implements YamlConfigura @Override public YamlTracingStorageConfiguration convertToYamlConfiguration(final TracingStorageConfiguration data) { - DataSourceConfiguration dataSourceConfiguration = (DataSourceConfiguration) data; + DataSourceConfiguration dataSourceConfig = (DataSourceConfiguration) data; YamlDataSourceConfiguration result = new YamlDataSourceConfiguration(); - result.setDataSourceClassName(dataSourceConfiguration.getDataSourceClassName()); - result.setProps(dataSourceConfiguration.getProps()); + result.setDataSourceClassName(dataSourceConfig.getDataSourceClassName()); + result.setProps(dataSourceConfig.getProps()); return result; } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java index f419a081dc..fff1dbac3a 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java @@ -35,26 +35,26 @@ class DataSourceRegistryTest { @Mock - private DataSourceConfiguration dataSourceConfiguration; + private DataSourceConfiguration dataSourceConfig; @Test void assertGetDataSourceBySameConfiguration() { - when(dataSourceConfiguration.createDataSource()).then(invocation -> mock(DataSource.class)); - DataSource expected = DataSourceRegistry.getInstance().getDataSource(dataSourceConfiguration); - DataSource actual = DataSourceRegistry.getInstance().getDataSource(dataSourceConfiguration); - verify(dataSourceConfiguration).createDataSource(); + when(dataSourceConfig.createDataSource()).then(invocation -> mock(DataSource.class)); + DataSource expected = DataSourceRegistry.getInstance().getDataSource(dataSourceConfig); + DataSource actual = DataSourceRegistry.getInstance().getDataSource(dataSourceConfig); + verify(dataSourceConfig).createDataSource(); assertThat(actual, is(expected)); } @Test void assertGetDataSourceWithDifferentConfiguration() { - when(dataSourceConfiguration.createDataSource()).then(invocation -> mock(DataSource.class)); - DataSourceConfiguration anotherDataSourceConfiguration = mock(DataSourceConfiguration.class); - when(anotherDataSourceConfiguration.createDataSource()).then(invocation -> mock(DataSource.class)); - DataSource one = DataSourceRegistry.getInstance().getDataSource(dataSourceConfiguration); - DataSource another = DataSourceRegistry.getInstance().getDataSource(anotherDataSourceConfiguration); - verify(dataSourceConfiguration).createDataSource(); - verify(anotherDataSourceConfiguration).createDataSource(); + when(dataSourceConfig.createDataSource()).then(invocation -> mock(DataSource.class)); + DataSourceConfiguration anotherDataSourceConfig = mock(DataSourceConfiguration.class); + when(anotherDataSourceConfig.createDataSource()).then(invocation -> mock(DataSource.class)); + DataSource one = DataSourceRegistry.getInstance().getDataSource(dataSourceConfig); + DataSource another = DataSourceRegistry.getInstance().getDataSource(anotherDataSourceConfig); + verify(dataSourceConfig).createDataSource(); + verify(anotherDataSourceConfig).createDataSource(); assertThat(another, not(one)); } } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java index 0c467b6a5c..aadde04a23 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; import com.zaxxer.hikari.HikariDataSource; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.exception.TracingStorageUnavailableException; import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter; import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverterFactory; @@ -57,8 +56,7 @@ void assertConvert() throws SQLException { when(connection.getMetaData()).thenReturn(databaseMetaData); when(databaseMetaData.getURL()).thenReturn("jdbc:url"); DataSourceTracingStorageConverter converter = new DataSourceTracingStorageConverter(); - TracingStorageConfiguration configuration = converter.convertObjectToConfiguration(dataSource); - assertNotNull(configuration); + assertNotNull(converter.convertObjectToConfiguration(dataSource)); } @Test diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java index 9b0545cf06..06ccb4aa55 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java @@ -32,10 +32,10 @@ class YamlDataSourceConfigurationConverterTest { @Test void assertConvertDataSourceConfiguration() { - DataSourceConfiguration dataSourceConfiguration = new DataSourceConfiguration("org.h2.Driver"); - dataSourceConfiguration.getProps().put("foo", "bar"); + DataSourceConfiguration dataSourceConfig = new DataSourceConfiguration("org.h2.Driver"); + dataSourceConfig.getProps().put("foo", "bar"); YamlDataSourceConfigurationConverter converter = new YamlDataSourceConfigurationConverter(); - YamlTracingStorageConfiguration actual = converter.convertToYamlConfiguration(dataSourceConfiguration); + YamlTracingStorageConfiguration actual = converter.convertToYamlConfiguration(dataSourceConfig); assertTrue(actual instanceof YamlDataSourceConfiguration); YamlDataSourceConfiguration result = (YamlDataSourceConfiguration) actual; assertThat(result.getDataSourceClassName(), is("org.h2.Driver")); diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java index 4d3fa13c96..6b9dd2cef9 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java @@ -104,35 +104,35 @@ public JobConfiguration toJobConfiguration() { /** * Convert from job configuration. * - * @param jobConfiguration job configuration + * @param jobConfig job configuration * @return job configuration POJO */ @SuppressWarnings("unchecked") - public static JobConfigurationPOJO fromJobConfiguration(final JobConfiguration jobConfiguration) { + public static JobConfigurationPOJO fromJobConfiguration(final JobConfiguration jobConfig) { JobConfigurationPOJO result = new JobConfigurationPOJO(); - result.setJobName(jobConfiguration.getJobName()); - result.setCron(jobConfiguration.getCron()); - result.setTimeZone(jobConfiguration.getTimeZone()); - result.setShardingTotalCount(jobConfiguration.getShardingTotalCount()); - result.setShardingItemParameters(jobConfiguration.getShardingItemParameters()); - result.setJobParameter(jobConfiguration.getJobParameter()); - result.setMonitorExecution(jobConfiguration.isMonitorExecution()); - result.setFailover(jobConfiguration.isFailover()); - result.setMisfire(jobConfiguration.isMisfire()); - result.setMaxTimeDiffSeconds(jobConfiguration.getMaxTimeDiffSeconds()); - result.setReconcileIntervalMinutes(jobConfiguration.getReconcileIntervalMinutes()); - result.setJobShardingStrategyType(jobConfiguration.getJobShardingStrategyType()); - result.setJobExecutorServiceHandlerType(jobConfiguration.getJobExecutorServiceHandlerType()); - result.setJobErrorHandlerType(jobConfiguration.getJobErrorHandlerType()); - result.setJobListenerTypes(jobConfiguration.getJobListenerTypes()); - jobConfiguration.getExtraConfigurations().stream() + result.setJobName(jobConfig.getJobName()); + result.setCron(jobConfig.getCron()); + result.setTimeZone(jobConfig.getTimeZone()); + result.setShardingTotalCount(jobConfig.getShardingTotalCount()); + result.setShardingItemParameters(jobConfig.getShardingItemParameters()); + result.setJobParameter(jobConfig.getJobParameter()); + result.setMonitorExecution(jobConfig.isMonitorExecution()); + result.setFailover(jobConfig.isFailover()); + result.setMisfire(jobConfig.isMisfire()); + result.setMaxTimeDiffSeconds(jobConfig.getMaxTimeDiffSeconds()); + result.setReconcileIntervalMinutes(jobConfig.getReconcileIntervalMinutes()); + result.setJobShardingStrategyType(jobConfig.getJobShardingStrategyType()); + result.setJobExecutorServiceHandlerType(jobConfig.getJobExecutorServiceHandlerType()); + result.setJobErrorHandlerType(jobConfig.getJobErrorHandlerType()); + result.setJobListenerTypes(jobConfig.getJobListenerTypes()); + jobConfig.getExtraConfigurations().stream() .map(each -> TypedSPILoader.getService(YamlConfigurationConverter.class, each.getClass()).convertToYamlConfiguration(each)).forEach(result.getJobExtraConfigurations()::add); - result.setDescription(jobConfiguration.getDescription()); - result.setProps(jobConfiguration.getProps()); - result.setDisabled(jobConfiguration.isDisabled()); - result.setOverwrite(jobConfiguration.isOverwrite()); - result.setLabel(jobConfiguration.getLabel()); - result.setStaticSharding(jobConfiguration.isStaticSharding()); + result.setDescription(jobConfig.getDescription()); + result.setProps(jobConfig.getProps()); + result.setDisabled(jobConfig.isDisabled()); + result.setOverwrite(jobConfig.isOverwrite()); + result.setLabel(jobConfig.getLabel()); + result.setStaticSharding(jobConfig.isStaticSharding()); return result; } } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java index 87022c38f1..6414aef99f 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java @@ -104,14 +104,14 @@ void assertToJobConfiguration() { @Test void assertFromJobConfiguration() { - JobConfiguration jobConfiguration = JobConfiguration.newBuilder("test_job", 3) + JobConfiguration jobConfig = JobConfiguration.newBuilder("test_job", 3) .cron("0/1 * * * * ?") .shardingItemParameters("0=A,1=B,2=C").jobParameter("param") .monitorExecution(true).failover(true).misfire(true) .jobShardingStrategyType("AVG_ALLOCATION").jobExecutorServiceHandlerType("CPU").jobErrorHandlerType("IGNORE") .jobListenerTypes("LOG").description("Job description").setProperty("key", "value") .disabled(true).overwrite(true).build(); - JobConfigurationPOJO actual = JobConfigurationPOJO.fromJobConfiguration(jobConfiguration); + JobConfigurationPOJO actual = JobConfigurationPOJO.fromJobConfiguration(jobConfig); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); assertThat(actual.getShardingTotalCount(), is(3)); diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java index 66a088323e..616e55e2ff 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java @@ -19,7 +19,6 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; -import java.util.Optional; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -27,15 +26,18 @@ import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import java.util.Optional; + /** * Job Builder from @ElasticJobConfiguration. */ public final class JobAnnotationBuilder { /** - * generate JobConfiguration from @ElasticJobConfiguration. + * Generate job configuration from @ElasticJobConfiguration. + * * @param type The job of @ElasticJobConfiguration annotation class - * @return JobConfiguration + * @return job configuration */ public static JobConfiguration generateJobConfiguration(final Class type) { ElasticJobConfiguration annotation = type.getAnnotation(ElasticJobConfiguration.class); @@ -60,8 +62,8 @@ public static JobConfiguration generateJobConfiguration(final Class type) { .overwrite(annotation.overwrite()); for (Class clazz : annotation.extraConfigurations()) { try { - Optional jobExtraConfiguration = clazz.newInstance().getJobExtraConfiguration(); - jobExtraConfiguration.ifPresent(jobConfigurationBuilder::addExtraConfigurations); + Optional jobExtraConfig = clazz.newInstance().getJobExtraConfiguration(); + jobExtraConfig.ifPresent(jobConfigurationBuilder::addExtraConfigurations); } catch (IllegalAccessException | InstantiationException exception) { throw (JobConfigurationException) new JobConfigurationException("new JobExtraConfigurationFactory instance by class '%s' failure", clazz).initCause(exception); } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java index 897160d634..15546143e0 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java @@ -53,11 +53,11 @@ class CronSettingAndJobEventChangedJobListener implements DataChangedEventListen @Override public void onChange(final DataChangedEvent event) { if (configNode.isConfigPath(event.getKey()) && Type.UPDATED == event.getType() && !JobRegistry.getInstance().isShutdown(jobName)) { - JobConfiguration jobConfiguration = YamlEngine.unmarshal(event.getValue(), JobConfigurationPOJO.class).toJobConfiguration(); - if (StringUtils.isEmpty(jobConfiguration.getCron())) { + JobConfiguration jobConfig = YamlEngine.unmarshal(event.getValue(), JobConfigurationPOJO.class).toJobConfiguration(); + if (StringUtils.isEmpty(jobConfig.getCron())) { JobRegistry.getInstance().getJobScheduleController(jobName).rescheduleJob(); } else { - JobRegistry.getInstance().getJobScheduleController(jobName).rescheduleJob(jobConfiguration.getCron(), jobConfiguration.getTimeZone()); + JobRegistry.getInstance().getJobScheduleController(jobName).rescheduleJob(jobConfig.getCron(), jobConfig.getTimeZone()); } } } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java index 39d85cfa17..d633371551 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java @@ -56,13 +56,13 @@ public ExecutionService(final CoordinatorRegistryCenter regCenter, final String */ public void registerJobBegin(final ShardingContexts shardingContexts) { JobRegistry.getInstance().setJobRunning(jobName, true); - JobConfiguration jobConfiguration = configService.load(true); - if (!jobConfiguration.isMonitorExecution()) { + JobConfiguration jobConfig = configService.load(true); + if (!jobConfig.isMonitorExecution()) { return; } String jobInstanceId = JobRegistry.getInstance().getJobInstance(jobName).getJobInstanceId(); for (int each : shardingContexts.getShardingItemParameters().keySet()) { - if (jobConfiguration.isFailover()) { + if (jobConfig.isFailover()) { jobNodeStorage.fillJobNode(ShardingNode.getRunningNode(each), jobInstanceId); } else { jobNodeStorage.fillEphemeralJobNode(ShardingNode.getRunningNode(each), jobInstanceId); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java index 0582b14b61..579cde4749 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java @@ -31,24 +31,24 @@ class JobAnnotationBuilderTest { @Test void assertGenerateJobConfiguration() { - JobConfiguration jobConfiguration = JobAnnotationBuilder.generateJobConfiguration(AnnotationSimpleJob.class); - assertThat(jobConfiguration.getJobName(), is("AnnotationSimpleJob")); - assertThat(jobConfiguration.getShardingTotalCount(), is(3)); - assertThat(jobConfiguration.getShardingItemParameters(), is("0=a,1=b,2=c")); - assertThat(jobConfiguration.getCron(), is("*/10 * * * * ?")); - assertTrue(jobConfiguration.isMonitorExecution()); - assertFalse(jobConfiguration.isFailover()); - assertTrue(jobConfiguration.isMisfire()); - assertThat(jobConfiguration.getMaxTimeDiffSeconds(), is(-1)); - assertThat(jobConfiguration.getReconcileIntervalMinutes(), is(10)); - assertNull(jobConfiguration.getJobShardingStrategyType()); - assertNull(jobConfiguration.getJobExecutorServiceHandlerType()); - assertNull(jobConfiguration.getJobErrorHandlerType()); - assertThat(jobConfiguration.getDescription(), is("desc")); - assertThat(jobConfiguration.getProps().getProperty("print.title"), is("test title")); - assertThat(jobConfiguration.getProps().getProperty("print.content"), is("test content")); - assertFalse(jobConfiguration.isDisabled()); - assertFalse(jobConfiguration.isOverwrite()); + JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(AnnotationSimpleJob.class); + assertThat(jobConfig.getJobName(), is("AnnotationSimpleJob")); + assertThat(jobConfig.getShardingTotalCount(), is(3)); + assertThat(jobConfig.getShardingItemParameters(), is("0=a,1=b,2=c")); + assertThat(jobConfig.getCron(), is("*/10 * * * * ?")); + assertTrue(jobConfig.isMonitorExecution()); + assertFalse(jobConfig.isFailover()); + assertTrue(jobConfig.isMisfire()); + assertThat(jobConfig.getMaxTimeDiffSeconds(), is(-1)); + assertThat(jobConfig.getReconcileIntervalMinutes(), is(10)); + assertNull(jobConfig.getJobShardingStrategyType()); + assertNull(jobConfig.getJobExecutorServiceHandlerType()); + assertNull(jobConfig.getJobErrorHandlerType()); + assertThat(jobConfig.getDescription(), is("desc")); + assertThat(jobConfig.getProps().getProperty("print.title"), is("test title")); + assertThat(jobConfig.getProps().getProperty("print.content"), is("test content")); + assertFalse(jobConfig.isDisabled()); + assertFalse(jobConfig.isOverwrite()); } } diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java index 0425f48738..7b9b7cd4e5 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java @@ -25,7 +25,7 @@ public interface JobConfigurationAPI { /** - * get job configuration. + * Get job configuration. * * @param jobName job name * @return job configuration diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java index 93793787de..1811c573eb 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java @@ -94,49 +94,49 @@ private void assertJobConfig(final JobConfigurationPOJO pojo) { @Test void assertUpdateJobConfig() { - JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); - jobConfiguration.setJobName("test_job"); - jobConfiguration.setCron("0/1 * * * * ?"); - jobConfiguration.setShardingTotalCount(3); - jobConfiguration.setJobParameter("param"); - jobConfiguration.setMonitorExecution(true); - jobConfiguration.setFailover(false); - jobConfiguration.setMisfire(true); - jobConfiguration.setMaxTimeDiffSeconds(-1); - jobConfiguration.setReconcileIntervalMinutes(10); - jobConfiguration.setDescription(""); - jobConfiguration.getProps().setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, "true"); - jobConfigAPI.updateJobConfiguration(jobConfiguration); + JobConfigurationPOJO jobConfig = new JobConfigurationPOJO(); + jobConfig.setJobName("test_job"); + jobConfig.setCron("0/1 * * * * ?"); + jobConfig.setShardingTotalCount(3); + jobConfig.setJobParameter("param"); + jobConfig.setMonitorExecution(true); + jobConfig.setFailover(false); + jobConfig.setMisfire(true); + jobConfig.setMaxTimeDiffSeconds(-1); + jobConfig.setReconcileIntervalMinutes(10); + jobConfig.setDescription(""); + jobConfig.getProps().setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, "true"); + jobConfigAPI.updateJobConfiguration(jobConfig); verify(regCenter).update("/test_job/config", LifecycleYamlConstants.getDataflowJobYaml()); } @Test void assertUpdateJobConfigIfJobNameIsEmpty() { assertThrows(IllegalArgumentException.class, () -> { - JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); - jobConfiguration.setJobName(""); - jobConfigAPI.updateJobConfiguration(jobConfiguration); + JobConfigurationPOJO jobConfig = new JobConfigurationPOJO(); + jobConfig.setJobName(""); + jobConfigAPI.updateJobConfiguration(jobConfig); }); } @Test void assertUpdateJobConfigIfCronIsEmpty() { assertThrows(IllegalArgumentException.class, () -> { - JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); - jobConfiguration.setJobName("test_job"); - jobConfiguration.setCron(""); - jobConfigAPI.updateJobConfiguration(jobConfiguration); + JobConfigurationPOJO jobConfig = new JobConfigurationPOJO(); + jobConfig.setJobName("test_job"); + jobConfig.setCron(""); + jobConfigAPI.updateJobConfiguration(jobConfig); }); } @Test void assertUpdateJobConfigIfShardingTotalCountLessThanOne() { assertThrows(IllegalArgumentException.class, () -> { - JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); - jobConfiguration.setJobName("test_job"); - jobConfiguration.setCron("0/1 * * * * ?"); - jobConfiguration.setShardingTotalCount(0); - jobConfigAPI.updateJobConfiguration(jobConfiguration); + JobConfigurationPOJO jobConfig = new JobConfigurationPOJO(); + jobConfig.setJobName("test_job"); + jobConfig.setCron("0/1 * * * * ?"); + jobConfig.setShardingTotalCount(0); + jobConfigAPI.updateJobConfiguration(jobConfig); }); } diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java index 16f5206763..dfba296ad6 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java @@ -32,13 +32,13 @@ /** * Implemented {@link RestfulService} via Netty. */ -@Slf4j @RequiredArgsConstructor +@Slf4j public final class NettyRestfulService implements RestfulService { private static final int DEFAULT_WORKER_GROUP_THREADS = 1 + 2 * NettyRuntime.availableProcessors(); - private final NettyRestfulServiceConfiguration configuration; + private final NettyRestfulServiceConfiguration config; private ServerBootstrap serverBootstrap; @@ -52,7 +52,7 @@ private void initServerBootstrap() { serverBootstrap = new ServerBootstrap() .group(bossEventLoopGroup, workerEventLoopGroup) .channel(NioServerSocketChannel.class) - .childHandler(new RestfulServiceChannelInitializer(configuration)); + .childHandler(new RestfulServiceChannelInitializer(config)); } @SneakyThrows @@ -60,14 +60,14 @@ private void initServerBootstrap() { public void startup() { initServerBootstrap(); ChannelFuture channelFuture; - if (!Strings.isNullOrEmpty(configuration.getHost())) { - channelFuture = serverBootstrap.bind(configuration.getHost(), configuration.getPort()); + if (!Strings.isNullOrEmpty(config.getHost())) { + channelFuture = serverBootstrap.bind(config.getHost(), config.getPort()); } else { - channelFuture = serverBootstrap.bind(configuration.getPort()); + channelFuture = serverBootstrap.bind(config.getPort()); } channelFuture.addListener(future -> { if (future.isSuccess()) { - log.info("Restful Service started on port {}.", configuration.getPort()); + log.info("Restful Service started on port {}.", config.getPort()); } else { log.error("Failed to start Restful Service.", future.cause()); } diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java index 06070c5c83..42605f7429 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/pipeline/RestfulServiceChannelInitializer.java @@ -41,13 +41,13 @@ public final class RestfulServiceChannelInitializer extends ChannelInitializer { - NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); - configuration.setHost(HOST); - configuration.addControllerInstances(new TrailingSlashTestController()); - RestfulService restfulService = new NettyRestfulService(configuration); + NettyRestfulServiceConfiguration config = new NettyRestfulServiceConfiguration(PORT); + config.setHost(HOST); + config.addControllerInstances(new TrailingSlashTestController()); + RestfulService restfulService = new NettyRestfulService(config); restfulService.startup(); }); } diff --git a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java index 46dd288d2f..010c474280 100644 --- a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java +++ b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTrailingSlashSensitiveTest.java @@ -48,11 +48,11 @@ class NettyRestfulServiceTrailingSlashSensitiveTest { @BeforeAll static void init() { - NettyRestfulServiceConfiguration configuration = new NettyRestfulServiceConfiguration(PORT); - configuration.setHost(HOST); - configuration.setTrailingSlashSensitive(true); - configuration.addControllerInstances(new TrailingSlashTestController()); - restfulService = new NettyRestfulService(configuration); + NettyRestfulServiceConfiguration config = new NettyRestfulServiceConfiguration(PORT); + config.setHost(HOST); + config.setTrailingSlashSensitive(true); + config.addControllerInstances(new TrailingSlashTestController()); + restfulService = new NettyRestfulService(config); restfulService.startup(); } diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index a8d157f0e6..d2207be510 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -38,7 +38,7 @@ import java.util.Map; /** - * JobBootstrap configuration. + * Job bootstrap configuration. */ @Slf4j public class ElasticJobBootstrapConfiguration implements SmartInitializingSingleton, ApplicationContextAware { diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java index 435ca0e574..6e6b0ae4bf 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/reg/parser/ZookeeperBeanDefinitionParser.java @@ -42,16 +42,16 @@ protected AbstractBeanDefinition parseInternal(final Element element, final Pars } private AbstractBeanDefinition buildZookeeperConfigurationBeanDefinition(final Element element) { - BeanDefinitionBuilder configuration = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperConfiguration.class); - configuration.addConstructorArgValue(element.getAttribute(ZookeeperBeanDefinitionTag.SERVER_LISTS_ATTRIBUTE)); - configuration.addConstructorArgValue(element.getAttribute(ZookeeperBeanDefinitionTag.NAMESPACE_ATTRIBUTE)); - addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.BASE_SLEEP_TIME_MILLISECONDS_ATTRIBUTE, "baseSleepTimeMilliseconds", element, configuration); - addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.MAX_SLEEP_TIME_MILLISECONDS_ATTRIBUTE, "maxSleepTimeMilliseconds", element, configuration); - addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.MAX_RETRIES_ATTRIBUTE, "maxRetries", element, configuration); - addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.SESSION_TIMEOUT_MILLISECONDS_ATTRIBUTE, "sessionTimeoutMilliseconds", element, configuration); - addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.CONNECTION_TIMEOUT_MILLISECONDS_ATTRIBUTE, "connectionTimeoutMilliseconds", element, configuration); - addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.DIGEST_ATTRIBUTE, "digest", element, configuration); - return configuration.getBeanDefinition(); + BeanDefinitionBuilder config = BeanDefinitionBuilder.rootBeanDefinition(ZookeeperConfiguration.class); + config.addConstructorArgValue(element.getAttribute(ZookeeperBeanDefinitionTag.SERVER_LISTS_ATTRIBUTE)); + config.addConstructorArgValue(element.getAttribute(ZookeeperBeanDefinitionTag.NAMESPACE_ATTRIBUTE)); + addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.BASE_SLEEP_TIME_MILLISECONDS_ATTRIBUTE, "baseSleepTimeMilliseconds", element, config); + addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.MAX_SLEEP_TIME_MILLISECONDS_ATTRIBUTE, "maxSleepTimeMilliseconds", element, config); + addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.MAX_RETRIES_ATTRIBUTE, "maxRetries", element, config); + addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.SESSION_TIMEOUT_MILLISECONDS_ATTRIBUTE, "sessionTimeoutMilliseconds", element, config); + addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.CONNECTION_TIMEOUT_MILLISECONDS_ATTRIBUTE, "connectionTimeoutMilliseconds", element, config); + addPropertyValueIfNotEmpty(ZookeeperBeanDefinitionTag.DIGEST_ATTRIBUTE, "digest", element, config); + return config.getBeanDefinition(); } private void addPropertyValueIfNotEmpty(final String attributeName, final String propertyName, final Element element, final BeanDefinitionBuilder factory) { From aa4bd31a0288ff0dc6fb1b746c17bb29cc0c86c0 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Wed, 25 Oct 2023 11:24:32 +0800 Subject: [PATCH 088/178] Simplify variable name from configuration to config --- .../tracing/yaml/YamlTracingConfigurationConverterTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java index 3398e210d0..afb26ba851 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -30,7 +30,8 @@ class YamlTracingConfigurationConverterTest { @Test void assertConvertTracingConfiguration() { - JobEventCaller expectedStorage = () -> { }; + JobEventCaller expectedStorage = () -> { + }; TracingConfiguration tracingConfig = new TracingConfiguration<>("TEST", expectedStorage); YamlTracingConfigurationConverter converter = new YamlTracingConfigurationConverter<>(); YamlTracingConfiguration actual = converter.convertToYamlConfiguration(tracingConfig); From fbc066ec3e135088ea704b88440ded6b69510fbb Mon Sep 17 00:00:00 2001 From: zhangliang Date: Wed, 25 Oct 2023 21:34:54 +0800 Subject: [PATCH 089/178] Move BlockUtils to kernel module --- .../executor/context/ExecutorContext.java | 3 --- kernel/pom.xml | 6 +----- ...bstractDistributeOnceElasticJobListener.java | 2 +- .../kernel/internal/election/LeaderService.java | 2 +- .../kernel/internal/server/ServerService.java | 2 +- .../internal/sharding/ShardingService.java | 2 +- .../kernel/internal/util}/BlockUtils.java | 17 +++++------------ 7 files changed, 10 insertions(+), 24 deletions(-) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util}/BlockUtils.java (77%) diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java index b43c77a678..858ff744e5 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java @@ -27,9 +27,6 @@ /** * Executor context. - * - * @see org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerReloadable - * @see org.apache.shardingsphere.elasticjob.infra.concurrent.ExecutorServiceReloadable */ public final class ExecutorContext { diff --git a/kernel/pom.xml b/kernel/pom.xml index 1bf670c004..3c9238bc99 100644 --- a/kernel/pom.xml +++ b/kernel/pom.xml @@ -37,11 +37,7 @@ elasticjob-infra ${project.parent.version} - - org.apache.shardingsphere.elasticjob - elasticjob-registry-center-api - ${project.parent.version} - + org.apache.shardingsphere.elasticjob elasticjob-registry-center-zookeeper-curator diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java index 8a5970491d..33477e7127 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; import org.apache.shardingsphere.elasticjob.infra.env.TimeService; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java index 628d99cbf6..ed94156856 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; /** * Leader service. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java index 9aba51c8f6..1a16d34346 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import org.apache.commons.lang3.StringUtils; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java index ca46e01522..789f86dfa5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java @@ -19,7 +19,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.concurrent.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/BlockUtils.java similarity index 77% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/BlockUtils.java index 25f3139b2d..43c01e2090 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/BlockUtils.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/BlockUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.concurrent; +package org.apache.shardingsphere.elasticjob.kernel.internal.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -26,21 +26,14 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class BlockUtils { - /** - * Wait short time. - */ - public static void waitingShortTime() { - sleep(100L); - } + private static final long SLEEP_INTERVAL_MILLIS = 100L; /** - * Sleep for the specified number of milliseconds. - * - * @param millis the duration of sleep in milliseconds + * Waiting short time. */ - public static void sleep(final long millis) { + public static void waitingShortTime() { try { - Thread.sleep(millis); + Thread.sleep(SLEEP_INTERVAL_MILLIS); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); } From 1203a8c018a0c9b059224062c81e8ca839f187f7 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Wed, 25 Oct 2023 23:20:02 +0800 Subject: [PATCH 090/178] Rename jobExecutorServiceHandlerType to jobExecutorThreadPoolSizeProviderType (#2313) * Refactor JobExecutorServiceHandler to JobExecutorThreadPoolSizeProvider * Refactor jobExecutorServiceHandlerType to jobExecutorThreadPoolSizeProviderType * Refactor ExecutorServiceReloadable --- .../annotation/ElasticJobConfiguration.java | 6 +- .../elasticjob/api/JobConfiguration.java | 14 ++--- .../elasticjob/api/JobConfigurationTest.java | 6 +- docs/content/dev-manual/thread-pool.cn.md | 14 ++--- docs/content/dev-manual/thread-pool.en.md | 14 ++--- .../user-manual/configuration/_index.cn.md | 42 ++++++------- .../user-manual/configuration/_index.en.md | 42 ++++++------- .../user-manual/configuration/java-api.cn.md | 62 +++++++++---------- .../user-manual/configuration/java-api.en.md | 44 ++++++------- .../concurrent/ExecutorServiceReloadable.java | 22 ++++--- .../ElasticJobExecutorService.java | 2 +- ...=> JobExecutorThreadPoolSizeProvider.java} | 17 +++-- .../AbstractJobExecutorServiceHandler.java | 36 ----------- ...ageJobExecutorThreadPoolSizeProvider.java} | 10 +-- ...eadJobExecutorThreadPoolSizeProvider.java} | 10 +-- .../infra/pojo/JobConfigurationPOJO.java | 6 +- ...eadpool.JobExecutorThreadPoolSizeProvider} | 4 +- .../ElasticJobExecutorServiceTest.java | 1 + .../ExecutorServiceReloadableTest.java | 12 +--- ...obExecutorThreadPoolSizeProviderTest.java} | 10 +-- ...obExecutorThreadPoolSizeProviderTest.java} | 10 +-- .../infra/pojo/JobConfigurationPOJOTest.java | 16 ++--- .../annotation/JobAnnotationBuilder.java | 2 +- .../annotation/JobAnnotationBuilderTest.java | 2 +- .../ElasticJobConfigurationProperties.java | 4 +- ...ElasticJobConfigurationPropertiesTest.java | 4 +- 26 files changed, 188 insertions(+), 224 deletions(-) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{concurrent => handler/threadpool}/ElasticJobExecutorService.java (97%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/{JobExecutorServiceHandler.java => JobExecutorThreadPoolSizeProvider.java} (77%) delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/{impl/CPUUsageJobExecutorServiceHandler.java => type/CPUUsageJobExecutorThreadPoolSizeProvider.java} (77%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/{impl/SingleThreadJobExecutorServiceHandler.java => type/SingleThreadJobExecutorThreadPoolSizeProvider.java} (76%) rename infra/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler => org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider} (77%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/{impl/CPUUsageJobExecutorServiceHandlerTest.java => type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java} (78%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/{impl/SingleThreadJobExecutorServiceHandlerTest.java => type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java} (79%) diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java index 7526c8c38a..b9ddc32113 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/annotation/ElasticJobConfiguration.java @@ -125,11 +125,11 @@ String jobShardingStrategyType() default ""; /** - * Job thread pool handler type. + * Job executor thread pool size provider type. * - * @return job executor service handler type + * @return job executor thread pool size provider type */ - String jobExecutorServiceHandlerType() default ""; + String jobExecutorThreadPoolSizeProviderType() default ""; /** * Job thread pool handler type. diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java index 17e384bcd4..c48dee1e5f 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/api/JobConfiguration.java @@ -61,7 +61,7 @@ public final class JobConfiguration { private final String jobShardingStrategyType; - private final String jobExecutorServiceHandlerType; + private final String jobExecutorThreadPoolSizeProviderType; private final String jobErrorHandlerType; @@ -119,7 +119,7 @@ public static class Builder { private String jobShardingStrategyType; - private String jobExecutorServiceHandlerType; + private String jobExecutorThreadPoolSizeProviderType; private String jobErrorHandlerType; @@ -291,13 +291,13 @@ public Builder jobShardingStrategyType(final String jobShardingStrategyType) { } /** - * Set job executor service handler type. + * Set job executor thread pool size provider type. * - * @param jobExecutorServiceHandlerType job executor service handler type + * @param jobExecutorThreadPoolSizeProviderType job executor thread pool size provider type * @return job configuration builder */ - public Builder jobExecutorServiceHandlerType(final String jobExecutorServiceHandlerType) { - this.jobExecutorServiceHandlerType = jobExecutorServiceHandlerType; + public Builder jobExecutorThreadPoolSizeProviderType(final String jobExecutorThreadPoolSizeProviderType) { + this.jobExecutorThreadPoolSizeProviderType = jobExecutorThreadPoolSizeProviderType; return this; } @@ -421,7 +421,7 @@ public final JobConfiguration build() { Preconditions.checkArgument(shardingTotalCount > 0, "shardingTotalCount should larger than zero."); return new JobConfiguration(jobName, cron, timeZone, shardingTotalCount, shardingItemParameters, jobParameter, monitorExecution, failover, misfire, maxTimeDiffSeconds, reconcileIntervalMinutes, - jobShardingStrategyType, jobExecutorServiceHandlerType, jobErrorHandlerType, jobListenerTypes, + jobShardingStrategyType, jobExecutorThreadPoolSizeProviderType, jobErrorHandlerType, jobListenerTypes, extraConfigurations, description, props, disabled, overwrite, label, staticSharding); } } diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java index 6fda7ad19f..8e044086b2 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/api/JobConfigurationTest.java @@ -36,7 +36,7 @@ void assertBuildAllProperties() { .shardingItemParameters("0=a,1=b,2=c").jobParameter("param") .monitorExecution(false).failover(true).misfire(false) .maxTimeDiffSeconds(1000).reconcileIntervalMinutes(60) - .jobShardingStrategyType("AVG_ALLOCATION").jobExecutorServiceHandlerType("SINGLE_THREAD").jobErrorHandlerType("IGNORE") + .jobShardingStrategyType("AVG_ALLOCATION").jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").jobErrorHandlerType("IGNORE") .description("desc").setProperty("key", "value") .disabled(true).overwrite(true).build(); assertThat(actual.getJobName(), is("test_job")); @@ -51,7 +51,7 @@ void assertBuildAllProperties() { assertThat(actual.getMaxTimeDiffSeconds(), is(1000)); assertThat(actual.getReconcileIntervalMinutes(), is(60)); assertThat(actual.getJobShardingStrategyType(), is("AVG_ALLOCATION")); - assertThat(actual.getJobExecutorServiceHandlerType(), is("SINGLE_THREAD")); + assertThat(actual.getJobExecutorThreadPoolSizeProviderType(), is("SINGLE_THREAD")); assertThat(actual.getJobErrorHandlerType(), is("IGNORE")); assertThat(actual.getDescription(), is("desc")); assertThat(actual.getProps().getProperty("key"), is("value")); @@ -74,7 +74,7 @@ public void assertBuildRequiredProperties() { assertThat(actual.getMaxTimeDiffSeconds(), is(-1)); assertThat(actual.getReconcileIntervalMinutes(), is(10)); assertNull(actual.getJobShardingStrategyType()); - assertNull(actual.getJobExecutorServiceHandlerType()); + assertNull(actual.getJobExecutorThreadPoolSizeProviderType()); assertNull(actual.getJobErrorHandlerType()); assertThat(actual.getDescription(), is("")); assertTrue(actual.getProps().isEmpty()); diff --git a/docs/content/dev-manual/thread-pool.cn.md b/docs/content/dev-manual/thread-pool.cn.md index 136a978d3c..bf0fd0e873 100644 --- a/docs/content/dev-manual/thread-pool.cn.md +++ b/docs/content/dev-manual/thread-pool.cn.md @@ -6,11 +6,11 @@ weight = 2 线程池策略,用于执行作业的线程池创建。 -| *SPI 名称* | *详细说明* | -| ------------------------------------- | --------------------------------- | -| JobExecutorServiceHandler | 作业执行线程池策略 | +| *SPI 名称* | *详细说明* | +|-----------------------------------|--------------| +| JobExecutorThreadPoolSizeProvider | 作业执行线程数量提供策略 | -| *已知实现类* | *详细说明* | -| ------------------------------------- | --------------------------------- | -| CPUUsageJobExecutorServiceHandler | 根据 CPU 核数 * 2 创建作业处理线程池 | -| SingleThreadJobExecutorServiceHandler | 使用单线程处理作业 | +| *已知实现类* | *详细说明* | +|-----------------------------------------------|-------------------------| +| CPUUsageJobExecutorThreadPoolSizeProvider | 根据 CPU 核数 * 2 创建作业处理线程池 | +| SingleThreadJobExecutorThreadPoolSizeProvider | 使用单线程处理作业 | diff --git a/docs/content/dev-manual/thread-pool.en.md b/docs/content/dev-manual/thread-pool.en.md index dc53ba8e6e..4b1a3a05ab 100644 --- a/docs/content/dev-manual/thread-pool.en.md +++ b/docs/content/dev-manual/thread-pool.en.md @@ -6,11 +6,11 @@ weight = 2 Thread pool strategy, used to create thread pool for job execution. -| *SPI Name* | *Description* | -| ------------------------------------- | ------------------------------------------------------ | -| JobExecutorServiceHandler | Job executor service handler | +| *SPI Name* | *Description* | +|-----------------------------------|----------------------------------------| +| JobExecutorThreadPoolSizeProvider | Job executor thread pool size provider | -| *Implementation Class* | *Description* | -| ------------------------------------- | ------------------------------------------------------ | -| CPUUsageJobExecutorServiceHandler | Use CPU available processors * 2 to create thread pool | -| SingleThreadJobExecutorServiceHandler | Use single thread to execute job | +| *Implementation Class* | *Description* | +|-----------------------------------------------|--------------------------------------------------------| +| CPUUsageJobExecutorThreadPoolSizeProvider | Use CPU available processors * 2 to create thread pool | +| SingleThreadJobExecutorThreadPoolSizeProvider | Use single thread to execute job | diff --git a/docs/content/user-manual/configuration/_index.cn.md b/docs/content/user-manual/configuration/_index.cn.md index 9acd9fba71..19c1225ccf 100644 --- a/docs/content/user-manual/configuration/_index.cn.md +++ b/docs/content/user-manual/configuration/_index.cn.md @@ -37,26 +37,26 @@ ElasticJob 提供了 3 种配置方式,用于不同的使用场景。 ### 可配置属性 -| 属性名 | 类型 | 缺省值 | 描述 | -|-------------------------------|:-----------|:---------------|:---------------------| -| jobName | String | | 作业名称 | -| shardingTotalCount | int | | 作业分片总数 | -| cron | String | | CRON 表达式,用于控制作业触发时间 | -| timeZone | String | | CRON 的时区设置 | -| shardingItemParameters | String | | 个性化分片参数 | -| jobParameter | String | | 作业自定义参数 | -| monitorExecution | boolean | true | 监控作业运行时状态 | -| failover | boolean | false | 是否开启任务执行失效转移 | -| misfire | boolean | true | 是否开启错过任务重新执行 | -| maxTimeDiffSeconds | int | -1(不检查) | 最大允许的本机与注册中心的时间误差秒数 | -| reconcileIntervalMinutes | int | 10 | 修复作业服务器不一致状态服务调度间隔分钟 | -| jobShardingStrategyType | String | AVG_ALLOCATION | 作业分片策略类型 | -| jobExecutorServiceHandlerType | String | CPU | 作业线程池处理策略 | -| jobErrorHandlerType | String | | 作业错误处理策略 | -| description | String | | 作业描述信息 | -| props | Properties | | 作业属性配置信息 | -| disabled | boolean | false | 作业是否禁止启动 | -| overwrite | boolean | false | 本地配置是否可覆盖注册中心配置 | +| 属性名 | 类型 | 缺省值 | 描述 | +|-----------------------------------|:-----------|:---------------|:---------------------| +| jobName | String | | 作业名称 | +| shardingTotalCount | int | | 作业分片总数 | +| cron | String | | CRON 表达式,用于控制作业触发时间 | +| timeZone | String | | CRON 的时区设置 | +| shardingItemParameters | String | | 个性化分片参数 | +| jobParameter | String | | 作业自定义参数 | +| monitorExecution | boolean | true | 监控作业运行时状态 | +| failover | boolean | false | 是否开启任务执行失效转移 | +| misfire | boolean | true | 是否开启错过任务重新执行 | +| maxTimeDiffSeconds | int | -1(不检查) | 最大允许的本机与注册中心的时间误差秒数 | +| reconcileIntervalMinutes | int | 10 | 修复作业服务器不一致状态服务调度间隔分钟 | +| jobShardingStrategyType | String | AVG_ALLOCATION | 作业分片策略类型 | +| jobExecutorThreadPoolSizeProvider | String | CPU | 作业线程池处理策略 | +| jobErrorHandlerType | String | | 作业错误处理策略 | +| description | String | | 作业描述信息 | +| props | Properties | | 作业属性配置信息 | +| disabled | boolean | false | 作业是否禁止启动 | +| overwrite | boolean | false | 本地配置是否可覆盖注册中心配置 | ### 核心配置项说明 @@ -92,7 +92,7 @@ ElasticJob 提供了 3 种配置方式,用于不同的使用场景。 详情请参见[内置分片策略列表](/cn/user-manual/elasticjob/configuration/built-in-strategy/sharding)。 -**jobExecutorServiceHandlerType:** +**jobExecutorThreadPoolSizeProviderType:** 详情请参见[内置线程池策略列表](/cn/user-manual/elasticjob/configuration/built-in-strategy/thread-pool)。 diff --git a/docs/content/user-manual/configuration/_index.en.md b/docs/content/user-manual/configuration/_index.en.md index c437e417ac..8ea1858e06 100644 --- a/docs/content/user-manual/configuration/_index.en.md +++ b/docs/content/user-manual/configuration/_index.en.md @@ -36,26 +36,26 @@ Include IP and port, multiple addresses are separated by commas, such as: `host1 ### Configuration -| Name | Data Type | Default Value | Description | -|-------------------------------|:-----------|:---------------|:------------------------------------------------------------------------------------| -| jobName | String | | Job name | -| shardingTotalCount | int | | Sharding total count | -| cron | String | | CRON expression, control the job trigger time | -| timeZone | String | | time zone of CRON | -| shardingItemParameters | String | | Sharding item parameters | -| jobParameter | String | | Job parameter | -| monitorExecution | boolean | true | Monitor job execution status | -| failover | boolean | false | Enable or disable job failover | -| misfire | boolean | true | Enable or disable the missed task to re-execute | -| maxTimeDiffSeconds | int | -1(no check) | The maximum value for time difference between server and registry center in seconds | -| reconcileIntervalMinutes | int | 10 | Service scheduling interval in minutes for repairing job server inconsistent state | -| jobShardingStrategyType | String | AVG_ALLOCATION | Job sharding strategy type | -| jobExecutorServiceHandlerType | String | CPU | Job thread pool handler type | -| jobErrorHandlerType | String | | Job error handler type | -| description | String | | Job description | -| props | Properties | | Job properties | -| disabled | boolean | false | Enable or disable start the job | -| overwrite | boolean | false | Enable or disable local configuration override registry center configuration | +| Name | Data Type | Default Value | Description | +|-----------------------------------|:-----------|:---------------|:------------------------------------------------------------------------------------| +| jobName | String | | Job name | +| shardingTotalCount | int | | Sharding total count | +| cron | String | | CRON expression, control the job trigger time | +| timeZone | String | | time zone of CRON | +| shardingItemParameters | String | | Sharding item parameters | +| jobParameter | String | | Job parameter | +| monitorExecution | boolean | true | Monitor job execution status | +| failover | boolean | false | Enable or disable job failover | +| misfire | boolean | true | Enable or disable the missed task to re-execute | +| maxTimeDiffSeconds | int | -1(no check) | The maximum value for time difference between server and registry center in seconds | +| reconcileIntervalMinutes | int | 10 | Service scheduling interval in minutes for repairing job server inconsistent state | +| jobShardingStrategyType | String | AVG_ALLOCATION | Job sharding strategy type | +| jobExecutorThreadPoolSizeProvider | String | CPU | Job thread pool handler type | +| jobErrorHandlerType | String | | Job error handler type | +| description | String | | Job description | +| props | Properties | | Job properties | +| disabled | boolean | false | Enable or disable start the job | +| overwrite | boolean | false | Enable or disable local configuration override registry center configuration | ### Core Configuration Description @@ -91,7 +91,7 @@ Less than `1` means no repair is performed. For details, see[Job Sharding Strategy](/en/user-manual/elasticjob/configuration/built-in-strategy/sharding)。 -**jobExecutorServiceHandlerType:** +**jobExecutorThreadPoolSizeProviderType:** For details, see[Thread Pool Strategy](/en/user-manual/elasticjob/configuration/built-in-strategy/thread-pool)。 diff --git a/docs/content/user-manual/configuration/java-api.cn.md b/docs/content/user-manual/configuration/java-api.cn.md index 02c3d2b5f1..9431341a78 100644 --- a/docs/content/user-manual/configuration/java-api.cn.md +++ b/docs/content/user-manual/configuration/java-api.cn.md @@ -12,16 +12,16 @@ chapter = true 可配置属性: -| 属性名 | 构造器注入 | -| ----------------------------- |:--------- | -| serverLists | 是 | -| namespace | 是 | -| baseSleepTimeMilliseconds | 否 | -| maxSleepTimeMilliseconds | 否 | -| maxRetries | 否 | -| sessionTimeoutMilliseconds | 否 | -| connectionTimeoutMilliseconds | 否 | -| digest | 否 | +| 属性名 | 构造器注入 | +|-------------------------------|:------| +| serverLists | 是 | +| namespace | 是 | +| baseSleepTimeMilliseconds | 否 | +| maxSleepTimeMilliseconds | 否 | +| maxRetries | 否 | +| sessionTimeoutMilliseconds | 否 | +| connectionTimeoutMilliseconds | 否 | +| digest | 否 | ## 作业配置 @@ -29,24 +29,24 @@ chapter = true 可配置属性: -| 属性名 | 构造器注入 | -| ----------------------------- |:--------- | -| jobName | 是 | -| shardingTotalCount | 是 | -| cron | 否 | -| timeZone | 否 | -| shardingItemParameters | 否 | -| jobParameter | 否 | -| monitorExecution | 否 | -| failover | 否 | -| misfire | 否 | -| maxTimeDiffSeconds | 否 | -| reconcileIntervalMinutes | 否 | -| jobShardingStrategyType | 否 | -| jobExecutorServiceHandlerType | 否 | -| jobErrorHandlerType | 否 | -| jobListenerTypes | 否 | -| description | 否 | -| props | 否 | -| disabled | 否 | -| overwrite | 否 | +| 属性名 | 构造器注入 | +|-----------------------------------|:------| +| jobName | 是 | +| shardingTotalCount | 是 | +| cron | 否 | +| timeZone | 否 | +| shardingItemParameters | 否 | +| jobParameter | 否 | +| monitorExecution | 否 | +| failover | 否 | +| misfire | 否 | +| maxTimeDiffSeconds | 否 | +| reconcileIntervalMinutes | 否 | +| jobShardingStrategyType | 否 | +| jobExecutorThreadPoolSizeProvider | 否 | +| jobErrorHandlerType | 否 | +| jobListenerTypes | 否 | +| description | 否 | +| props | 否 | +| disabled | 否 | +| overwrite | 否 | diff --git a/docs/content/user-manual/configuration/java-api.en.md b/docs/content/user-manual/configuration/java-api.en.md index 3670e0b4d5..f7a4bc1a92 100644 --- a/docs/content/user-manual/configuration/java-api.en.md +++ b/docs/content/user-manual/configuration/java-api.en.md @@ -13,7 +13,7 @@ Class name: `org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfigu Configuration: | Name | Constructor injection | -| ----------------------------- |:--------------------- | +|-------------------------------|:----------------------| | serverLists | Yes | | namespace | Yes | | baseSleepTimeMilliseconds | No | @@ -29,24 +29,24 @@ Class name: `org.apache.shardingsphere.elasticjob.api.JobConfiguration` Configuration: -| Name | Constructor injection | -| ----------------------------- |:--------------------- | -| jobName | Yes | -| shardingTotalCount | Yes | -| cron | No | -| timeZone | No | -| shardingItemParameters | No | -| jobParameter | No | -| monitorExecution | No | -| failover | No | -| misfire | No | -| maxTimeDiffSeconds | No | -| reconcileIntervalMinutes | No | -| jobShardingStrategyType | No | -| jobExecutorServiceHandlerType | No | -| jobErrorHandlerType | No | -| jobListenerTypes | No | -| description | No | -| props | No | -| disabled | No | -| overwrite | No | +| Name | Constructor injection | +|-----------------------------------|:----------------------| +| jobName | Yes | +| shardingTotalCount | Yes | +| cron | No | +| timeZone | No | +| shardingItemParameters | No | +| jobParameter | No | +| monitorExecution | No | +| failover | No | +| misfire | No | +| maxTimeDiffSeconds | No | +| reconcileIntervalMinutes | No | +| jobShardingStrategyType | No | +| jobExecutorThreadPoolSizeProvider | No | +| jobErrorHandlerType | No | +| jobListenerTypes | No | +| description | No | +| props | No | +| disabled | No | +| overwrite | No | diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java index f504f96627..0ab4e17ad9 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java @@ -20,7 +20,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.ElasticJobExecutorService; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Optional; @@ -32,29 +33,30 @@ @Slf4j public final class ExecutorServiceReloadable implements Reloadable { - private JobExecutorServiceHandler jobExecutorServiceHandler; + private String jobExecutorThreadPoolSizeProviderType; private ExecutorService executorService; @Override public void init(final JobConfiguration jobConfig) { - jobExecutorServiceHandler = TypedSPILoader.getService(JobExecutorServiceHandler.class, jobConfig.getJobExecutorServiceHandlerType()); - executorService = jobExecutorServiceHandler.createExecutorService(jobConfig.getJobName()); + JobExecutorThreadPoolSizeProvider jobExecutorThreadPoolSizeProvider = TypedSPILoader.getService(JobExecutorThreadPoolSizeProvider.class, jobConfig.getJobExecutorThreadPoolSizeProviderType()); + jobExecutorThreadPoolSizeProviderType = jobExecutorThreadPoolSizeProvider.getType(); + executorService = new ElasticJobExecutorService("elasticjob-" + jobConfig.getJobName(), jobExecutorThreadPoolSizeProvider.getSize()).createExecutorService(); } @Override public synchronized void reloadIfNecessary(final JobConfiguration jobConfig) { - if (jobExecutorServiceHandler.getType().equals(jobConfig.getJobExecutorServiceHandlerType())) { + if (jobExecutorThreadPoolSizeProviderType.equals(jobConfig.getJobExecutorThreadPoolSizeProviderType())) { return; } - log.debug("JobExecutorServiceHandler reload occurred in the job '{}'. Change from '{}' to '{}'.", - jobConfig.getJobName(), jobExecutorServiceHandler.getType(), jobConfig.getJobExecutorServiceHandlerType()); - reload(jobConfig.getJobExecutorServiceHandlerType(), jobConfig.getJobName()); + log.debug("Reload occurred in the job '{}'. Change from '{}' to '{}'.", jobConfig.getJobName(), jobExecutorThreadPoolSizeProviderType, jobConfig.getJobExecutorThreadPoolSizeProviderType()); + reload(jobConfig.getJobExecutorThreadPoolSizeProviderType(), jobConfig.getJobName()); } - private void reload(final String jobExecutorServiceHandlerType, final String jobName) { + private void reload(final String jobExecutorThreadPoolSizeProviderType, final String jobName) { executorService.shutdown(); - executorService = TypedSPILoader.getService(JobExecutorServiceHandler.class, jobExecutorServiceHandlerType).createExecutorService(jobName); + executorService = new ElasticJobExecutorService( + "elasticjob-" + jobName, TypedSPILoader.getService(JobExecutorThreadPoolSizeProvider.class, jobExecutorThreadPoolSizeProviderType).getSize()).createExecutorService(); } @Override diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/ElasticJobExecutorService.java similarity index 97% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/ElasticJobExecutorService.java index 90f91e908b..b9f67fd58a 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorService.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/ElasticJobExecutorService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.concurrent; +package org.apache.shardingsphere.elasticjob.infra.handler.threadpool; import com.google.common.util.concurrent.MoreExecutors; import org.apache.commons.lang3.concurrent.BasicThreadFactory; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorThreadPoolSizeProvider.java similarity index 77% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorThreadPoolSizeProvider.java index 4b26511fd7..aaf4b9d698 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorServiceHandler.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorThreadPoolSizeProvider.java @@ -20,20 +20,19 @@ import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; -import java.util.concurrent.ExecutorService; - /** - * Job executor service handler. + * Job executor thread pool size provider. */ @SingletonSPI -public interface JobExecutorServiceHandler extends TypedSPI { +public interface JobExecutorThreadPoolSizeProvider extends TypedSPI { /** - * Create executor service. - * - * @param jobName job name + * Get thread pool size. * - * @return executor service + * @return thread pool size */ - ExecutorService createExecutorService(String jobName); + int getSize(); + + @Override + String getType(); } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java deleted file mode 100644 index f28d060ffa..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.elasticjob.infra.handler.threadpool.impl; - -import org.apache.shardingsphere.elasticjob.infra.concurrent.ElasticJobExecutorService; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; - -import java.util.concurrent.ExecutorService; - -/** - * Abstract job executor service handler. - **/ -public abstract class AbstractJobExecutorServiceHandler implements JobExecutorServiceHandler { - - @Override - public ExecutorService createExecutorService(final String jobName) { - return new ElasticJobExecutorService("elasticjob-" + jobName, getPoolSize()).createExecutorService(); - } - - protected abstract int getPoolSize(); -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java similarity index 77% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java index 70d39ce645..341a1c48ba 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandler.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java @@ -15,15 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; +package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; + +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; /** - * Job executor service handler with use CPU available processors. + * Job executor pool size provider with use CPU available processors. */ -public final class CPUUsageJobExecutorServiceHandler extends AbstractJobExecutorServiceHandler { +public final class CPUUsageJobExecutorThreadPoolSizeProvider implements JobExecutorThreadPoolSizeProvider { @Override - protected int getPoolSize() { + public int getSize() { return Runtime.getRuntime().availableProcessors() * 2; } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java similarity index 76% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java index c81e2d3730..de1da05b89 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandler.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java @@ -15,15 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; +package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; + +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; /** - * Job executor service handler with single thread. + * Job executor pool size provider with single thread. */ -public final class SingleThreadJobExecutorServiceHandler extends AbstractJobExecutorServiceHandler { +public final class SingleThreadJobExecutorThreadPoolSizeProvider implements JobExecutorThreadPoolSizeProvider { @Override - protected int getPoolSize() { + public int getSize() { return 1; } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java index 6b9dd2cef9..b0838af173 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java @@ -61,7 +61,7 @@ public final class JobConfigurationPOJO { private String jobShardingStrategyType; - private String jobExecutorServiceHandlerType; + private String jobExecutorThreadPoolSizeProviderType; private String jobErrorHandlerType; @@ -91,7 +91,7 @@ public JobConfiguration toJobConfiguration() { .cron(cron).timeZone(timeZone).shardingItemParameters(shardingItemParameters).jobParameter(jobParameter) .monitorExecution(monitorExecution).failover(failover).misfire(misfire) .maxTimeDiffSeconds(maxTimeDiffSeconds).reconcileIntervalMinutes(reconcileIntervalMinutes) - .jobShardingStrategyType(jobShardingStrategyType).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType) + .jobShardingStrategyType(jobShardingStrategyType).jobExecutorThreadPoolSizeProviderType(jobExecutorThreadPoolSizeProviderType) .jobErrorHandlerType(jobErrorHandlerType).jobListenerTypes(jobListenerTypes.toArray(new String[]{})).description(description) .disabled(disabled).overwrite(overwrite).label(label).staticSharding(staticSharding).build(); jobExtraConfigurations.stream().map(YamlConfiguration::toConfiguration).forEach(result.getExtraConfigurations()::add); @@ -122,7 +122,7 @@ public static JobConfigurationPOJO fromJobConfiguration(final JobConfiguration j result.setMaxTimeDiffSeconds(jobConfig.getMaxTimeDiffSeconds()); result.setReconcileIntervalMinutes(jobConfig.getReconcileIntervalMinutes()); result.setJobShardingStrategyType(jobConfig.getJobShardingStrategyType()); - result.setJobExecutorServiceHandlerType(jobConfig.getJobExecutorServiceHandlerType()); + result.setJobExecutorThreadPoolSizeProviderType(jobConfig.getJobExecutorThreadPoolSizeProviderType()); result.setJobErrorHandlerType(jobConfig.getJobErrorHandlerType()); result.setJobListenerTypes(jobConfig.getJobListenerTypes()); jobConfig.getExtraConfigurations().stream() diff --git a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider similarity index 77% rename from infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler rename to infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider index 0aa42ea467..4064541bc3 100644 --- a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler +++ b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl.CPUUsageJobExecutorServiceHandler -org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl.SingleThreadJobExecutorServiceHandler +org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java index b6eeb74f3d..6f4160adf8 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.concurrent; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.ElasticJobExecutorService; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java index 4c30370b81..10f67a1145 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java @@ -19,7 +19,6 @@ import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; @@ -33,9 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class ExecutorServiceReloadableTest { @@ -46,8 +43,7 @@ class ExecutorServiceReloadableTest { @Test void assertInitialize() { try (ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable()) { - String jobExecutorServiceHandlerType = "SINGLE_THREAD"; - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType).build(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").build(); assertNull(executorServiceReloadable.getInstance()); executorServiceReloadable.init(jobConfig); ExecutorService actual = executorServiceReloadable.getInstance(); @@ -61,9 +57,7 @@ void assertInitialize() { @Test void assertReload() { ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); - JobExecutorServiceHandler jobExecutorServiceHandler = mock(JobExecutorServiceHandler.class); - when(jobExecutorServiceHandler.getType()).thenReturn("mock"); - setField(executorServiceReloadable, "jobExecutorServiceHandler", jobExecutorServiceHandler); + setField(executorServiceReloadable, "jobExecutorThreadPoolSizeProviderType", "mock"); setField(executorServiceReloadable, "executorService", mockExecutorService); JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).build(); executorServiceReloadable.reloadIfNecessary(jobConfig); @@ -77,7 +71,7 @@ void assertReload() { @Test void assertUnnecessaryToReload() { try (ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable()) { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorServiceHandlerType("CPU").build(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("CPU").build(); executorServiceReloadable.init(jobConfig); ExecutorService expected = executorServiceReloadable.getInstance(); executorServiceReloadable.reloadIfNecessary(jobConfig); diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java similarity index 78% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java index ff9d776399..45b0b6f9da 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/CPUUsageJobExecutorServiceHandlerTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; +package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -class CPUUsageJobExecutorServiceHandlerTest { +class CPUUsageJobExecutorThreadPoolSizeProviderTest { @Test - void assertGetPoolSizeAndType() { - assertThat(((CPUUsageJobExecutorServiceHandler) TypedSPILoader.getService(JobExecutorServiceHandler.class, "CPU")).getPoolSize(), is(Runtime.getRuntime().availableProcessors() * 2)); + void assertGetPoolSize() { + assertThat((TypedSPILoader.getService(JobExecutorThreadPoolSizeProvider.class, "CPU")).getSize(), is(Runtime.getRuntime().availableProcessors() * 2)); } } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java similarity index 79% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java index 45f754a151..ea92a32e5a 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/impl/SingleThreadJobExecutorServiceHandlerTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.impl; +package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorServiceHandler; +import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -class SingleThreadJobExecutorServiceHandlerTest { +class SingleThreadJobExecutorThreadPoolSizeProviderTest { @Test - void assertGetPoolSizeAndType() { - assertThat(((SingleThreadJobExecutorServiceHandler) TypedSPILoader.getService(JobExecutorServiceHandler.class, "SINGLE_THREAD")).getPoolSize(), is(1)); + void assertGetPoolSize() { + assertThat((TypedSPILoader.getService(JobExecutorThreadPoolSizeProvider.class, "SINGLE_THREAD")).getSize(), is(1)); } } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java index 6414aef99f..b0dd373c53 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java @@ -37,7 +37,7 @@ class JobConfigurationPOJOTest { + "disabled: false\n" + "failover: false\n" + "jobErrorHandlerType: IGNORE\n" - + "jobExecutorServiceHandlerType: CPU\n" + + "jobExecutorThreadPoolSizeProviderType: CPU\n" + "jobName: test_job\n" + "jobParameter: param\n" + "jobShardingStrategyType: AVG_ALLOCATION\n" @@ -76,7 +76,7 @@ void assertToJobConfiguration() { pojo.setFailover(true); pojo.setMisfire(true); pojo.setJobShardingStrategyType("AVG_ALLOCATION"); - pojo.setJobExecutorServiceHandlerType("CPU"); + pojo.setJobExecutorThreadPoolSizeProviderType("CPU"); pojo.setJobErrorHandlerType("IGNORE"); pojo.setJobListenerTypes(Collections.singletonList("LOG")); pojo.setDescription("Job description"); @@ -93,7 +93,7 @@ void assertToJobConfiguration() { assertTrue(actual.isFailover()); assertTrue(actual.isMisfire()); assertThat(actual.getJobShardingStrategyType(), is("AVG_ALLOCATION")); - assertThat(actual.getJobExecutorServiceHandlerType(), is("CPU")); + assertThat(actual.getJobExecutorThreadPoolSizeProviderType(), is("CPU")); assertThat(actual.getJobErrorHandlerType(), is("IGNORE")); assertThat(actual.getJobListenerTypes(), hasItem("LOG")); assertThat(actual.getDescription(), is("Job description")); @@ -108,7 +108,7 @@ void assertFromJobConfiguration() { .cron("0/1 * * * * ?") .shardingItemParameters("0=A,1=B,2=C").jobParameter("param") .monitorExecution(true).failover(true).misfire(true) - .jobShardingStrategyType("AVG_ALLOCATION").jobExecutorServiceHandlerType("CPU").jobErrorHandlerType("IGNORE") + .jobShardingStrategyType("AVG_ALLOCATION").jobExecutorThreadPoolSizeProviderType("CPU").jobErrorHandlerType("IGNORE") .jobListenerTypes("LOG").description("Job description").setProperty("key", "value") .disabled(true).overwrite(true).build(); JobConfigurationPOJO actual = JobConfigurationPOJO.fromJobConfiguration(jobConfig); @@ -121,7 +121,7 @@ void assertFromJobConfiguration() { assertTrue(actual.isFailover()); assertTrue(actual.isMisfire()); assertThat(actual.getJobShardingStrategyType(), is("AVG_ALLOCATION")); - assertThat(actual.getJobExecutorServiceHandlerType(), is("CPU")); + assertThat(actual.getJobExecutorThreadPoolSizeProviderType(), is("CPU")); assertThat(actual.getJobErrorHandlerType(), is("IGNORE")); assertThat(actual.getJobListenerTypes(), hasItem("LOG")); assertThat(actual.getDescription(), is("Job description")); @@ -140,7 +140,7 @@ void assertMarshal() { actual.setJobParameter("param"); actual.setMaxTimeDiffSeconds(-1); actual.setJobShardingStrategyType("AVG_ALLOCATION"); - actual.setJobExecutorServiceHandlerType("CPU"); + actual.setJobExecutorThreadPoolSizeProviderType("CPU"); actual.setJobErrorHandlerType("IGNORE"); actual.setDescription("Job description"); actual.getProps().setProperty("key", "value"); @@ -169,7 +169,7 @@ void assertUnmarshal() { assertFalse(actual.isFailover()); assertFalse(actual.isMisfire()); assertThat(actual.getJobShardingStrategyType(), is("AVG_ALLOCATION")); - assertThat(actual.getJobExecutorServiceHandlerType(), is("CPU")); + assertThat(actual.getJobExecutorThreadPoolSizeProviderType(), is("CPU")); assertThat(actual.getJobErrorHandlerType(), is("IGNORE")); assertThat(actual.getDescription(), is("Job description")); assertThat(actual.getProps().getProperty("key"), is("value")); @@ -187,7 +187,7 @@ void assertUnmarshalWithNullValue() { assertFalse(actual.isFailover()); assertFalse(actual.isMisfire()); assertNull(actual.getJobShardingStrategyType()); - assertNull(actual.getJobExecutorServiceHandlerType()); + assertNull(actual.getJobExecutorThreadPoolSizeProviderType()); assertNull(actual.getJobErrorHandlerType()); assertNull(actual.getDescription()); assertTrue(actual.getProps().isEmpty()); diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java index 616e55e2ff..93d5b64464 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java @@ -54,7 +54,7 @@ public static JobConfiguration generateJobConfiguration(final Class type) { .maxTimeDiffSeconds(annotation.maxTimeDiffSeconds()) .reconcileIntervalMinutes(annotation.reconcileIntervalMinutes()) .jobShardingStrategyType(Strings.isNullOrEmpty(annotation.jobShardingStrategyType()) ? null : annotation.jobShardingStrategyType()) - .jobExecutorServiceHandlerType(Strings.isNullOrEmpty(annotation.jobExecutorServiceHandlerType()) ? null : annotation.jobExecutorServiceHandlerType()) + .jobExecutorThreadPoolSizeProviderType(Strings.isNullOrEmpty(annotation.jobExecutorThreadPoolSizeProviderType()) ? null : annotation.jobExecutorThreadPoolSizeProviderType()) .jobErrorHandlerType(Strings.isNullOrEmpty(annotation.jobErrorHandlerType()) ? null : annotation.jobErrorHandlerType()) .jobListenerTypes(annotation.jobListenerTypes()) .description(annotation.description()) diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java index 579cde4749..201e7ad76b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java @@ -42,7 +42,7 @@ void assertGenerateJobConfiguration() { assertThat(jobConfig.getMaxTimeDiffSeconds(), is(-1)); assertThat(jobConfig.getReconcileIntervalMinutes(), is(10)); assertNull(jobConfig.getJobShardingStrategyType()); - assertNull(jobConfig.getJobExecutorServiceHandlerType()); + assertNull(jobConfig.getJobExecutorThreadPoolSizeProviderType()); assertNull(jobConfig.getJobErrorHandlerType()); assertThat(jobConfig.getDescription(), is("desc")); assertThat(jobConfig.getProps().getProperty("print.title"), is("test title")); diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationProperties.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationProperties.java index f3ef7bceac..b1ab7691ff 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationProperties.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationProperties.java @@ -61,7 +61,7 @@ public final class ElasticJobConfigurationProperties { private String jobShardingStrategyType; - private String jobExecutorServiceHandlerType; + private String jobExecutorThreadPoolSizeProviderType; private String jobErrorHandlerType; @@ -86,7 +86,7 @@ public JobConfiguration toJobConfiguration(final String jobName) { .cron(cron).timeZone(timeZone).shardingItemParameters(shardingItemParameters).jobParameter(jobParameter) .monitorExecution(monitorExecution).failover(failover).misfire(misfire) .maxTimeDiffSeconds(maxTimeDiffSeconds).reconcileIntervalMinutes(reconcileIntervalMinutes) - .jobShardingStrategyType(jobShardingStrategyType).jobExecutorServiceHandlerType(jobExecutorServiceHandlerType).jobErrorHandlerType(jobErrorHandlerType) + .jobShardingStrategyType(jobShardingStrategyType).jobExecutorThreadPoolSizeProviderType(jobExecutorThreadPoolSizeProviderType).jobErrorHandlerType(jobErrorHandlerType) .jobListenerTypes(jobListenerTypes.toArray(new String[0])).description(description).disabled(disabled).overwrite(overwrite).build(); props.stringPropertyNames().forEach(each -> result.getProps().setProperty(each, props.getProperty(each))); return result; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationPropertiesTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationPropertiesTest.java index 19f2e81a62..a098059d0f 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationPropertiesTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobConfigurationPropertiesTest.java @@ -45,7 +45,7 @@ void assertToJobConfiguration() { properties.setMaxTimeDiffSeconds(1); properties.setReconcileIntervalMinutes(2); properties.setJobShardingStrategyType("strategyType"); - properties.setJobExecutorServiceHandlerType("executorType"); + properties.setJobExecutorThreadPoolSizeProviderType("executorType"); properties.setJobErrorHandlerType("errorHandlerType"); properties.setJobListenerTypes(Collections.singleton("listenerType")); properties.setDescription("test desc"); @@ -62,7 +62,7 @@ void assertToJobConfiguration() { assertThat(actual.getMaxTimeDiffSeconds(), is(properties.getMaxTimeDiffSeconds())); assertThat(actual.getReconcileIntervalMinutes(), is(properties.getReconcileIntervalMinutes())); assertThat(actual.getJobShardingStrategyType(), is(properties.getJobShardingStrategyType())); - assertThat(actual.getJobExecutorServiceHandlerType(), is(properties.getJobExecutorServiceHandlerType())); + assertThat(actual.getJobExecutorThreadPoolSizeProviderType(), is(properties.getJobExecutorThreadPoolSizeProviderType())); assertThat(actual.getJobErrorHandlerType(), is(properties.getJobErrorHandlerType())); assertThat(actual.getJobListenerTypes().toArray(), is(properties.getJobListenerTypes().toArray())); assertThat(actual.getDescription(), is(properties.getDescription())); From 2aa8ccfd76bd94153a6769a03f13e5ba4ae0807f Mon Sep 17 00:00:00 2001 From: zhangliang Date: Wed, 25 Oct 2023 23:56:27 +0800 Subject: [PATCH 091/178] Remove useless JobInstanceRegistry --- .../api/registry/JobInstanceRegistry.java | 113 ------------------ .../api/registry/JobInstanceRegistryTest.java | 74 ------------ 2 files changed, 187 deletions(-) delete mode 100644 kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistry.java delete mode 100644 kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistryTest.java diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistry.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistry.java deleted file mode 100644 index 769e1076c3..0000000000 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistry.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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.elasticjob.kernel.api.registry; - -import lombok.RequiredArgsConstructor; - -import org.apache.curator.utils.ThreadUtils; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; -import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; - -import java.util.Arrays; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; -import java.util.regex.Pattern; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - -/** - * Job instance registry. - */ -@RequiredArgsConstructor -public final class JobInstanceRegistry { - - private static final Pattern JOB_CONFIG_COMPILE = Pattern.compile("/(\\w+)/config"); - - private final CoordinatorRegistryCenter regCenter; - - private final JobInstance jobInstance; - - /** - * Register. - */ - public void register() { - ThreadFactory threadFactory = ThreadUtils.newGenericThreadFactory("ListenerNotify-instanceRegistry"); - Executor executor = Executors.newSingleThreadExecutor(threadFactory); - regCenter.watch("/", new JobInstanceRegistryListener(), executor); - } - - public class JobInstanceRegistryListener implements DataChangedEventListener { - - @Override - public void onChange(final DataChangedEvent event) { - if (event.getType() != DataChangedEvent.Type.ADDED || !isJobConfigPath(event.getKey())) { - return; - } - JobConfiguration jobConfig = YamlEngine.unmarshal(event.getValue(), JobConfigurationPOJO.class).toJobConfiguration(); - if (jobConfig.isDisabled() || !isLabelMatch(jobConfig)) { - return; - } - if (!jobConfig.getCron().isEmpty()) { - new ScheduleJobBootstrap(regCenter, newElasticJobInstance(jobConfig), jobConfig).schedule(); - } else if (!isAllShardingItemsCompleted(jobConfig)) { - new OneOffJobBootstrap(regCenter, newElasticJobInstance(jobConfig), jobConfig).execute(); - } - } - - private boolean isAllShardingItemsCompleted(final JobConfiguration jobConfig) { - JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); - return IntStream.range(0, jobConfig.getShardingTotalCount()) - .allMatch(each -> regCenter.isExisted(jobNodePath.getShardingNodePath(String.valueOf(each), "completed"))); - } - - private ElasticJob newElasticJobInstance(final JobConfiguration jobConfig) { - String clazz = regCenter.get(String.format("/%s", jobConfig.getJobName())); - try { - return (ElasticJob) Class.forName(clazz).newInstance(); - // CHECKSTYLE:OFF - } catch (final Exception ex) { - // CHECKSTYLE:ON - throw new RuntimeException(String.format("new elastic job instance by class '%s' failure", clazz), ex); - } - } - - private boolean isLabelMatch(final JobConfiguration jobConfig) { - if (jobConfig.getLabel() == null) { - return false; - } - if (jobInstance.getLabels() == null) { - return true; - } - return Arrays.stream(jobInstance.getLabels().split(",")).collect(Collectors.toSet()).contains(jobConfig.getLabel()); - } - - private boolean isJobConfigPath(final String path) { - return JOB_CONFIG_COMPILE.matcher(path).matches(); - } - } -} diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistryTest.java deleted file mode 100644 index 0e5c8cb504..0000000000 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/registry/JobInstanceRegistryTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.elasticjob.kernel.api.registry; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; -import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@ExtendWith(MockitoExtension.class) -class JobInstanceRegistryTest { - - @Mock - private CoordinatorRegistryCenter regCenter; - - @Test - void assertListenWithoutConfigPath() { - new JobInstanceRegistry(regCenter, new JobInstance("id")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName", "")); - verify(regCenter, times(0)).get("/jobName"); - } - - @Test - void assertListenLabelNotMatch() { - String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).label("label").build()); - new JobInstanceRegistry(regCenter, new JobInstance("id", "label1,label2")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); - verify(regCenter, times(0)).get("/jobName"); - } - - @Test - void assertListenScheduleJob() { - assertThrows(RuntimeException.class, () -> { - String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).cron("0/1 * * * * ?").label("label").build()); - new JobInstanceRegistry(regCenter, new JobInstance("id")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); - }); - } - - @Test - void assertListenOneOffJob() { - assertThrows(RuntimeException.class, () -> { - String jobConfig = toYaml(JobConfiguration.newBuilder("jobName", 1).label("label").build()); - new JobInstanceRegistry(regCenter, new JobInstance("id", "label")).new JobInstanceRegistryListener().onChange(new DataChangedEvent(Type.ADDED, "/jobName/config", jobConfig)); - }); - } - - private String toYaml(final JobConfiguration build) { - return YamlEngine.marshal(JobConfigurationPOJO.fromJobConfiguration(build)); - } -} From 9905251670ac5dea6c887151f885a8750cb00816 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Thu, 26 Oct 2023 07:39:43 +0800 Subject: [PATCH 092/178] Refactor handler package (#2316) --- .../{handler => }/sharding/JobInstance.java | 2 +- .../sharding/JobShardingStrategy.java | 2 +- .../AverageAllocationJobShardingStrategy.java | 6 +++--- .../OdevitySortByNameJobShardingStrategy.java | 6 +++--- .../RoundRobinByNameJobShardingStrategy.java | 6 +++--- .../threadpool/ElasticJobExecutorService.java | 2 +- .../ExecutorServiceReloadable.java | 4 +--- .../JobExecutorThreadPoolSizeProvider.java | 2 +- ...sageJobExecutorThreadPoolSizeProvider.java | 4 ++-- ...readJobExecutorThreadPoolSizeProvider.java | 4 ++-- ...sphere.elasticjob.infra.context.Reloadable | 2 +- ...infra.handler.sharding.JobShardingStrategy | 20 ------------------- ...ticjob.infra.sharding.JobShardingStrategy} | 5 +++-- ...eadpool.JobExecutorThreadPoolSizeProvider} | 7 ++++--- .../sharding/JobInstanceTest.java | 2 +- ...rageAllocationJobShardingStrategyTest.java | 6 +++--- ...vitySortByNameJobShardingStrategyTest.java | 4 ++-- ...teServerByNameJobShardingStrategyTest.java | 4 ++-- .../ElasticJobExecutorServiceTest.java | 3 +-- .../ExecutorServiceReloadableTest.java | 2 +- ...JobExecutorThreadPoolSizeProviderTest.java | 4 ++-- ...JobExecutorThreadPoolSizeProviderTest.java | 4 ++-- .../election/ElectionListenerManager.java | 2 +- .../failover/FailoverListenerManager.java | 2 +- .../internal/failover/FailoverService.java | 2 +- .../internal/instance/InstanceService.java | 2 +- .../kernel/internal/schedule/JobRegistry.java | 2 +- .../internal/schedule/JobScheduler.java | 2 +- .../kernel/internal/server/ServerNode.java | 2 +- .../sharding/ExecutionContextService.java | 2 +- .../internal/sharding/ExecutionService.java | 2 +- .../internal/sharding/ShardingService.java | 4 ++-- .../kernel/internal/trigger/TriggerNode.java | 2 +- .../config/RescheduleListenerManagerTest.java | 2 +- .../election/ElectionListenerManagerTest.java | 2 +- .../internal/election/LeaderServiceTest.java | 2 +- .../failover/FailoverListenerManagerTest.java | 2 +- .../failover/FailoverServiceTest.java | 2 +- .../internal/instance/InstanceNodeTest.java | 2 +- .../instance/InstanceServiceTest.java | 2 +- .../instance/ShutdownListenerManagerTest.java | 2 +- ...stryCenterConnectionStateListenerTest.java | 2 +- .../reconcile/ReconcileServiceTest.java | 2 +- .../internal/schedule/JobRegistryTest.java | 2 +- .../schedule/SchedulerFacadeTest.java | 2 +- .../internal/server/ServerNodeTest.java | 2 +- .../internal/server/ServerServiceTest.java | 2 +- .../internal/setup/SetUpFacadeTest.java | 2 +- .../sharding/ExecutionContextServiceTest.java | 2 +- .../sharding/ExecutionServiceTest.java | 2 +- .../sharding/ShardingListenerManagerTest.java | 2 +- .../sharding/ShardingServiceTest.java | 2 +- .../trigger/TriggerListenerManagerTest.java | 2 +- .../internal/operate/JobOperateAPIImpl.java | 2 +- .../statistics/JobStatisticsAPIImpl.java | 2 +- .../statistics/ServerStatisticsAPIImpl.java | 2 +- .../statistics/ShardingStatisticsAPIImpl.java | 2 +- 57 files changed, 76 insertions(+), 97 deletions(-) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/JobInstance.java (96%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/JobShardingStrategy.java (95%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/impl/AverageAllocationJobShardingStrategy.java (93%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/impl/OdevitySortByNameJobShardingStrategy.java (90%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/impl/RoundRobinByNameJobShardingStrategy.java (89%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/threadpool/ElasticJobExecutorService.java (97%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{concurrent => threadpool}/ExecutorServiceReloadable.java (92%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/threadpool/JobExecutorThreadPoolSizeProvider.java (94%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java (87%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java (86%) delete mode 100644 infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy rename infra/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider => org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy} (73%) rename infra/src/{test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener => main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider} (78%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/JobInstanceTest.java (96%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/impl/AverageAllocationJobShardingStrategyTest.java (94%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java (93%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/sharding/impl/RotateServerByNameJobShardingStrategyTest.java (94%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{concurrent => threadpool}/ElasticJobExecutorServiceTest.java (94%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{concurrent => threadpool}/ExecutorServiceReloadableTest.java (98%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java (87%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{handler => }/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java (87%) diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java similarity index 96% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java index 48ef8bb409..d282348e93 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstance.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding; +package org.apache.shardingsphere.elasticjob.infra.sharding; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobShardingStrategy.java similarity index 95% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobShardingStrategy.java index d230c09a11..761ee02860 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobShardingStrategy.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobShardingStrategy.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding; +package org.apache.shardingsphere.elasticjob.infra.sharding; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategy.java similarity index 93% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategy.java index 27c24fe856..bb20a1f241 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategy.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategy.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; +package org.apache.shardingsphere.elasticjob.infra.sharding.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; import java.util.ArrayList; import java.util.Collections; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategy.java similarity index 90% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategy.java index d96803340a..c7454fb5a7 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategy.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategy.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; +package org.apache.shardingsphere.elasticjob.infra.sharding.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; import java.util.Collections; import java.util.List; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RoundRobinByNameJobShardingStrategy.java similarity index 89% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RoundRobinByNameJobShardingStrategy.java index 182f63ccda..f2843f8a40 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RoundRobinByNameJobShardingStrategy.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RoundRobinByNameJobShardingStrategy.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; +package org.apache.shardingsphere.elasticjob.infra.sharding.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; import java.util.ArrayList; import java.util.List; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/ElasticJobExecutorService.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorService.java similarity index 97% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/ElasticJobExecutorService.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorService.java index b9f67fd58a..f361a95955 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/ElasticJobExecutorService.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool; +package org.apache.shardingsphere.elasticjob.infra.threadpool; import com.google.common.util.concurrent.MoreExecutors; import org.apache.commons.lang3.concurrent.BasicThreadFactory; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadable.java similarity index 92% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadable.java index 0ab4e17ad9..375b2d77c4 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadable.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadable.java @@ -15,13 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.concurrent; +package org.apache.shardingsphere.elasticjob.infra.threadpool; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.ElasticJobExecutorService; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Optional; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorThreadPoolSizeProvider.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/JobExecutorThreadPoolSizeProvider.java similarity index 94% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorThreadPoolSizeProvider.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/JobExecutorThreadPoolSizeProvider.java index aaf4b9d698..009c4f1b55 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/JobExecutorThreadPoolSizeProvider.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/JobExecutorThreadPoolSizeProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool; +package org.apache.shardingsphere.elasticjob.infra.threadpool; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java similarity index 87% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java index 341a1c48ba..1dfe249ed8 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; +package org.apache.shardingsphere.elasticjob.infra.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with use CPU available processors. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java similarity index 86% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java index de1da05b89..0539262f79 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; +package org.apache.shardingsphere.elasticjob.infra.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with single thread. diff --git a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable index 14d1efd51c..6a5c61ca1e 100644 --- a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable +++ b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.infra.concurrent.ExecutorServiceReloadable +org.apache.shardingsphere.elasticjob.infra.threadpool.ExecutorServiceReloadable diff --git a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy deleted file mode 100644 index 970f1d9d3f..0000000000 --- a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl.AverageAllocationJobShardingStrategy -org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl.OdevitySortByNameJobShardingStrategy -org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl.RoundRobinByNameJobShardingStrategy diff --git a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy similarity index 73% rename from infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider rename to infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy index 4064541bc3..95d09b6bc2 100644 --- a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider +++ b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy @@ -15,5 +15,6 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider -org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.infra.sharding.impl.AverageAllocationJobShardingStrategy +org.apache.shardingsphere.elasticjob.infra.sharding.impl.OdevitySortByNameJobShardingStrategy +org.apache.shardingsphere.elasticjob.infra.sharding.impl.RoundRobinByNameJobShardingStrategy diff --git a/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider similarity index 78% rename from infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider index f968a91a0b..f8f1d2c7cc 100644 --- a/infra/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider @@ -5,9 +5,9 @@ # 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. @@ -15,4 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.infra.listener.fixture.FooElasticJobListener +org.apache.shardingsphere.elasticjob.infra.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.infra.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstanceTest.java similarity index 96% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstanceTest.java index eaa2963193..f76a2414dc 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/JobInstanceTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstanceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding; +package org.apache.shardingsphere.elasticjob.infra.sharding; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategyTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategyTest.java index b60a4f600e..ab1338b028 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/AverageAllocationJobShardingStrategyTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategyTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; +package org.apache.shardingsphere.elasticjob.infra.sharding.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; import org.junit.jupiter.api.Test; import java.util.Arrays; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java similarity index 93% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java index dfe768ce69..09edfeff91 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; +package org.apache.shardingsphere.elasticjob.infra.sharding.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.junit.jupiter.api.Test; import java.util.Arrays; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RotateServerByNameJobShardingStrategyTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RotateServerByNameJobShardingStrategyTest.java index 4f159e6e75..0a059d8fa8 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/sharding/impl/RotateServerByNameJobShardingStrategyTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RotateServerByNameJobShardingStrategyTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.sharding.impl; +package org.apache.shardingsphere.elasticjob.infra.sharding.impl; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.junit.jupiter.api.Test; import java.util.Arrays; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorServiceTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorServiceTest.java index 6f4160adf8..a03878a90a 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ElasticJobExecutorServiceTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorServiceTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.concurrent; +package org.apache.shardingsphere.elasticjob.infra.threadpool; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.ElasticJobExecutorService; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadableTest.java similarity index 98% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadableTest.java index 10f67a1145..ef6b112730 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/concurrent/ExecutorServiceReloadableTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadableTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.concurrent; +package org.apache.shardingsphere.elasticjob.infra.threadpool; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java similarity index 87% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java index 45b0b6f9da..ba613c3e9d 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; +package org.apache.shardingsphere.elasticjob.infra.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java similarity index 87% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java index ea92a32e5a..af7efe5a7b 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/handler/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.handler.threadpool.type; +package org.apache.shardingsphere.elasticjob.infra.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.handler.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java index b46ef9312c..33b69dee2b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.election; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerNode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java index 81e0466449..c7c3f77e9d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.failover; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java index 7499ee456d..f6b972e196 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java index dc1159a9c4..e93bbdb6c0 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java index 9285a0aa27..9e5c7b94eb 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java @@ -19,7 +19,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerNotifierManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 76ef8fd7d3..c63cb5e03c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -25,7 +25,7 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java index 6693d12c20..56a48fc297 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.server; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java index e989135c74..0c54035568 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.context.ShardingItemParameters; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java index d633371551..deac82cf56 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java index 789f86dfa5..e52e088e83 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java @@ -20,8 +20,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java index 1588ae1700..33114e051b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java index 8b47c957a4..a61c9fd0e4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.config; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java index 3c9c8fdd8e..7b81a969fd 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.election; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java index 326a7bf21d..48e4bf9543 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.election; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService.LeaderElectionExecutionCallback; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java index 2fb30acdb6..00de558fd5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java index e124f2d2fb..32b249589b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java index e57360719f..694a71ba90 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java index 92a4c52288..896e11cc2f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java index 648c4905b6..a3178ecca6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.SchedulerFacade; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java index 11addd1d5b..4db4ebecc2 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.listener; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java index ed81011efe..b2e8a8d86c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java index faebd5eac3..84d6d578c8 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java index bed1745ce6..34b5b809a9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java index ee4f7e88f5..05e851df0c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.server; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java index f6e7d99a9c..efd8d7fdc0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.server; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java index 3f99581c74..9d53ac5ac6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.setup; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerManager; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java index 23a2e4db46..01eb0bac40 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java index 9abcf8e311..9ea81e0c12 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java index e8e6fee1df..11d83019dd 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java index 9f38576a74..150d5898eb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java index f30045eb30..2bfecb6fe3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java index 3ba3e6922b..d15d2fecf6 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.operate; import com.google.common.base.Preconditions; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index a1e978f95a..7af9c48da2 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -19,7 +19,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java index 95cd969323..2fb6c69519 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java index 32b91f473e..3e9e808161 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.handler.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI; From 58f3dd91a8fed29eedbfefc6554ba00dd5271c3b Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Thu, 26 Oct 2023 19:17:57 +0800 Subject: [PATCH 093/178] Move ShardingItemParameters to kernel module (#2317) --- .../kernel/internal/sharding/ExecutionContextService.java | 1 - .../kernel/internal/sharding}/ShardingItemParameters.java | 2 +- .../kernel/internal/sharding}/ShardingItemParametersTest.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding}/ShardingItemParameters.java (97%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding}/ShardingItemParametersTest.java (96%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java index 0c54035568..788ffbb2ac 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.context.ShardingItemParameters; import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParameters.java similarity index 97% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParameters.java index 862d7fdaf7..e2fc8bca8c 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParameters.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParameters.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import com.google.common.base.Strings; import lombok.AllArgsConstructor; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParametersTest.java similarity index 96% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParametersTest.java index 432efe2386..661db7c863 100755 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/ShardingItemParametersTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParametersTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.junit.jupiter.api.Test; From e3e9dec0a6b7e6ac8b44950c9bcb590a3e216d90 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Thu, 26 Oct 2023 22:54:18 +0800 Subject: [PATCH 094/178] Remove Reloadable (#2318) * Remove ExecutorContext * Remove ExecutorContext * Move ExecutorServiceReloadable to kernel module * Remove Reloadable * Remove Reloadable * Remove Reloadable --- ...able.java => JobErrorHandlerReloader.java} | 44 +++++------- ....java => JobErrorHandlerReloaderTest.java} | 40 +++++------ ecosystem/executor/kernel/pom.xml | 5 ++ .../executor/ElasticJobExecutor.java | 23 +++--- .../executor/context/ExecutorContext.java | 71 ------------------- .../threadpool/ElasticJobExecutorService.java | 2 +- .../threadpool/ExecutorServiceReloader.java | 48 +++++-------- .../JobExecutorThreadPoolSizeProvider.java | 2 +- ...sageJobExecutorThreadPoolSizeProvider.java | 4 +- ...readJobExecutorThreadPoolSizeProvider.java | 4 +- ...eadpool.JobExecutorThreadPoolSizeProvider} | 3 +- .../ElasticJobExecutorServiceTest.java | 5 +- .../ExecutorServiceReloaderTest.java | 40 +++++------ ...JobExecutorThreadPoolSizeProviderTest.java | 4 +- ...JobExecutorThreadPoolSizeProviderTest.java | 4 +- .../elasticjob/infra/context/Reloadable.java | 57 --------------- ...sphere.elasticjob.infra.context.Reloadable | 18 ----- ...readpool.JobExecutorThreadPoolSizeProvider | 19 ----- 18 files changed, 107 insertions(+), 286 deletions(-) rename ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/{JobErrorHandlerReloadable.java => JobErrorHandlerReloader.java} (57%) rename ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/{JobErrorHandlerReloadableTest.java => JobErrorHandlerReloaderTest.java} (64%) delete mode 100644 ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor}/threadpool/ElasticJobExecutorService.java (97%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadable.java => ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloader.java (59%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor}/threadpool/JobExecutorThreadPoolSizeProvider.java (94%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor}/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java (88%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor}/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java (87%) rename ecosystem/{error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable => executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider} (78%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor}/threadpool/ElasticJobExecutorServiceTest.java (93%) rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadableTest.java => ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloaderTest.java (60%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor}/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java (88%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor}/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java (87%) delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java delete mode 100644 infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable delete mode 100644 infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloader.java similarity index 57% rename from ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java rename to ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloader.java index f81bfc91b4..3d5a68a8e5 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadable.java +++ b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloader.java @@ -17,57 +17,47 @@ package org.apache.shardingsphere.elasticjob.error.handler; -import lombok.extern.slf4j.Slf4j; +import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; -import java.util.Optional; +import java.io.Closeable; import java.util.Properties; /** - * JobErrorHandler reloadable. + * Job error handler reloader. */ -@Slf4j -public final class JobErrorHandlerReloadable implements Reloadable { +public final class JobErrorHandlerReloader implements Closeable { private Properties props; + @Getter private JobErrorHandler jobErrorHandler; - @Override - public void init(final JobConfiguration jobConfig) { - props = (Properties) jobConfig.getProps().clone(); - jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobConfig.getJobErrorHandlerType(), props); + public JobErrorHandlerReloader(final JobConfiguration jobConfig) { + init(jobConfig); } - @Override + /** + * Reload if necessary. + * + * @param jobConfig job configuration + */ public synchronized void reloadIfNecessary(final JobConfiguration jobConfig) { if (jobErrorHandler.getType().equals(jobConfig.getJobErrorHandlerType()) && props.equals(jobConfig.getProps())) { return; } - log.debug("JobErrorHandler reload occurred in the job '{}'. Change from '{}' to '{}'.", jobConfig.getJobName(), jobErrorHandler.getType(), jobConfig.getJobErrorHandlerType()); - reload(jobConfig.getJobErrorHandlerType(), jobConfig.getProps()); - } - - private void reload(final String jobErrorHandlerType, final Properties props) { jobErrorHandler.close(); - this.props = (Properties) props.clone(); - jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobErrorHandlerType, props); + init(jobConfig); } - @Override - public JobErrorHandler getInstance() { - return jobErrorHandler; - } - - @Override - public Class getType() { - return JobErrorHandler.class; + private void init(final JobConfiguration jobConfig) { + props = jobConfig.getProps(); + jobErrorHandler = TypedSPILoader.getService(JobErrorHandler.class, jobConfig.getJobErrorHandlerType(), props); } @Override public void close() { - Optional.ofNullable(jobErrorHandler).ifPresent(JobErrorHandler::close); + jobErrorHandler.close(); } } diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloaderTest.java similarity index 64% rename from ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java rename to ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloaderTest.java index 61973a9493..faf4a697dd 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloadableTest.java +++ b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloaderTest.java @@ -32,24 +32,21 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -class JobErrorHandlerReloadableTest { +class JobErrorHandlerReloaderTest { @Mock private JobErrorHandler jobErrorHandler; @Test void assertInitialize() { - try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); - assertNull(jobErrorHandlerReloadable.getInstance()); - jobErrorHandlerReloadable.init(jobConfig); - JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { + JobErrorHandler actual = jobErrorHandlerReloader.getJobErrorHandler(); assertNotNull(actual); assertThat(actual.getType(), is("IGNORE")); assertTrue(actual instanceof IgnoreJobErrorHandler); @@ -58,15 +55,16 @@ void assertInitialize() { @Test void assertReload() { - try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { when(jobErrorHandler.getType()).thenReturn("mock"); - setField(jobErrorHandlerReloadable, "jobErrorHandler", jobErrorHandler); - setField(jobErrorHandlerReloadable, "props", new Properties()); + setField(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); + setField(jobErrorHandlerReloader, "props", new Properties()); String newJobErrorHandlerType = "LOG"; JobConfiguration newJobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(newJobErrorHandlerType).build(); - jobErrorHandlerReloadable.reloadIfNecessary(newJobConfig); + jobErrorHandlerReloader.reloadIfNecessary(newJobConfig); verify(jobErrorHandler).close(); - JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); + JobErrorHandler actual = jobErrorHandlerReloader.getJobErrorHandler(); assertThat(actual.getType(), is(newJobErrorHandlerType)); assertTrue(actual instanceof LogJobErrorHandler); } @@ -74,21 +72,21 @@ void assertReload() { @Test void assertUnnecessaryToReload() { - try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); - jobErrorHandlerReloadable.init(jobConfig); - JobErrorHandler expected = jobErrorHandlerReloadable.getInstance(); - jobErrorHandlerReloadable.reloadIfNecessary(jobConfig); - JobErrorHandler actual = jobErrorHandlerReloadable.getInstance(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { + JobErrorHandler expected = jobErrorHandlerReloader.getJobErrorHandler(); + jobErrorHandlerReloader.reloadIfNecessary(jobConfig); + JobErrorHandler actual = jobErrorHandlerReloader.getJobErrorHandler(); assertThat(actual, is(expected)); } } @Test void assertShutdown() { - try (JobErrorHandlerReloadable jobErrorHandlerReloadable = new JobErrorHandlerReloadable()) { - setField(jobErrorHandlerReloadable, "jobErrorHandler", jobErrorHandler); - jobErrorHandlerReloadable.close(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { + setField(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); + jobErrorHandlerReloader.close(); verify(jobErrorHandler).close(); } } diff --git a/ecosystem/executor/kernel/pom.xml b/ecosystem/executor/kernel/pom.xml index 6b285ae819..fda6b0f7b4 100644 --- a/ecosystem/executor/kernel/pom.xml +++ b/ecosystem/executor/kernel/pom.xml @@ -47,5 +47,10 @@ elasticjob-error-handler-general ${project.parent.version} + + + org.awaitility + awaitility + diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java index 5c3e7dbb5f..817d18229d 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; -import org.apache.shardingsphere.elasticjob.executor.context.ExecutorContext; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerReloader; import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor; import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutorFactory; import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; @@ -29,6 +29,7 @@ import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.executor.threadpool.ExecutorServiceReloader; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent.ExecutionSource; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; @@ -52,7 +53,9 @@ public final class ElasticJobExecutor { private final JobItemExecutor jobItemExecutor; - private final ExecutorContext executorContext; + private final ExecutorServiceReloader executorServiceReloader; + + private final JobErrorHandlerReloader jobErrorHandlerReloader; private final Map itemErrorMessages; @@ -68,7 +71,9 @@ private ElasticJobExecutor(final ElasticJob elasticJob, final JobConfiguration j this.elasticJob = elasticJob; this.jobFacade = jobFacade; this.jobItemExecutor = jobItemExecutor; - executorContext = new ExecutorContext(jobFacade.loadJobConfiguration(true)); + JobConfiguration loadedJobConfig = jobFacade.loadJobConfiguration(true); + executorServiceReloader = new ExecutorServiceReloader(loadedJobConfig); + jobErrorHandlerReloader = new JobErrorHandlerReloader(loadedJobConfig); itemErrorMessages = new ConcurrentHashMap<>(jobConfig.getShardingTotalCount(), 1); } @@ -77,8 +82,9 @@ private ElasticJobExecutor(final ElasticJob elasticJob, final JobConfiguration j */ public void execute() { JobConfiguration jobConfig = jobFacade.loadJobConfiguration(true); - executorContext.reloadIfNecessary(jobConfig); - JobErrorHandler jobErrorHandler = executorContext.get(JobErrorHandler.class); + executorServiceReloader.reloadIfNecessary(jobConfig); + jobErrorHandlerReloader.reloadIfNecessary(jobConfig); + JobErrorHandler jobErrorHandler = jobErrorHandlerReloader.getJobErrorHandler(); try { jobFacade.checkJobExecutionEnvironment(); } catch (final JobExecutionEnvironmentException cause) { @@ -147,7 +153,7 @@ private void process(final JobConfiguration jobConfig, final ShardingContexts sh CountDownLatch latch = new CountDownLatch(items.size()); for (int each : items) { JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(IpUtils.getHostName(), IpUtils.getIp(), shardingContexts.getTaskId(), jobConfig.getJobName(), executionSource, each); - ExecutorService executorService = executorContext.get(ExecutorService.class); + ExecutorService executorService = executorServiceReloader.getExecutorService(); if (executorService.isShutdown()) { return; } @@ -182,7 +188,7 @@ private void process(final JobConfiguration jobConfig, final ShardingContexts sh completeEvent = startEvent.executionFailure(ExceptionUtils.transform(cause)); jobFacade.postJobExecutionEvent(completeEvent); itemErrorMessages.put(item, ExceptionUtils.transform(cause)); - JobErrorHandler jobErrorHandler = executorContext.get(JobErrorHandler.class); + JobErrorHandler jobErrorHandler = jobErrorHandlerReloader.getJobErrorHandler(); jobErrorHandler.handleException(jobConfig.getJobName(), cause); } } @@ -191,6 +197,7 @@ private void process(final JobConfiguration jobConfig, final ShardingContexts sh * Shutdown executor. */ public void shutdown() { - executorContext.shutdown(); + executorServiceReloader.close(); + jobErrorHandlerReloader.close(); } } diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java deleted file mode 100644 index 858ff744e5..0000000000 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/context/ExecutorContext.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.elasticjob.executor.context; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; -import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; -import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; - -import java.io.IOException; -import java.util.Properties; - -/** - * Executor context. - */ -public final class ExecutorContext { - - public ExecutorContext(final JobConfiguration jobConfig) { - for (Reloadable each : ShardingSphereServiceLoader.getServiceInstances(Reloadable.class)) { - each.init(jobConfig); - } - } - - /** - * Reload all reloadable item if necessary. - * - * @param jobConfig job configuration - */ - public void reloadIfNecessary(final JobConfiguration jobConfig) { - ShardingSphereServiceLoader.getServiceInstances(Reloadable.class).forEach(each -> each.reloadIfNecessary(jobConfig)); - } - - /** - * Get instance. - * - * @param targetClass target class - * @param target type - * @return instance - */ - @SuppressWarnings("unchecked") - public T get(final Class targetClass) { - return (T) TypedSPILoader.getService(Reloadable.class, targetClass, new Properties()).getInstance(); - } - - /** - * Shutdown all closeable instances. - */ - public void shutdown() { - for (Reloadable each : ShardingSphereServiceLoader.getServiceInstances(Reloadable.class)) { - try { - each.close(); - } catch (final IOException ignored) { - } - } - } -} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorService.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorService.java similarity index 97% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorService.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorService.java index f361a95955..0dc38cb80e 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorService.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool; +package org.apache.shardingsphere.elasticjob.executor.threadpool; import com.google.common.util.concurrent.MoreExecutors; import org.apache.commons.lang3.concurrent.BasicThreadFactory; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadable.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloader.java similarity index 59% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadable.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloader.java index 375b2d77c4..6c3e771934 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadable.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloader.java @@ -15,60 +15,50 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool; +package org.apache.shardingsphere.elasticjob.executor.threadpool; -import lombok.extern.slf4j.Slf4j; +import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.context.Reloadable; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; -import java.util.Optional; +import java.io.Closeable; import java.util.concurrent.ExecutorService; /** - * Executor service reloadable. + * Executor service reloader. */ -@Slf4j -public final class ExecutorServiceReloadable implements Reloadable { +public final class ExecutorServiceReloader implements Closeable { private String jobExecutorThreadPoolSizeProviderType; + @Getter private ExecutorService executorService; - @Override - public void init(final JobConfiguration jobConfig) { - JobExecutorThreadPoolSizeProvider jobExecutorThreadPoolSizeProvider = TypedSPILoader.getService(JobExecutorThreadPoolSizeProvider.class, jobConfig.getJobExecutorThreadPoolSizeProviderType()); - jobExecutorThreadPoolSizeProviderType = jobExecutorThreadPoolSizeProvider.getType(); - executorService = new ElasticJobExecutorService("elasticjob-" + jobConfig.getJobName(), jobExecutorThreadPoolSizeProvider.getSize()).createExecutorService(); + public ExecutorServiceReloader(final JobConfiguration jobConfig) { + init(jobConfig); } - @Override + /** + * Reload if necessary. + * + * @param jobConfig job configuration + */ public synchronized void reloadIfNecessary(final JobConfiguration jobConfig) { if (jobExecutorThreadPoolSizeProviderType.equals(jobConfig.getJobExecutorThreadPoolSizeProviderType())) { return; } - log.debug("Reload occurred in the job '{}'. Change from '{}' to '{}'.", jobConfig.getJobName(), jobExecutorThreadPoolSizeProviderType, jobConfig.getJobExecutorThreadPoolSizeProviderType()); - reload(jobConfig.getJobExecutorThreadPoolSizeProviderType(), jobConfig.getJobName()); - } - - private void reload(final String jobExecutorThreadPoolSizeProviderType, final String jobName) { executorService.shutdown(); - executorService = new ElasticJobExecutorService( - "elasticjob-" + jobName, TypedSPILoader.getService(JobExecutorThreadPoolSizeProvider.class, jobExecutorThreadPoolSizeProviderType).getSize()).createExecutorService(); + init(jobConfig); } - @Override - public ExecutorService getInstance() { - return executorService; + private void init(final JobConfiguration jobConfig) { + JobExecutorThreadPoolSizeProvider jobExecutorThreadPoolSizeProvider = TypedSPILoader.getService(JobExecutorThreadPoolSizeProvider.class, jobConfig.getJobExecutorThreadPoolSizeProviderType()); + jobExecutorThreadPoolSizeProviderType = jobExecutorThreadPoolSizeProvider.getType(); + executorService = new ElasticJobExecutorService("elasticjob-" + jobConfig.getJobName(), jobExecutorThreadPoolSizeProvider.getSize()).createExecutorService(); } @Override public void close() { - Optional.ofNullable(executorService).ifPresent(ExecutorService::shutdown); - } - - @Override - public Class getType() { - return ExecutorService.class; + executorService.shutdown(); } } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/JobExecutorThreadPoolSizeProvider.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/JobExecutorThreadPoolSizeProvider.java similarity index 94% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/JobExecutorThreadPoolSizeProvider.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/JobExecutorThreadPoolSizeProvider.java index 009c4f1b55..a2e29883b6 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/JobExecutorThreadPoolSizeProvider.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/JobExecutorThreadPoolSizeProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool; +package org.apache.shardingsphere.elasticjob.executor.threadpool; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java similarity index 88% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java index 1dfe249ed8..1903142c9f 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool.type; +package org.apache.shardingsphere.elasticjob.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with use CPU available processors. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java similarity index 87% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java rename to ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java index 0539262f79..1248e30579 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java +++ b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool.type; +package org.apache.shardingsphere.elasticjob.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with single thread. diff --git a/ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable b/ecosystem/executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider similarity index 78% rename from ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable rename to ecosystem/executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider index 0a00a1dcec..40f0e643db 100644 --- a/ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable +++ b/ecosystem/executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider @@ -15,4 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerReloadable +org.apache.shardingsphere.elasticjob.executor.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.executor.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorServiceTest.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorServiceTest.java similarity index 93% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorServiceTest.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorServiceTest.java index a03878a90a..293bfbf62e 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ElasticJobExecutorServiceTest.java +++ b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorServiceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool; +package org.apache.shardingsphere.elasticjob.executor.threadpool; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; @@ -61,8 +61,7 @@ static class FooTask implements Runnable { @Override public void run() { - Awaitility.await().atMost(1L, TimeUnit.MINUTES) - .untilAsserted(() -> assertThat(hasExecuted, is(true))); + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(hasExecuted, is(true))); } } } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadableTest.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloaderTest.java similarity index 60% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadableTest.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloaderTest.java index ef6b112730..92f54d8773 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/ExecutorServiceReloadableTest.java +++ b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloaderTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool; +package org.apache.shardingsphere.elasticjob.executor.threadpool; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -31,22 +31,19 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.mockito.Mockito.verify; @ExtendWith(MockitoExtension.class) -class ExecutorServiceReloadableTest { +class ExecutorServiceReloaderTest { @Mock private ExecutorService mockExecutorService; @Test void assertInitialize() { - try (ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable()) { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").build(); - assertNull(executorServiceReloadable.getInstance()); - executorServiceReloadable.init(jobConfig); - ExecutorService actual = executorServiceReloadable.getInstance(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").build(); + try (ExecutorServiceReloader executorServiceReloader = new ExecutorServiceReloader(jobConfig)) { + ExecutorService actual = executorServiceReloader.getExecutorService(); assertNotNull(actual); assertFalse(actual.isShutdown()); assertFalse(actual.isTerminated()); @@ -56,13 +53,13 @@ void assertInitialize() { @Test void assertReload() { - ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); - setField(executorServiceReloadable, "jobExecutorThreadPoolSizeProviderType", "mock"); - setField(executorServiceReloadable, "executorService", mockExecutorService); + ExecutorServiceReloader executorServiceReloader = new ExecutorServiceReloader(JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").build()); + setField(executorServiceReloader, "jobExecutorThreadPoolSizeProviderType", "mock"); + setField(executorServiceReloader, "executorService", mockExecutorService); JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).build(); - executorServiceReloadable.reloadIfNecessary(jobConfig); + executorServiceReloader.reloadIfNecessary(jobConfig); verify(mockExecutorService).shutdown(); - ExecutorService actual = executorServiceReloadable.getInstance(); + ExecutorService actual = executorServiceReloader.getExecutorService(); assertFalse(actual.isShutdown()); assertFalse(actual.isTerminated()); actual.shutdown(); @@ -70,12 +67,11 @@ void assertReload() { @Test void assertUnnecessaryToReload() { - try (ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable()) { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("CPU").build(); - executorServiceReloadable.init(jobConfig); - ExecutorService expected = executorServiceReloadable.getInstance(); - executorServiceReloadable.reloadIfNecessary(jobConfig); - ExecutorService actual = executorServiceReloadable.getInstance(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("CPU").build(); + try (ExecutorServiceReloader executorServiceReloader = new ExecutorServiceReloader(jobConfig)) { + ExecutorService expected = executorServiceReloader.getExecutorService(); + executorServiceReloader.reloadIfNecessary(jobConfig); + ExecutorService actual = executorServiceReloader.getExecutorService(); assertThat(actual, is(expected)); actual.shutdown(); } @@ -83,9 +79,9 @@ void assertUnnecessaryToReload() { @Test void assertShutdown() { - ExecutorServiceReloadable executorServiceReloadable = new ExecutorServiceReloadable(); - setField(executorServiceReloadable, "executorService", mockExecutorService); - executorServiceReloadable.close(); + ExecutorServiceReloader executorServiceReloader = new ExecutorServiceReloader(JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").build()); + setField(executorServiceReloader, "executorService", mockExecutorService); + executorServiceReloader.close(); verify(mockExecutorService).shutdown(); } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java similarity index 88% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java index ba613c3e9d..50b61a8642 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java +++ b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool.type; +package org.apache.shardingsphere.elasticjob.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java similarity index 87% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java rename to ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java index af7efe5a7b..97119b5cec 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java +++ b/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.threadpool.type; +package org.apache.shardingsphere.elasticjob.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java deleted file mode 100644 index f0a5d52188..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/Reloadable.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.elasticjob.infra.context; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; -import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; - -import java.io.Closeable; - -/** - * Reloadable. - * - * @param reload target - */ -@SingletonSPI -public interface Reloadable extends TypedSPI, Closeable { - - /** - * Initialize reloadable. - * - * @param jobConfig job configuration - */ - void init(JobConfiguration jobConfig); - - /** - * Reload if necessary. - * - * @param jobConfig job configuration - */ - void reloadIfNecessary(JobConfiguration jobConfig); - - /** - * Get target instance. - * - * @return instance - */ - T getInstance(); - - @Override - Class getType(); -} diff --git a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable deleted file mode 100644 index 6a5c61ca1e..0000000000 --- a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.context.Reloadable +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.infra.threadpool.ExecutorServiceReloadable diff --git a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider b/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider deleted file mode 100644 index f8f1d2c7cc..0000000000 --- a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.threadpool.JobExecutorThreadPoolSizeProvider +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.infra.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider -org.apache.shardingsphere.elasticjob.infra.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider From 125f06fdb18faec3bc0d4a30e8221d3f111fe3b6 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Thu, 26 Oct 2023 23:45:24 +0800 Subject: [PATCH 095/178] Move TaskContext to kernel module (#2319) * Move TaskContext to kernel module * Move TaskContext to kernel module --- .../elasticjob/tracing/event/JobStatusTraceEvent.java | 2 +- .../kernel/internal}/context/ExecutionType.java | 2 +- .../kernel/internal}/context/TaskContext.java | 2 +- .../elasticjob/kernel/internal/schedule/LiteJob.java | 2 +- .../kernel/internal/schedule/LiteJobFacade.java | 2 +- .../kernel/internal}/context/TaskContextTest.java | 11 ++++++----- .../kernel/internal}/context/fixture/TaskNode.java | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/context/ExecutionType.java (93%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/context/TaskContext.java (98%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/context/TaskContextTest.java (91%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/context/fixture/TaskNode.java (90%) diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java index cef09d3fd9..91b938c8b8 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java @@ -28,8 +28,8 @@ /** * Job status trace event. */ -@RequiredArgsConstructor @AllArgsConstructor +@RequiredArgsConstructor @Getter public final class JobStatusTraceEvent implements JobEvent { diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/ExecutionType.java similarity index 93% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/ExecutionType.java index fb7cff1b4e..8d771282fa 100755 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/ExecutionType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.kernel.internal.context; /** * Execution type. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java similarity index 98% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java index e2f32ec664..f416b4d71c 100755 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.kernel.internal.context; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java index 4d828f1d48..8189e05c06 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java @@ -23,7 +23,7 @@ import org.quartz.JobExecutionContext; /** - * Lite job class. + * Lite job. */ @Setter public final class LiteJob implements Job { diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java index 479f720da1..593c856a45 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java similarity index 91% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java index c5f2f26fd0..9d10370181 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.kernel.internal.context; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.infra.context.fixture.TaskNode; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode; +import org.hamcrest.CoreMatchers; import org.junit.jupiter.api.Test; import java.util.Collections; @@ -36,7 +37,7 @@ void assertNew() { TaskContext actual = new TaskContext("test_job", Collections.singletonList(0), ExecutionType.READY, "slave-S0"); assertThat(actual.getMetaInfo().getJobName(), is("test_job")); assertThat(actual.getMetaInfo().getShardingItems().get(0), is(0)); - assertThat(actual.getType(), is(ExecutionType.READY)); + assertThat(actual.getType(), CoreMatchers.is(ExecutionType.READY)); assertThat(actual.getSlaveId(), is("slave-S0")); assertThat(actual.getId(), startsWith(TaskNode.builder().build().getTaskNodeValue().substring(0, TaskNode.builder().build().getTaskNodeValue().length() - 1))); } @@ -59,7 +60,7 @@ void assertTaskContextFrom() { assertThat(actual.getId(), is(TaskNode.builder().build().getTaskNodeValue())); assertThat(actual.getMetaInfo().getJobName(), is("test_job")); assertThat(actual.getMetaInfo().getShardingItems().get(0), is(0)); - assertThat(actual.getType(), is(ExecutionType.READY)); + assertThat(actual.getType(), CoreMatchers.is(ExecutionType.READY)); assertThat(actual.getSlaveId(), is("slave-S0")); } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java similarity index 90% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java index 94202fb856..7c8ed00240 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture; import lombok.Builder; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.ExecutionType; @Builder public final class TaskNode { From 38a2a41aba56c5b369af5585f76ea5ad1b15f702 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Thu, 26 Oct 2023 23:53:03 +0800 Subject: [PATCH 096/178] Refactor JobStatusTraceEvent --- .../tracing/event/JobStatusTraceEvent.java | 3 ++- .../tracing/rdb/storage/RDBJobEventStorage.java | 5 +++-- .../tracing/rdb/listener/RDBTracingListenerTest.java | 3 ++- .../tracing/rdb/storage/RDBJobEventStorageTest.java | 9 +++++---- .../elasticjob/infra}/context/ExecutionType.java | 2 +- .../elasticjob/infra}/context/TaskContext.java | 2 +- .../elasticjob/infra}/context/TaskContextTest.java | 6 +++--- .../elasticjob/infra}/context/fixture/TaskNode.java | 4 ++-- .../kernel/internal/schedule/LiteJobFacade.java | 12 ++++++------ 9 files changed, 25 insertions(+), 21 deletions(-) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal => infra/src/main/java/org/apache/shardingsphere/elasticjob/infra}/context/ExecutionType.java (93%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal => infra/src/main/java/org/apache/shardingsphere/elasticjob/infra}/context/TaskContext.java (98%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal => infra/src/test/java/org/apache/shardingsphere/elasticjob/infra}/context/TaskContextTest.java (95%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal => infra/src/test/java/org/apache/shardingsphere/elasticjob/infra}/context/fixture/TaskNode.java (90%) diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java index 91b938c8b8..eabb3ae9d5 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java @@ -21,6 +21,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; +import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import java.util.Date; import java.util.UUID; @@ -44,7 +45,7 @@ public final class JobStatusTraceEvent implements JobEvent { private final String slaveId; - private final String executionType; + private final ExecutionType executionType; private final String shardingItems; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 9680901d38..e56845694c 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -19,6 +19,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; +import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; @@ -343,7 +344,7 @@ public boolean addJobStatusTraceEvent(final JobStatusTraceEvent jobStatusTraceEv preparedStatement.setString(3, originalTaskId); preparedStatement.setString(4, jobStatusTraceEvent.getTaskId()); preparedStatement.setString(5, jobStatusTraceEvent.getSlaveId()); - preparedStatement.setString(6, jobStatusTraceEvent.getExecutionType()); + preparedStatement.setString(6, jobStatusTraceEvent.getExecutionType().name()); preparedStatement.setString(7, jobStatusTraceEvent.getShardingItems()); preparedStatement.setString(8, jobStatusTraceEvent.getState().toString()); preparedStatement.setString(9, truncateString(jobStatusTraceEvent.getMessage())); @@ -388,7 +389,7 @@ List getJobStatusTraceEvents(final String taskId) { try (ResultSet resultSet = preparedStatement.executeQuery()) { while (resultSet.next()) { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), - resultSet.getString(5), resultSet.getString(6), resultSet.getString(7), + resultSet.getString(5), ExecutionType.valueOf(resultSet.getString(6)), resultSet.getString(7), State.valueOf(resultSet.getString(8)), resultSet.getString(9), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(resultSet.getString(10))); result.add(jobStatusTraceEvent); } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 5c4213c872..c1917ec028 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -19,6 +19,7 @@ import lombok.SneakyThrows; import org.apache.commons.dbcp2.BasicDataSource; +import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; @@ -76,7 +77,7 @@ void assertPostJobExecutionEvent() { @Test void assertPostJobStatusTraceEvent() { - JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(JOB_NAME, "fake_task_id", "fake_slave_id", "READY", "0", State.TASK_RUNNING, "message is empty."); + JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(JOB_NAME, "fake_task_id", "fake_slave_id", ExecutionType.READY, "0", State.TASK_RUNNING, "message is empty."); jobTracingEventBus.post(jobStatusTraceEvent); verify(repository, atMost(1)).addJobStatusTraceEvent(jobStatusTraceEvent); } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index 13d9968fe1..2549c1bd70 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -18,6 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; import org.apache.commons.dbcp2.BasicDataSource; +import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; @@ -64,13 +65,13 @@ void assertAddJobExecutionEvent() { @Test void assertAddJobStatusTraceEvent() { assertTrue(storage.addJobStatusTraceEvent( - new JobStatusTraceEvent("test_job", "fake_task_id", "fake_slave_id", "READY", "0", State.TASK_RUNNING, "message is empty."))); + new JobStatusTraceEvent("test_job", "fake_task_id", "fake_slave_id", ExecutionType.READY, "0", State.TASK_RUNNING, "message is empty."))); } @Test void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failover_task_id", "fake_slave_id", "FAILOVER", "0", State.TASK_STAGING, "message is empty."); + "test_job", "fake_failover_task_id", "fake_slave_id", ExecutionType.FAILOVER, "0", State.TASK_STAGING, "message is empty."); jobStatusTraceEvent.setOriginalTaskId("original_fake_failover_task_id"); assertThat(storage.getJobStatusTraceEvents("fake_failover_task_id").size(), is(0)); storage.addJobStatusTraceEvent(jobStatusTraceEvent); @@ -80,11 +81,11 @@ void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { @Test void assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState() { JobStatusTraceEvent stagingJobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failed_failover_task_id", "fake_slave_id", "FAILOVER", "0", State.TASK_STAGING, "message is empty."); + "test_job", "fake_failed_failover_task_id", "fake_slave_id", ExecutionType.FAILOVER, "0", State.TASK_STAGING, "message is empty."); stagingJobStatusTraceEvent.setOriginalTaskId("original_fake_failed_failover_task_id"); storage.addJobStatusTraceEvent(stagingJobStatusTraceEvent); JobStatusTraceEvent failedJobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failed_failover_task_id", "fake_slave_id", "FAILOVER", "0", State.TASK_FAILED, "message is empty."); + "test_job", "fake_failed_failover_task_id", "fake_slave_id", ExecutionType.FAILOVER, "0", State.TASK_FAILED, "message is empty."); storage.addJobStatusTraceEvent(failedJobStatusTraceEvent); List jobStatusTraceEvents = storage.getJobStatusTraceEvents("fake_failed_failover_task_id"); assertThat(jobStatusTraceEvents.size(), is(2)); diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/ExecutionType.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/ExecutionType.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java index 8d771282fa..fb7cff1b4e 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/ExecutionType.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.context; +package org.apache.shardingsphere.elasticjob.infra.context; /** * Execution type. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java index f416b4d71c..e2f32ec664 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.context; +package org.apache.shardingsphere.elasticjob.infra.context; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java index 9d10370181..fdab984b7a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.context; +package org.apache.shardingsphere.elasticjob.infra.context; -import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode; +import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; +import org.apache.shardingsphere.elasticjob.infra.context.fixture.TaskNode; import org.hamcrest.CoreMatchers; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java similarity index 90% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java index 7c8ed00240..94202fb856 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture; +package org.apache.shardingsphere.elasticjob.infra.context.fixture; import lombok.Builder; -import org.apache.shardingsphere.elasticjob.kernel.internal.context.ExecutionType; +import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; @Builder public final class TaskNode { diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java index 593c856a45..cdf49260d0 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java @@ -20,16 +20,16 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.executor.JobFacade; +import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; +import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; @@ -163,7 +163,7 @@ public void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { public void postJobStatusTraceEvent(final String taskId, final State state, final String message) { TaskContext taskContext = TaskContext.from(taskId); jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), - taskContext.getSlaveId(), taskContext.getType().name(), taskContext.getMetaInfo().getShardingItems().toString(), state, message)); + taskContext.getSlaveId(), taskContext.getType(), taskContext.getMetaInfo().getShardingItems().toString(), state, message)); if (!Strings.isNullOrEmpty(message)) { log.trace(message); } From fe6ea55e21dfecb51f62926bc09eb924836b95ae Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:01:40 +0800 Subject: [PATCH 097/178] Move TimeService --- .../api/listener/AbstractDistributeOnceElasticJobListener.java | 2 +- .../kernel/internal/config/ConfigurationService.java | 2 +- .../elasticjob/kernel/internal/time}/TimeService.java | 2 +- .../api/listener/DistributeOnceElasticJobListenerTest.java | 2 +- .../elasticjob/kernel/time}/TimeServiceTest.java | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/time}/TimeService.java (93%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/time}/TimeServiceTest.java (89%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java index 33477e7127..69dbb66c8a 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java @@ -19,7 +19,7 @@ import lombok.Setter; import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; -import org.apache.shardingsphere.elasticjob.infra.env.TimeService; +import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java index 4c37a4b0f1..c92cdefcfd 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.infra.env.TimeService; +import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; /** diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeService.java similarity index 93% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeService.java index 77236d6e33..1d08849a6f 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/TimeService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.env; +package org.apache.shardingsphere.elasticjob.kernel.internal.time; /** * Time service. diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java index 11e55d116e..eebcfcf16f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener; import com.google.common.collect.Sets; -import org.apache.shardingsphere.elasticjob.infra.env.TimeService; +import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/time/TimeServiceTest.java similarity index 89% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/time/TimeServiceTest.java index bf08ba5e6b..6bac490370 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/TimeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/time/TimeServiceTest.java @@ -15,8 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.env; +package org.apache.shardingsphere.elasticjob.kernel.time; +import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertTrue; From 4f74a75da59ec2d3e342a786d85eea28c2b44488 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:03:17 +0800 Subject: [PATCH 098/178] Remove useless code --- .../elasticjob/infra/exception/JobExecutionException.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java index 931bf10925..751e040d45 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java @@ -24,10 +24,6 @@ public final class JobExecutionException extends RuntimeException { private static final long serialVersionUID = 1L; - public JobExecutionException(final String errorMessage, final Object... args) { - super(String.format(errorMessage, args)); - } - public JobExecutionException(final Throwable cause) { super(cause); } From cd1f5ca4e6613e9f9a1408463015c22c73537803 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:26:51 +0800 Subject: [PATCH 099/178] Refactor JobExecutionException --- .../elasticjob/infra/exception/JobExecutionException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java index 751e040d45..e5265a55aa 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java @@ -22,7 +22,7 @@ */ public final class JobExecutionException extends RuntimeException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1701186463023700392L; public JobExecutionException(final Throwable cause) { super(cause); From 464fa3420b24a56895159944a5c838b11fecaa68 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:30:18 +0800 Subject: [PATCH 100/178] Refactor GsonFactory --- .../elasticjob/infra/json/GsonFactory.java | 37 +-------------- .../infra/json/GsonFactoryTest.java | 47 ------------------- 2 files changed, 1 insertion(+), 83 deletions(-) diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java index dc7b2f8f55..d5cf897f4f 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java @@ -19,9 +19,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.google.gson.JsonParser; -import com.google.gson.TypeAdapter; -import java.lang.reflect.Type; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -31,22 +28,7 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class GsonFactory { - private static GsonBuilder gsonBuilder = new GsonBuilder(); - - private static volatile Gson gson = gsonBuilder.create(); - - private static final JsonParser JSON_PARSER = new JsonParser(); - - /** - * Register type adapter. - * - * @param type Gson type - * @param typeAdapter Gson type adapter - */ - public static synchronized void registerTypeAdapter(final Type type, final TypeAdapter typeAdapter) { - gsonBuilder.registerTypeAdapter(type, typeAdapter); - gson = gsonBuilder.create(); - } + private static final Gson gson = new GsonBuilder().create(); /** * Get gson instance. @@ -56,21 +38,4 @@ public static synchronized void registerTypeAdapter(final Type type, final TypeA public static Gson getGson() { return gson; } - - /** - * Get json parser. - * - * @return json parser instance - */ - public static JsonParser getJsonParser() { - return JSON_PARSER; - } - - /** - * Re-initialize the GsonBuilder. - */ - public static synchronized void clean() { - gsonBuilder = new GsonBuilder(); - gson = gsonBuilder.create(); - } } diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java index 38b542a551..e74291385b 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java @@ -17,18 +17,10 @@ package org.apache.shardingsphere.elasticjob.infra.json; -import com.google.gson.Gson; -import com.google.gson.JsonParseException; -import com.google.gson.TypeAdapter; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; import org.junit.jupiter.api.Test; -import java.io.IOException; - import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; class GsonFactoryTest { @@ -36,43 +28,4 @@ class GsonFactoryTest { void assertGetGson() { assertThat(GsonFactory.getGson(), is(GsonFactory.getGson())); } - - @Test - void assertRegisterTypeAdapter() { - Gson beforeRegisterGson = GsonFactory.getGson(); - GsonFactory.registerTypeAdapter(GsonFactoryTest.class, new TypeAdapter() { - - @Override - public Object read(final JsonReader in) { - return null; - } - - @Override - public void write(final JsonWriter out, final Object value) throws IOException { - out.jsonValue("test"); - } - }); - assertThat(beforeRegisterGson.toJson(new GsonFactoryTest()), is("{}")); - assertThat(GsonFactory.getGson().toJson(new GsonFactoryTest()), is("test")); - GsonFactory.clean(); - } - - @Test - void assertGetJsonParser() { - assertThat(GsonFactory.getJsonParser(), is(GsonFactory.getJsonParser())); - } - - @Test - void assertParser() { - String json = "{\"name\":\"test\"}"; - assertThat(GsonFactory.getJsonParser().parse(json).getAsJsonObject().get("name").getAsString(), is("test")); - } - - @Test - void assertParserWithException() { - assertThrows(JsonParseException.class, () -> { - String json = "{\"name\":\"test\""; - assertThat(GsonFactory.getJsonParser().parse(json).getAsJsonObject().get("name").getAsString(), is("test")); - }); - } } From 9f25cc93cea91e32b7b935c5e3e83384b331e9c0 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:33:37 +0800 Subject: [PATCH 101/178] Remove useless ElasticJobListenerFactory --- .../listener/ElasticJobListenerFactory.java | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java deleted file mode 100644 index a6fe70e0cb..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListenerFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.elasticjob.infra.listener; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; - -import java.util.Optional; - -/** - * Job listener factory. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ElasticJobListenerFactory { - - /** - * Create a job listener instance. - * - * @param type job listener type - * @return optional job listener instance - */ - public static Optional createListener(final String type) { - return TypedSPILoader.findService(ElasticJobListener.class, type); - } -} From 8990a207f325daa4f9c85e71049b200790182528 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:34:40 +0800 Subject: [PATCH 102/178] Refactor JobInstance --- .../elasticjob/infra/sharding/JobInstance.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java index d282348e93..eb0bc1cf55 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.sharding; +import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -27,6 +28,7 @@ /** * Job instance. */ +@AllArgsConstructor @Getter @Setter @EqualsAndHashCode(of = "jobInstanceId") @@ -51,10 +53,4 @@ public JobInstance(final String jobInstanceId) { public JobInstance(final String jobInstanceId, final String labels) { this(jobInstanceId, labels, IpUtils.getIp()); } - - public JobInstance(final String jobInstanceId, final String labels, final String serverIp) { - this.jobInstanceId = jobInstanceId; - this.labels = labels; - this.serverIp = serverIp; - } } From 86e070d2b43d4553f4549805a887245b43cc8507 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:35:43 +0800 Subject: [PATCH 103/178] Remove useless YamlConfigurationConverterNotFoundException --- ...nfigurationConverterNotFoundException.java | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java deleted file mode 100644 index af2a25dfc9..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/exception/YamlConfigurationConverterNotFoundException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.elasticjob.infra.yaml.exception; - -/** - * Yaml configuration converter not found exception. - */ -public final class YamlConfigurationConverterNotFoundException extends RuntimeException { - - private static final long serialVersionUID = 664042135874000182L; - - public YamlConfigurationConverterNotFoundException(final Class type) { - super(String.format("No YamlConfigurationConverter found for class [%s]", type.getName())); - } -} From c0e07619283d04daea6199b7555dcf480b3a4d9b Mon Sep 17 00:00:00 2001 From: zhangliang Date: Fri, 27 Oct 2023 00:38:31 +0800 Subject: [PATCH 104/178] Fix checkstyle --- .../shardingsphere/elasticjob/infra/json/GsonFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java index d5cf897f4f..23bddddfdc 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java @@ -28,7 +28,7 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class GsonFactory { - private static final Gson gson = new GsonBuilder().create(); + private static final Gson GSON = new GsonBuilder().create(); /** * Get gson instance. @@ -36,6 +36,6 @@ public final class GsonFactory { * @return gson instance */ public static Gson getGson() { - return gson; + return GSON; } } From 64b0e2f9d1417b8f0fcbeed61267f5af99ef9ca2 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Fri, 27 Oct 2023 11:54:06 +0800 Subject: [PATCH 105/178] Move sharding from infra to kernel (#2321) --- .../kernel/internal/election/ElectionListenerManager.java | 2 +- .../kernel/internal/failover/FailoverListenerManager.java | 2 +- .../kernel/internal/failover/FailoverService.java | 2 +- .../kernel/internal/instance/InstanceService.java | 2 +- .../elasticjob/kernel/internal/schedule/JobRegistry.java | 2 +- .../elasticjob/kernel/internal/schedule/JobScheduler.java | 2 +- .../elasticjob/kernel/internal/server/ServerNode.java | 2 +- .../kernel/internal/sharding/ExecutionContextService.java | 1 - .../kernel/internal/sharding/ExecutionService.java | 1 - .../elasticjob/kernel/internal}/sharding/JobInstance.java | 2 +- .../kernel/internal/sharding/ShardingService.java | 3 +-- .../internal/sharding/strategy}/JobShardingStrategy.java | 3 ++- .../type}/AverageAllocationJobShardingStrategy.java | 6 +++--- .../type}/OdevitySortByNameJobShardingStrategy.java | 6 +++--- .../strategy/type}/RoundRobinByNameJobShardingStrategy.java | 6 +++--- .../elasticjob/kernel/internal/trigger/TriggerNode.java | 2 +- ...ob.kernel.internal.sharding.strategy.JobShardingStrategy | 6 +++--- .../internal/config/RescheduleListenerManagerTest.java | 2 +- .../internal/election/ElectionListenerManagerTest.java | 2 +- .../kernel/internal/election/LeaderServiceTest.java | 2 +- .../internal/failover/FailoverListenerManagerTest.java | 2 +- .../kernel/internal/failover/FailoverServiceTest.java | 2 +- .../kernel/internal/instance/InstanceNodeTest.java | 2 +- .../kernel/internal/instance/InstanceServiceTest.java | 2 +- .../internal/instance/ShutdownListenerManagerTest.java | 2 +- .../listener/RegistryCenterConnectionStateListenerTest.java | 2 +- .../kernel/internal/reconcile/ReconcileServiceTest.java | 2 +- .../kernel/internal/schedule/JobRegistryTest.java | 2 +- .../kernel/internal/schedule/SchedulerFacadeTest.java | 2 +- .../elasticjob/kernel/internal/server/ServerNodeTest.java | 2 +- .../kernel/internal/server/ServerServiceTest.java | 2 +- .../elasticjob/kernel/internal/setup/SetUpFacadeTest.java | 2 +- .../internal/sharding/ExecutionContextServiceTest.java | 1 - .../kernel/internal/sharding/ExecutionServiceTest.java | 1 - .../kernel/internal}/sharding/JobInstanceTest.java | 2 +- .../internal/sharding/ShardingListenerManagerTest.java | 1 - .../kernel/internal/sharding/ShardingServiceTest.java | 1 - .../type}/AverageAllocationJobShardingStrategyTest.java | 6 +++--- .../type}/OdevitySortByNameJobShardingStrategyTest.java | 4 ++-- .../type}/RotateServerByNameJobShardingStrategyTest.java | 4 ++-- .../kernel/internal/trigger/TriggerListenerManagerTest.java | 2 +- .../lifecycle/internal/operate/JobOperateAPIImpl.java | 2 +- .../lifecycle/internal/statistics/JobStatisticsAPIImpl.java | 2 +- .../internal/statistics/ServerStatisticsAPIImpl.java | 2 +- .../internal/statistics/ShardingStatisticsAPIImpl.java | 2 +- 45 files changed, 52 insertions(+), 58 deletions(-) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/sharding/JobInstance.java (96%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy}/JobShardingStrategy.java (89%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type}/AverageAllocationJobShardingStrategy.java (93%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type}/OdevitySortByNameJobShardingStrategy.java (89%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type}/RoundRobinByNameJobShardingStrategy.java (88%) rename infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy => kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy (69%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/sharding/JobInstanceTest.java (96%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type}/AverageAllocationJobShardingStrategyTest.java (93%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type}/OdevitySortByNameJobShardingStrategyTest.java (93%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type}/RotateServerByNameJobShardingStrategyTest.java (94%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java index 33b69dee2b..2abdb8615c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.election; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerNode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java index c7c3f77e9d..0d15591b5e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.failover; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java index f6b972e196..3dc7ecf5b8 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverService.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java index e93bbdb6c0..5d3e03e687 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java index 9e5c7b94eb..3a01e2aa3e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistry.java @@ -19,7 +19,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerNotifierManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index c63cb5e03c..d27dac9224 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -25,7 +25,7 @@ import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java index 56a48fc297..45cbdd0d88 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.server; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java index 788ffbb2ac..1aa21f9bd6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java index deac82cf56..b918e4edfa 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java @@ -19,7 +19,6 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstance.java similarity index 96% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstance.java index eb0bc1cf55..02ce1e2f3e 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstance.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstance.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import lombok.AllArgsConstructor; import lombok.EqualsAndHashCode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java index e52e088e83..c4e2f1e98c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java @@ -20,8 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobShardingStrategy.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/JobShardingStrategy.java similarity index 89% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobShardingStrategy.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/JobShardingStrategy.java index 761ee02860..9b627ca457 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobShardingStrategy.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/JobShardingStrategy.java @@ -15,8 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; import java.util.List; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategy.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/AverageAllocationJobShardingStrategy.java similarity index 93% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategy.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/AverageAllocationJobShardingStrategy.java index bb20a1f241..7f26f7bd3f 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategy.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/AverageAllocationJobShardingStrategy.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding.impl; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy; import java.util.ArrayList; import java.util.Collections; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategy.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/OdevitySortByNameJobShardingStrategy.java similarity index 89% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategy.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/OdevitySortByNameJobShardingStrategy.java index c7454fb5a7..6cfbde3c90 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategy.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/OdevitySortByNameJobShardingStrategy.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding.impl; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy; import java.util.Collections; import java.util.List; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RoundRobinByNameJobShardingStrategy.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/RoundRobinByNameJobShardingStrategy.java similarity index 88% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RoundRobinByNameJobShardingStrategy.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/RoundRobinByNameJobShardingStrategy.java index f2843f8a40..043a2844df 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RoundRobinByNameJobShardingStrategy.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/RoundRobinByNameJobShardingStrategy.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding.impl; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy; import java.util.ArrayList; import java.util.List; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java index 33114e051b..262a38e6a9 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerNode.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; diff --git a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy similarity index 69% rename from infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy rename to kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy index 95d09b6bc2..16310868c2 100644 --- a/infra/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy +++ b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy @@ -15,6 +15,6 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.infra.sharding.impl.AverageAllocationJobShardingStrategy -org.apache.shardingsphere.elasticjob.infra.sharding.impl.OdevitySortByNameJobShardingStrategy -org.apache.shardingsphere.elasticjob.infra.sharding.impl.RoundRobinByNameJobShardingStrategy +org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type.AverageAllocationJobShardingStrategy +org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type.OdevitySortByNameJobShardingStrategy +org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type.RoundRobinByNameJobShardingStrategy diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java index a61c9fd0e4..9f2ddd25d1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.config; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java index 7b81a969fd..eca460720a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.election; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java index 48e4bf9543..d5729780cc 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.election; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService.LeaderElectionExecutionCallback; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java index 00de558fd5..3ff61b6e86 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java index 32b249589b..700d42121d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java index 694a71ba90..dff268999d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java index 896e11cc2f..7fbb551c63 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java index a3178ecca6..d6bcf4146f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.SchedulerFacade; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java index 4db4ebecc2..2eaacd6992 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.listener; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java index b2e8a8d86c..c086172ac4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java index 84d6d578c8..c9e8f46c83 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java index 34b5b809a9..b97a253e8c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java index 05e851df0c..2e24ad1826 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNodeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.server; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java index efd8d7fdc0..5352f9f69f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.server; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java index 9d53ac5ac6..0a9393b62e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.setup; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerManager; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java index 01eb0bac40..08d77ff142 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java @@ -19,7 +19,6 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java index 9ea81e0c12..b67b695994 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstanceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstanceTest.java similarity index 96% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstanceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstanceTest.java index f76a2414dc..64f7131bda 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/JobInstanceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstanceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java index 11d83019dd..5782f8d51f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java @@ -19,7 +19,6 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java index 150d5898eb..df8c4f550e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategyTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/AverageAllocationJobShardingStrategyTest.java similarity index 93% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategyTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/AverageAllocationJobShardingStrategyTest.java index ab1338b028..c2fb8a81cd 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/AverageAllocationJobShardingStrategyTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/AverageAllocationJobShardingStrategyTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding.impl; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobShardingStrategy; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy; import org.junit.jupiter.api.Test; import java.util.Arrays; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/OdevitySortByNameJobShardingStrategyTest.java similarity index 93% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/OdevitySortByNameJobShardingStrategyTest.java index 09edfeff91..aa9da98407 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/OdevitySortByNameJobShardingStrategyTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/OdevitySortByNameJobShardingStrategyTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding.impl; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.junit.jupiter.api.Test; import java.util.Arrays; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RotateServerByNameJobShardingStrategyTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/RotateServerByNameJobShardingStrategyTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RotateServerByNameJobShardingStrategyTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/RotateServerByNameJobShardingStrategyTest.java index 0a059d8fa8..45876d5187 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/sharding/impl/RotateServerByNameJobShardingStrategyTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/strategy/type/RotateServerByNameJobShardingStrategyTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.sharding.impl; +package org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.junit.jupiter.api.Test; import java.util.Arrays; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java index 2bfecb6fe3..bb070e647a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.trigger; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java index d15d2fecf6..989ddf5811 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.operate; import com.google.common.base.Preconditions; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index 7af9c48da2..18fb8cabaa 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -19,7 +19,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java index 2fb6c69519..5ddf90e87f 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java index 3e9e808161..69294e87fb 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.sharding.JobInstance; +import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI; From 213c69b923a75030207851539cd6886d1b96d47b Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 04:24:26 +0800 Subject: [PATCH 106/178] Move JobPropertiesValidateRule to error-handler-general module (#2322) * Move JobPropertiesValidateRule to error-handler-general module * Move JobConfigurationPOJO to kernel module * Fix javadoc * Remove useless JobStatisticException * Move TaskContext to kernel module --- ...alkJobErrorHandlerPropertiesValidator.java | 2 +- ...ailJobErrorHandlerPropertiesValidator.java | 2 +- .../handler}/JobPropertiesValidateRule.java | 2 +- .../JobPropertiesValidateRuleTest.java | 2 +- ...hatJobErrorHandlerPropertiesValidator.java | 2 +- .../tracing/event/JobStatusTraceEvent.java | 2 +- .../rdb/storage/RDBJobEventStorage.java | 2 +- .../rdb/listener/RDBTracingListenerTest.java | 2 +- .../rdb/storage/RDBJobEventStorageTest.java | 2 +- .../{context => constant}/ExecutionType.java | 2 +- .../exception/JobStatisticException.java | 30 ------------------ .../exception/JobStatisticExceptionTest.java | 31 ------------------- ...tractDistributeOnceElasticJobListener.java | 2 +- .../internal/config/ConfigurationService.java | 1 - .../config}/JobConfigurationPOJO.java | 2 +- .../config/RescheduleListenerManager.java | 1 - .../kernel/internal}/context/TaskContext.java | 3 +- .../failover/FailoverListenerManager.java | 2 +- .../internal/schedule/LiteJobFacade.java | 2 +- .../MonitorExecutionListenerManager.java | 2 +- .../sharding/ShardingListenerManager.java | 2 +- .../disable/DisabledJobIntegrateTest.java | 2 +- .../enable/EnabledJobIntegrateTest.java | 2 +- .../integrate/OneOffEnabledJobTest.java | 2 +- .../integrate/ScheduleEnabledJobTest.java | 2 +- .../config/ConfigurationServiceTest.java | 1 - .../config}/JobConfigurationPOJOTest.java | 2 +- .../internal}/context/TaskContextTest.java | 7 +++-- .../internal}/context/fixture/TaskNode.java | 4 +-- .../lifecycle/api/JobConfigurationAPI.java | 2 +- .../settings/JobConfigurationAPIImpl.java | 2 +- .../statistics/JobStatisticsAPIImpl.java | 2 +- .../settings/JobConfigurationAPIImplTest.java | 2 +- 33 files changed, 33 insertions(+), 95 deletions(-) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator => ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler}/JobPropertiesValidateRule.java (97%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator => ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler}/JobPropertiesValidateRuleTest.java (97%) rename infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/{context => constant}/ExecutionType.java (94%) delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java delete mode 100644 infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config}/JobConfigurationPOJO.java (98%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/context/TaskContext.java (97%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config}/JobConfigurationPOJOTest.java (99%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/context/TaskContextTest.java (94%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob/infra => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/context/fixture/TaskNode.java (91%) diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java index fa170da705..f5e7a6d75b 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.validator.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.error.handler.JobPropertiesValidateRule; import java.util.Properties; diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java index c16eb2c589..0d47e8e938 100644 --- a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.validator.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.error.handler.JobPropertiesValidateRule; import java.util.Properties; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRule.java similarity index 97% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java rename to ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRule.java index 6c384a49de..79cc3ae05a 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRule.java +++ b/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.validator; +package org.apache.shardingsphere.elasticjob.error.handler; import com.google.common.base.Preconditions; import lombok.AccessLevel; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRuleTest.java similarity index 97% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java rename to ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRuleTest.java index c1a732a074..89ea1872dd 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validator/JobPropertiesValidateRuleTest.java +++ b/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRuleTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.validator; +package org.apache.shardingsphere.elasticjob.error.handler; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java index b885f98530..79385c10f4 100644 --- a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.validator.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.error.handler.JobPropertiesValidateRule; import java.util.Properties; diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java index eabb3ae9d5..7a95a30c74 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java +++ b/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java @@ -21,7 +21,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; +import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; import java.util.Date; import java.util.UUID; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index e56845694c..37e93759bd 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; +import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index c1917ec028..2e37512bb0 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -19,7 +19,7 @@ import lombok.SneakyThrows; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; +import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index 2549c1bd70..b79ebd3cd9 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; +import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/constant/ExecutionType.java similarity index 94% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/constant/ExecutionType.java index fb7cff1b4e..538f68ab13 100755 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/ExecutionType.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/constant/ExecutionType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.infra.constant; /** * Execution type. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java deleted file mode 100644 index d4093ccdb2..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticException.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.elasticjob.infra.exception; - -/** - * Job statistic exception. - */ -public final class JobStatisticException extends RuntimeException { - - private static final long serialVersionUID = -2502533914008085601L; - - public JobStatisticException(final Exception ex) { - super(ex); - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java deleted file mode 100644 index 27b26aef5b..0000000000 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobStatisticExceptionTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.elasticjob.infra.exception; - -import org.junit.jupiter.api.Test; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.MatcherAssert.assertThat; - -class JobStatisticExceptionTest { - - @Test - void assertGetCause() { - assertThat(new JobStatisticException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class)); - } -} diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java index 69dbb66c8a..ce628253b2 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java @@ -28,7 +28,7 @@ import java.util.Set; /** - * Distributed once elasticjob listener. + * Distributed once ElasticJob listener. */ public abstract class AbstractDistributeOnceElasticJobListener implements ElasticJobListener { diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java index c92cdefcfd..10fe3842ba 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java @@ -21,7 +21,6 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java similarity index 98% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java index b0838af173..6419da3072 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJO.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.pojo; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; import lombok.Getter; import lombok.Setter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java index 15546143e0..fe492a14a6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java @@ -19,7 +19,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java similarity index 97% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java index e2f32ec664..f8cdabbd8a 100755 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContext.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.kernel.internal.context; import com.google.common.base.Preconditions; import com.google.common.base.Splitter; @@ -24,6 +24,7 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; +import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; import java.util.Collections; import java.util.List; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java index 0d15591b5e..4c727a4d0d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.failover; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java index cdf49260d0..98eff5cd59 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java index f57b01d75f..21e71013ca 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java index 73249f596d..9b4d2e4489 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java index 9c52f28fc9..4a0da3de21 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java index d163bab5b1..2766f5a560 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.integrate.BaseIntegrateTest; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java index f0b5d7a214..0c84f620ac 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationUnShardingJob; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java index eb1c3cff11..111c9a5ab0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationSimpleJob; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java index d539de0c2d..e10e08c81a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java @@ -21,7 +21,6 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJOTest.java similarity index 99% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJOTest.java index b0dd373c53..6bcd353293 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/pojo/JobConfigurationPOJOTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJOTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.pojo; +package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java index fdab984b7a..4b997dbbab 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/TaskContextTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context; +package org.apache.shardingsphere.elasticjob.kernel.internal.context; -import org.apache.shardingsphere.elasticjob.infra.context.TaskContext.MetaInfo; -import org.apache.shardingsphere.elasticjob.infra.context.fixture.TaskNode; +import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode; import org.hamcrest.CoreMatchers; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java similarity index 91% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java index 94202fb856..295d11302d 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/context/fixture/TaskNode.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.context.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture; import lombok.Builder; -import org.apache.shardingsphere.elasticjob.infra.context.ExecutionType; +import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; @Builder public final class TaskNode { diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java index 7b9b7cd4e5..e69bed1188 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobConfigurationAPI.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.api; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; /** * Job configuration API. diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java index 5f2405ba70..14a6cea1b6 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java @@ -20,7 +20,7 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index 18fb8cabaa..246d678c36 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -20,7 +20,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; import org.apache.shardingsphere.elasticjob.lifecycle.domain.JobBriefInfo; diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java index 1811c573eb..cb9812795e 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImplTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.settings; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.infra.pojo.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI; import org.apache.shardingsphere.elasticjob.lifecycle.fixture.LifecycleYamlConstants; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; From ef15a404c4228388243742258338fde9dab632f6 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 17:49:09 +0800 Subject: [PATCH 107/178] Merge executor-kernel to kernel module (#2323) * Move JobPropertiesValidateRule to error-handler-general module * Move JobConfigurationPOJO to kernel module * Fix javadoc * Remove useless JobStatisticException * Move TaskContext to kernel module * Refactor JobItemExecutor * Add JobRuntimeService * Add JobRuntimeService * Move JobItemExecutor to api module * Add spi.param package * Merge executor-kernel and kernel module * Merge executor-kernel and kernel module * Merge executor-kernel and kernel module * Merge executor-kernel to kernel module * Fix compile error * Fix compile error --- api/pom.xml | 7 + .../elasticjob/spi}/JobItemExecutor.java | 10 +- .../spi/param/JobRuntimeService.java | 16 +-- .../{api => spi/param}/ShardingContext.java | 2 +- .../spi/type}/ClassedJobItemExecutor.java | 4 +- .../spi/type}/TypedJobItemExecutor.java | 4 +- .../elasticjob/annotation/job/CustomJob.java | 2 +- .../annotation/job/impl/SimpleTestJob.java | 2 +- ecosystem/error-handler/type/dingtalk/pom.xml | 5 - ...alkJobErrorHandlerPropertiesValidator.java | 2 +- ecosystem/error-handler/type/email/pom.xml | 5 - ...ailJobErrorHandlerPropertiesValidator.java | 2 +- ecosystem/error-handler/type/general/pom.xml | 40 ------ ...e.elasticjob.error.handler.JobErrorHandler | 20 --- .../src/test/resources/logback-test.xml | 25 ---- ecosystem/error-handler/type/pom.xml | 1 - ecosystem/error-handler/type/wechat/pom.xml | 5 - ...hatJobErrorHandlerPropertiesValidator.java | 2 +- ecosystem/executor/kernel/pom.xml | 56 -------- .../elasticjob/executor/JobFacade.java | 133 ------------------ ....executor.item.impl.ClassedJobItemExecutor | 18 --- ecosystem/executor/pom.xml | 1 - ecosystem/executor/type/dataflow/pom.xml | 2 +- .../executor/DataflowJobExecutor.java | 18 +-- .../elasticjob/dataflow/job/DataflowJob.java | 2 +- ...lasticjob.spi.type.ClassedJobItemExecutor} | 0 .../executor/DataflowJobExecutorTest.java | 12 +- ecosystem/executor/type/http/pom.xml | 2 +- .../http/executor/HttpJobExecutor.java | 12 +- ....elasticjob.spi.type.TypedJobItemExecutor} | 0 .../http/executor/HttpJobExecutorTest.java | 20 +-- ecosystem/executor/type/script/pom.xml | 2 +- .../script/executor/ScriptJobExecutor.java | 10 +- ....elasticjob.spi.type.TypedJobItemExecutor} | 0 .../script/ScriptJobExecutorTest.java | 12 +- ecosystem/executor/type/simple/pom.xml | 2 +- .../simple/executor/SimpleJobExecutor.java | 8 +- .../elasticjob/simple/job/SimpleJob.java | 2 +- ...lasticjob.spi.type.ClassedJobItemExecutor} | 0 .../executor/SimpleJobExecutorTest.java | 6 +- .../elasticjob/simple/job/FooSimpleJob.java | 2 +- .../example/job/dataflow/JavaDataflowJob.java | 2 +- .../job/dataflow/SpringDataflowJob.java | 2 +- .../example/job/simple/JavaOccurErrorJob.java | 2 +- .../example/job/simple/JavaSimpleJob.java | 2 +- .../example/job/simple/SpringSimpleJob.java | 2 +- .../example/job/SpringBootDataflowJob.java | 2 +- ...SpringBootOccurErrorNoticeDingtalkJob.java | 2 +- .../SpringBootOccurErrorNoticeEmailJob.java | 2 +- .../SpringBootOccurErrorNoticeWechatJob.java | 2 +- .../example/job/SpringBootSimpleJob.java | 2 +- infra/pom.xml | 5 - .../infra/listener/ShardingContexts.java | 2 +- .../validate}/JobPropertiesValidateRule.java | 2 +- .../infra/listener/ShardingContextsTest.java | 2 +- .../JobPropertiesValidateRuleTest.java | 26 ++-- kernel/pom.xml | 5 + .../executor/ElasticJobExecutor.java | 14 +- .../JobFacade.java} | 108 +++++++++++--- .../executor/JobJobRuntimeServiceImpl.java | 24 ++-- .../handler/JobErrorHandlerReloader.java | 3 +- .../general/IgnoreJobErrorHandler.java | 2 +- .../handler/general/LogJobErrorHandler.java | 2 +- .../handler/general/ThrowJobErrorHandler.java | 2 +- .../executor/item/JobItemExecutorFactory.java | 5 +- .../threadpool/ElasticJobExecutorService.java | 2 +- .../threadpool/ExecutorServiceReloader.java | 2 +- .../JobExecutorThreadPoolSizeProvider.java | 2 +- ...sageJobExecutorThreadPoolSizeProvider.java | 4 +- ...readJobExecutorThreadPoolSizeProvider.java | 4 +- .../internal/schedule/JobScheduler.java | 9 +- .../kernel/internal/schedule/LiteJob.java | 2 +- ...e.elasticjob.error.handler.JobErrorHandler | 6 +- ...readpool.JobExecutorThreadPoolSizeProvider | 4 +- ...eYamlConstants.java => YamlConstants.java} | 2 +- .../executor/ClassedFooJobExecutor.java | 8 +- .../fixture/job/AnnotationSimpleJob.java | 2 +- .../fixture/job/AnnotationUnShardingJob.java | 2 +- .../kernel/fixture/job/DetailedFooJob.java | 2 +- .../elasticjob/kernel/fixture/job/FooJob.java | 2 +- .../config/ConfigurationServiceTest.java | 14 +- .../config/RescheduleListenerManagerTest.java | 10 +- .../executor/ElasticJobExecutorTest.java | 36 +++-- .../JobFacadeTest.java} | 57 ++++---- .../handler/JobErrorHandlerReloaderTest.java | 7 +- .../general/IgnoreJobErrorHandlerTest.java | 2 +- .../general/LogJobErrorHandlerTest.java | 2 +- .../general/ThrowJobErrorHandlerTest.java | 2 +- .../fixture/executor/TypedFooJobExecutor.java | 10 +- .../executor/fixture/job/DetailedFooJob.java | 5 +- .../executor/fixture/job/FailedJob.java | 2 +- .../item/JobItemExecutorFactoryTest.java | 10 +- .../ElasticJobExecutorServiceTest.java | 2 +- .../ExecutorServiceReloaderTest.java | 2 +- ...JobExecutorThreadPoolSizeProviderTest.java | 4 +- ...JobExecutorThreadPoolSizeProviderTest.java | 4 +- .../failover/FailoverListenerManagerTest.java | 8 +- .../MonitorExecutionListenerManagerTest.java | 8 +- .../sharding/ShardingListenerManagerTest.java | 8 +- ...lasticjob.spi.type.ClassedJobItemExecutor} | 0 ...e.elasticjob.spi.type.TypedJobItemExecutor | 2 +- kernel/src/test/resources/logback-test.xml | 4 + .../executor/CustomClassedJobExecutor.java | 8 +- .../boot/job/executor/PrintJobExecutor.java | 8 +- .../boot/job/fixture/job/CustomJob.java | 2 +- .../fixture/job/impl/AnnotationCustomJob.java | 2 +- .../job/fixture/job/impl/CustomTestJob.java | 2 +- ...lasticjob.spi.type.ClassedJobItemExecutor} | 0 ....elasticjob.spi.type.TypedJobItemExecutor} | 0 .../spring/core/util/TargetJob.java | 2 +- .../test/resources/META-INF/logback-test.xml | 2 +- .../fixture/job/DataflowElasticJob.java | 2 +- .../fixture/job/FooSimpleElasticJob.java | 2 +- .../job/annotation/AnnotationSimpleJob.java | 2 +- .../job/ref/RefFooDataflowElasticJob.java | 2 +- .../job/ref/RefFooSimpleElasticJob.java | 2 +- .../src/test/resources/logback-test.xml | 2 +- 117 files changed, 383 insertions(+), 603 deletions(-) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/JobItemExecutor.java (76%) rename ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/JobRuntimeService.java (70%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/{api => spi/param}/ShardingContext.java (95%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type}/ClassedJobItemExecutor.java (89%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type}/TypedJobItemExecutor.java (89%) delete mode 100644 ecosystem/error-handler/type/general/pom.xml delete mode 100644 ecosystem/error-handler/type/general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler delete mode 100644 ecosystem/error-handler/type/general/src/test/resources/logback-test.xml delete mode 100644 ecosystem/executor/kernel/pom.xml delete mode 100644 ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java delete mode 100644 ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor} (100%) rename ecosystem/executor/type/http/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor} (100%) rename ecosystem/executor/type/script/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor} (100%) rename ecosystem/executor/type/simple/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor} (100%) rename {ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler => infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate}/JobPropertiesValidateRule.java (97%) rename {ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler => infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validate}/JobPropertiesValidateRuleTest.java (77%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/ElasticJobExecutor.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/{schedule/LiteJobFacade.java => executor/JobFacade.java} (75%) rename ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java (51%) rename {ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/JobErrorHandlerReloader.java (92%) rename {ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/general/IgnoreJobErrorHandler.java (92%) rename {ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/general/LogJobErrorHandler.java (93%) rename {ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/general/ThrowJobErrorHandler.java (93%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/item/JobItemExecutorFactory.java (89%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/ElasticJobExecutorService.java (96%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/ExecutorServiceReloader.java (96%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/JobExecutorThreadPoolSizeProvider.java (93%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java (86%) rename {ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java (84%) rename {ecosystem/error-handler/type/general => kernel}/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler (71%) rename ecosystem/executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider => kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider (76%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/{LiteYamlConstants.java => YamlConstants.java} (98%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/ElasticJobExecutorTest.java (91%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/{schedule/LiteJobFacadeTest.java => executor/JobFacadeTest.java} (80%) rename {ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/JobErrorHandlerReloaderTest.java (92%) rename {ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/general/IgnoreJobErrorHandlerTest.java (93%) rename {ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/general/LogJobErrorHandlerTest.java (96%) rename {ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/general/ThrowJobErrorHandlerTest.java (93%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/fixture/executor/TypedFooJobExecutor.java (73%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/fixture/job/DetailedFooJob.java (85%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/fixture/job/FailedJob.java (91%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/item/JobItemExecutorFactoryTest.java (80%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/ElasticJobExecutorServiceTest.java (97%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/ExecutorServiceReloaderTest.java (98%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java (86%) rename {ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java (86%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor} (100%) rename ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor => kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor (88%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor} (100%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor} (100%) diff --git a/api/pom.xml b/api/pom.xml index e36f819104..d168821667 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -25,4 +25,11 @@ elasticjob-api ${project.artifactId} + + + + org.apache.shardingsphere + shardingsphere-infra-spi + + diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/JobItemExecutor.java similarity index 76% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/JobItemExecutor.java index 39c249e0ca..5e1ead8f1a 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/JobItemExecutor.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.item; +package org.apache.shardingsphere.elasticjob.spi; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; /** * Job item executor. @@ -34,8 +34,8 @@ public interface JobItemExecutor { * * @param elasticJob elastic job * @param jobConfig job configuration - * @param jobFacade job facade + * @param jobRuntimeService job runtime service * @param shardingContext sharding context */ - void process(T elasticJob, JobConfiguration jobConfig, JobFacade jobFacade, ShardingContext shardingContext); + void process(T elasticJob, JobConfiguration jobConfig, JobRuntimeService jobRuntimeService, ShardingContext shardingContext); } diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/JobRuntimeService.java similarity index 70% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/JobRuntimeService.java index 006a07a848..a09ddd8c95 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FooJob.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/JobRuntimeService.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.fixture.job; +package org.apache.shardingsphere.elasticjob.spi.param; -import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; - -public interface FooJob extends ElasticJob { +/** + * Job runtime service. + */ +public interface JobRuntimeService { /** - * Do job. + * Judge job whether to need resharding. * - * @param shardingContext sharding context + * @return need resharding or not */ - void foo(ShardingContext shardingContext); + boolean isNeedSharding(); } diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/ShardingContext.java similarity index 95% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/ShardingContext.java index dfbe098ec4..fe89ac0161 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/api/ShardingContext.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/ShardingContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.api; +package org.apache.shardingsphere.elasticjob.spi.param; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/ClassedJobItemExecutor.java similarity index 89% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/ClassedJobItemExecutor.java index 63b8a06881..643348685b 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/ClassedJobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/ClassedJobItemExecutor.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.item.impl; +package org.apache.shardingsphere.elasticjob.spi.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/TypedJobItemExecutor.java similarity index 89% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/TypedJobItemExecutor.java index 32091f40a0..c5c816c035 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/impl/TypedJobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/TypedJobItemExecutor.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.item.impl; +package org.apache.shardingsphere.elasticjob.spi.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java index e47b9e54cc..febffd8d50 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.annotation.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; public interface CustomJob extends ElasticJob { diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java index af2b4dda9f..5e18ef55c1 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.annotation.SimpleTracingConfigurationFactory; import org.apache.shardingsphere.elasticjob.annotation.job.CustomJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; @ElasticJobConfiguration( cron = "0/5 * * * * ?", diff --git a/ecosystem/error-handler/type/dingtalk/pom.xml b/ecosystem/error-handler/type/dingtalk/pom.xml index 1805e72790..814ddcdfbe 100644 --- a/ecosystem/error-handler/type/dingtalk/pom.xml +++ b/ecosystem/error-handler/type/dingtalk/pom.xml @@ -31,11 +31,6 @@ elasticjob-error-handler-spi ${project.parent.version} - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-general - ${project.parent.version} - org.apache.shardingsphere.elasticjob elasticjob-restful diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java index f5e7a6d75b..a652779f07 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.error.handler.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.infra.validate.JobPropertiesValidateRule; import java.util.Properties; diff --git a/ecosystem/error-handler/type/email/pom.xml b/ecosystem/error-handler/type/email/pom.xml index add0f0569c..82932ddd94 100644 --- a/ecosystem/error-handler/type/email/pom.xml +++ b/ecosystem/error-handler/type/email/pom.xml @@ -31,11 +31,6 @@ elasticjob-error-handler-spi ${project.parent.version} - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-general - ${project.parent.version} - com.sun.mail diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java index 0d47e8e938..3b0fa050ad 100644 --- a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.error.handler.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.infra.validate.JobPropertiesValidateRule; import java.util.Properties; diff --git a/ecosystem/error-handler/type/general/pom.xml b/ecosystem/error-handler/type/general/pom.xml deleted file mode 100644 index 3ba89be212..0000000000 --- a/ecosystem/error-handler/type/general/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-type - 3.1.0-SNAPSHOT - - elasticjob-error-handler-general - - - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-spi - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-infra - ${project.parent.version} - - - diff --git a/ecosystem/error-handler/type/general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler deleted file mode 100644 index 02da0be3a9..0000000000 --- a/ecosystem/error-handler/type/general/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler +++ /dev/null @@ -1,20 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.error.handler.general.LogJobErrorHandler -org.apache.shardingsphere.elasticjob.error.handler.general.IgnoreJobErrorHandler -org.apache.shardingsphere.elasticjob.error.handler.general.ThrowJobErrorHandler diff --git a/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml b/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml deleted file mode 100644 index daeed13adc..0000000000 --- a/ecosystem/error-handler/type/general/src/test/resources/logback-test.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - diff --git a/ecosystem/error-handler/type/pom.xml b/ecosystem/error-handler/type/pom.xml index c4147c1488..5a66cdd343 100644 --- a/ecosystem/error-handler/type/pom.xml +++ b/ecosystem/error-handler/type/pom.xml @@ -27,7 +27,6 @@ pom - general email wechat dingtalk diff --git a/ecosystem/error-handler/type/wechat/pom.xml b/ecosystem/error-handler/type/wechat/pom.xml index 531af35e0f..6e4d6848cf 100644 --- a/ecosystem/error-handler/type/wechat/pom.xml +++ b/ecosystem/error-handler/type/wechat/pom.xml @@ -31,11 +31,6 @@ elasticjob-error-handler-spi ${project.parent.version} - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-general - ${project.parent.version} - org.apache.shardingsphere.elasticjob elasticjob-restful diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java index 79385c10f4..b0b07ff544 100644 --- a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.error.handler.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.infra.validate.JobPropertiesValidateRule; import java.util.Properties; diff --git a/ecosystem/executor/kernel/pom.xml b/ecosystem/executor/kernel/pom.xml deleted file mode 100644 index fda6b0f7b4..0000000000 --- a/ecosystem/executor/kernel/pom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-executor - 3.1.0-SNAPSHOT - - elasticjob-executor-kernel - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-api - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-infra - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-tracing-api - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-general - ${project.parent.version} - - - - org.awaitility - awaitility - - - diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java b/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java deleted file mode 100644 index 40b2cda64f..0000000000 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/JobFacade.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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.elasticjob.executor; - -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; - -import java.util.Collection; - -/** - * Job facade. - */ -public interface JobFacade { - - /** - * Load job configuration. - * - * @param fromCache load from cache or not - * @return job configuration - */ - JobConfiguration loadJobConfiguration(boolean fromCache); - - /** - * Check job execution environment. - * - * @throws JobExecutionEnvironmentException job execution environment exception - */ - void checkJobExecutionEnvironment() throws JobExecutionEnvironmentException; - - /** - * Failover If necessary. - */ - void failoverIfNecessary(); - - /** - * Register job begin. - * - * @param shardingContexts sharding contexts - */ - void registerJobBegin(ShardingContexts shardingContexts); - - /** - * Register job completed. - * - * @param shardingContexts sharding contexts - */ - void registerJobCompleted(ShardingContexts shardingContexts); - - /** - * Get sharding contexts. - * - * @return sharding contexts - */ - ShardingContexts getShardingContexts(); - - /** - * Set task misfire flag. - * - * @param shardingItems sharding items to be set misfire flag - * @return whether satisfy misfire condition - */ - boolean misfireIfRunning(Collection shardingItems); - - /** - * Clear misfire flag. - * - * @param shardingItems sharding items to be cleared misfire flag - */ - void clearMisfire(Collection shardingItems); - - /** - * Judge job whether need to execute misfire tasks. - * - * @param shardingItems sharding items - * @return whether need to execute misfire tasks - */ - boolean isExecuteMisfired(Collection shardingItems); - - /** - * Judge job whether need resharding. - * - * @return whether need resharding - */ - boolean isNeedSharding(); - - /** - * Call before job executed. - * - * @param shardingContexts sharding contexts - */ - void beforeJobExecuted(ShardingContexts shardingContexts); - - /** - * Call after job executed. - * - * @param shardingContexts sharding contexts - */ - void afterJobExecuted(ShardingContexts shardingContexts); - - /** - * Post job execution event. - * - * @param jobExecutionEvent job execution event - */ - void postJobExecutionEvent(JobExecutionEvent jobExecutionEvent); - - /** - * Post job status trace event. - * - * @param taskId task Id - * @param state job state - * @param message job message - */ - void postJobStatusTraceEvent(String taskId, State state, String message); -} diff --git a/ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor deleted file mode 100644 index 19f0f2829c..0000000000 --- a/ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor diff --git a/ecosystem/executor/pom.xml b/ecosystem/executor/pom.xml index b0558251d3..602069602e 100644 --- a/ecosystem/executor/pom.xml +++ b/ecosystem/executor/pom.xml @@ -28,7 +28,6 @@ ${project.artifactId} - kernel type diff --git a/ecosystem/executor/type/dataflow/pom.xml b/ecosystem/executor/type/dataflow/pom.xml index ca7d15387b..0aea857214 100644 --- a/ecosystem/executor/type/dataflow/pom.xml +++ b/ecosystem/executor/type/dataflow/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-executor-kernel + elasticjob-infra ${project.parent.version} diff --git a/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java b/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java index 2eea1de495..96745d8b86 100644 --- a/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java +++ b/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.dataflow.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; import java.util.List; @@ -32,27 +32,27 @@ public final class DataflowJobExecutor implements ClassedJobItemExecutor { @Override - public void process(final DataflowJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final DataflowJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { if (Boolean.parseBoolean(jobConfig.getProps().getOrDefault(DataflowJobProperties.STREAM_PROCESS_KEY, false).toString())) { - streamingExecute(elasticJob, jobConfig, jobFacade, shardingContext); + streamingExecute(elasticJob, jobConfig, jobRuntimeService, shardingContext); } else { oneOffExecute(elasticJob, shardingContext); } } - private void streamingExecute(final DataflowJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + private void streamingExecute(final DataflowJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { List data = fetchData(elasticJob, shardingContext); while (null != data && !data.isEmpty()) { processData(elasticJob, shardingContext, data); - if (!isEligibleForJobRunning(jobConfig, jobFacade)) { + if (!isEligibleForJobRunning(jobConfig, jobRuntimeService)) { break; } data = fetchData(elasticJob, shardingContext); } } - private boolean isEligibleForJobRunning(final JobConfiguration jobConfig, final JobFacade jobFacade) { - return !jobFacade.isNeedSharding() && Boolean.parseBoolean(jobConfig.getProps().getOrDefault(DataflowJobProperties.STREAM_PROCESS_KEY, false).toString()); + private boolean isEligibleForJobRunning(final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService) { + return !jobRuntimeService.isNeedSharding() && Boolean.parseBoolean(jobConfig.getProps().getOrDefault(DataflowJobProperties.STREAM_PROCESS_KEY, false).toString()); } private void oneOffExecute(final DataflowJob elasticJob, final ShardingContext shardingContext) { diff --git a/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java b/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java index f88e52383c..e639895148 100644 --- a/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java +++ b/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.dataflow.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import java.util.List; diff --git a/ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java index fa24700ed8..a9981957b7 100644 --- a/ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java +++ b/ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java @@ -18,10 +18,10 @@ package org.apache.shardingsphere.elasticjob.dataflow.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -50,7 +50,7 @@ class DataflowJobExecutorTest { private JobConfiguration jobConfig; @Mock - private JobFacade jobFacade; + private JobRuntimeService jobRuntimeService; @Mock private ShardingContext shardingContext; @@ -70,8 +70,8 @@ void assertProcessWithStreamingExecute() { when(jobConfig.getProps()).thenReturn(properties); when(properties.getOrDefault(DataflowJobProperties.STREAM_PROCESS_KEY, false)).thenReturn("true"); when(elasticJob.fetchData(shardingContext)).thenReturn(data); - when(jobFacade.isNeedSharding()).thenReturn(true); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + when(jobRuntimeService.isNeedSharding()).thenReturn(true); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); verify(elasticJob, times(1)).processData(shardingContext, data); } @@ -82,7 +82,7 @@ void assertProcessWithOneOffExecute() { when(jobConfig.getProps()).thenReturn(properties); when(properties.getOrDefault(DataflowJobProperties.STREAM_PROCESS_KEY, false)).thenReturn("false"); when(elasticJob.fetchData(shardingContext)).thenReturn(data); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); verify(elasticJob, times(1)).processData(shardingContext, data); } diff --git a/ecosystem/executor/type/http/pom.xml b/ecosystem/executor/type/http/pom.xml index 7bcd9c0ce8..147e53570e 100644 --- a/ecosystem/executor/type/http/pom.xml +++ b/ecosystem/executor/type/http/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-executor-kernel + elasticjob-infra ${project.parent.version} diff --git a/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java b/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java index 0818654001..75043c96cd 100644 --- a/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java +++ b/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java @@ -21,9 +21,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.http.pojo.HttpParam; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; @@ -48,7 +48,7 @@ public final class HttpJobExecutor implements TypedJobItemExecutor { @Override - public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { HttpParam httpParam = getHttpParam(jobConfig.getProps()); HttpURLConnection connection = null; try { @@ -85,9 +85,9 @@ public void process(final ElasticJob elasticJob, final JobConfiguration jobConfi } } if (isRequestSucceed(code)) { - log.debug("HTTP job execute result : {}", result.toString()); + log.debug("HTTP job execute result : {}", result); } else { - log.warn("HTTP job {} executed with response body {}", jobConfig.getJobName(), result.toString()); + log.warn("HTTP job {} executed with response body {}", jobConfig.getJobName(), result); } } catch (final IOException ex) { throw new JobExecutionException(ex); diff --git a/ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor diff --git a/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 0472fd25d1..23125c0226 100644 --- a/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -19,8 +19,8 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.http.executor.fixture.InternalController; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; @@ -60,7 +60,7 @@ class HttpJobExecutorTest { private JobConfiguration jobConfig; @Mock - private JobFacade jobFacade; + private JobRuntimeService jobRuntimeService; // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. @Mock(strictness = Mock.Strictness.LENIENT) @@ -97,7 +97,7 @@ static void close() { void assertUrlEmpty() { assertThrows(JobConfigurationException.class, () -> { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(""); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); }); } @@ -106,7 +106,7 @@ void assertMethodEmpty() { assertThrows(JobConfigurationException.class, () -> { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/getName")); when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn(""); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); }); } @@ -117,7 +117,7 @@ void assertProcessWithoutSuccessCode() { when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn(""); when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("4000"); when(jobConfig.getProps().getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")).thenReturn("5000"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); } @Test @@ -127,7 +127,7 @@ void assertProcessWithGet() { when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn(""); when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("4000"); when(jobConfig.getProps().getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")).thenReturn("5000"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); } @Test @@ -136,7 +136,7 @@ void assertProcessHeader() { when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn("GET"); when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("4000"); when(jobConfig.getProps().getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")).thenReturn("5000"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); } @Test @@ -147,7 +147,7 @@ void assertProcessWithPost() { when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("4000"); when(jobConfig.getProps().getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")).thenReturn("5000"); when(jobConfig.getProps().getProperty(HttpJobProperties.CONTENT_TYPE_KEY)).thenReturn("application/x-www-form-urlencoded"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); } @Test @@ -158,7 +158,7 @@ void assertProcessWithIOException() { when(jobConfig.getProps().getProperty(HttpJobProperties.DATA_KEY)).thenReturn("name=elasticjob"); when(jobConfig.getProps().getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")).thenReturn("1"); when(jobConfig.getProps().getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")).thenReturn("1"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); }); } diff --git a/ecosystem/executor/type/script/pom.xml b/ecosystem/executor/type/script/pom.xml index 3ce051f9b5..a3eb8be61e 100644 --- a/ecosystem/executor/type/script/pom.xml +++ b/ecosystem/executor/type/script/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-executor-kernel + elasticjob-infra ${project.parent.version} diff --git a/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java index 2051d70f6f..3cb9ada910 100644 --- a/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java +++ b/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java @@ -22,13 +22,13 @@ import org.apache.commons.exec.DefaultExecutor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; import java.io.IOException; import java.util.Properties; @@ -39,7 +39,7 @@ public final class ScriptJobExecutor implements TypedJobItemExecutor { @Override - public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { CommandLine commandLine = CommandLine.parse(getScriptCommandLine(jobConfig.getProps())); commandLine.addArgument(GsonFactory.getGson().toJson(shardingContext), false); try { diff --git a/ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor diff --git a/ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index ea614cff1b..5568bb0667 100644 --- a/ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -20,8 +20,8 @@ import org.apache.commons.exec.OS; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor; @@ -49,7 +49,7 @@ class ScriptJobExecutorTest { private JobConfiguration jobConfig; @Mock - private JobFacade jobFacade; + private JobRuntimeService jobRuntimeService; @Mock private Properties properties; @@ -68,7 +68,7 @@ void setUp() { void assertProcessWithJobConfigurationException() { assertThrows(JobConfigurationException.class, () -> { when(jobConfig.getProps()).thenReturn(properties); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); }); } @@ -77,7 +77,7 @@ void assertProcessWithJobSystemException() { assertThrows(JobSystemException.class, () -> { when(jobConfig.getProps()).thenReturn(properties); when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn("demo.sh"); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); }); } @@ -85,7 +85,7 @@ void assertProcessWithJobSystemException() { void assertProcess() { when(jobConfig.getProps()).thenReturn(properties); when(properties.getProperty(ScriptJobProperties.SCRIPT_KEY)).thenReturn(determineCommandByPlatform()); - jobExecutor.process(elasticJob, jobConfig, jobFacade, shardingContext); + jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); } private String determineCommandByPlatform() { diff --git a/ecosystem/executor/type/simple/pom.xml b/ecosystem/executor/type/simple/pom.xml index 41933e3ba8..a32dc8efc4 100644 --- a/ecosystem/executor/type/simple/pom.xml +++ b/ecosystem/executor/type/simple/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-executor-kernel + elasticjob-infra ${project.parent.version} diff --git a/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java b/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java index 2423eddd8b..5c9b087a2c 100644 --- a/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java +++ b/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java @@ -17,11 +17,11 @@ package org.apache.shardingsphere.elasticjob.simple.executor; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; /** * Simple job executor. @@ -29,7 +29,7 @@ public final class SimpleJobExecutor implements ClassedJobItemExecutor { @Override - public void process(final SimpleJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final SimpleJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { elasticJob.execute(shardingContext); } diff --git a/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java b/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java index 787dd9d6a5..3c8ed6cd9b 100644 --- a/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java +++ b/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; /** * Simple job. diff --git a/ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java index 3a5b202a7d..6520ddd117 100644 --- a/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java +++ b/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.simple.job.FooSimpleJob; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.junit.jupiter.api.BeforeEach; @@ -43,7 +43,7 @@ class SimpleJobExecutorTest { private JobConfiguration jobConfig; @Mock - private JobFacade jobFacade; + private JobRuntimeService jobRuntimeService; private SimpleJobExecutor jobExecutor; @@ -54,7 +54,7 @@ void setUp() { @Test void assertProcess() { - jobExecutor.process(fooSimpleJob, jobConfig, jobFacade, any()); + jobExecutor.process(fooSimpleJob, jobConfig, jobRuntimeService, any()); verify(fooSimpleJob, times(1)).execute(any()); } diff --git a/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java b/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java index 963aa69a45..8088292d47 100644 --- a/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java +++ b/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; @Getter public final class FooSimpleJob implements SimpleJob { diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java index bc3e46d8e1..4eb6b7db31 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.dataflow; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java index 02432b7a15..ad37185375 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.dataflow; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java index d249d12b72..bb983273cd 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; public final class JavaOccurErrorJob implements SimpleJob { diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java index 92dd4d1d60..481c4b9e60 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java index f42c0a8455..ef23d4dc7b 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java index 40a5e0ff84..830f0b3f27 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.entity.Foo; import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java index fb33a35271..f6b7961a29 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java index f6c7e69046..eeb3b25f20 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java index b998458a44..33b5c65baf 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java index 85109787ed..aedb529114 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.example.entity.Foo; import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/infra/pom.xml b/infra/pom.xml index 3e57c5d383..b2cc16cb07 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -33,11 +33,6 @@ ${project.parent.version} - - org.apache.shardingsphere - shardingsphere-infra-spi - - org.apache.commons commons-lang3 diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java index 50fef3a0af..e1db270f87 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java @@ -21,7 +21,7 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import java.io.Serializable; import java.util.Map; diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRule.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRule.java similarity index 97% rename from ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRule.java rename to infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRule.java index 79cc3ae05a..a13d04ad03 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRule.java +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler; +package org.apache.shardingsphere.elasticjob.infra.validate; import com.google.common.base.Preconditions; import lombok.AccessLevel; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java index 36139d5c17..51845f3f2e 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.infra.listener; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.junit.jupiter.api.Test; import java.util.HashMap; diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRuleTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRuleTest.java similarity index 77% rename from ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRuleTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRuleTest.java index 89ea1872dd..aed6124fec 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobPropertiesValidateRuleTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRuleTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler; +package org.apache.shardingsphere.elasticjob.infra.validate; import org.junit.jupiter.api.Test; @@ -37,9 +37,9 @@ void assertValidateIsRequiredWithValidateError() { @Test void assertValidateIsRequiredWithNormal() { - Properties properties = new Properties(); - properties.setProperty("key", "value"); - JobPropertiesValidateRule.validateIsRequired(properties, "key"); + Properties props = new Properties(); + props.setProperty("key", "value"); + JobPropertiesValidateRule.validateIsRequired(props, "key"); } @Test @@ -49,17 +49,17 @@ void assertValidateIsPositiveIntegerWithValueNoExist() { @Test void assertValidateIsPositiveIntegerWithNormal() { - Properties properties = new Properties(); - properties.setProperty("key", "1"); - JobPropertiesValidateRule.validateIsPositiveInteger(new Properties(), "key"); + Properties props = new Properties(); + props.setProperty("key", "1"); + JobPropertiesValidateRule.validateIsPositiveInteger(props, "key"); } @Test void assertValidateIsPositiveIntegerWithWrongString() { - Properties properties = new Properties(); - properties.setProperty("key", "wrong_value"); + Properties props = new Properties(); + props.setProperty("key", "wrong_value"); try { - JobPropertiesValidateRule.validateIsPositiveInteger(properties, "key"); + JobPropertiesValidateRule.validateIsPositiveInteger(props, "key"); } catch (IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` should be integer.", "key"))); } @@ -67,10 +67,10 @@ void assertValidateIsPositiveIntegerWithWrongString() { @Test void assertValidateIsPositiveIntegerWithNegativeNumber() { - Properties properties = new Properties(); - properties.setProperty("key", "-1"); + Properties props = new Properties(); + props.setProperty("key", "-1"); try { - JobPropertiesValidateRule.validateIsPositiveInteger(properties, "key"); + JobPropertiesValidateRule.validateIsPositiveInteger(props, "key"); } catch (IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` should be positive.", "key"))); } diff --git a/kernel/pom.xml b/kernel/pom.xml index 3c9238bc99..7f354083da 100644 --- a/kernel/pom.xml +++ b/kernel/pom.xml @@ -37,6 +37,11 @@ elasticjob-infra ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-error-handler-spi + ${project.parent.version} + org.apache.shardingsphere.elasticjob diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java similarity index 94% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java index 817d18229d..9518529861 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java @@ -15,21 +15,21 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerReloader; -import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutor; -import org.apache.shardingsphere.elasticjob.executor.item.JobItemExecutorFactory; -import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerReloader; +import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.item.JobItemExecutorFactory; +import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.ExecutorServiceReloader; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.executor.threadpool.ExecutorServiceReloader; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent.ExecutionSource; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; @@ -178,7 +178,7 @@ private void process(final JobConfiguration jobConfig, final ShardingContexts sh log.trace("Job '{}' executing, item is: '{}'.", jobConfig.getJobName(), item); JobExecutionEvent completeEvent; try { - jobItemExecutor.process(elasticJob, jobConfig, jobFacade, shardingContexts.createShardingContext(item)); + jobItemExecutor.process(elasticJob, jobConfig, jobFacade.getJobRuntimeService(), shardingContexts.createShardingContext(item)); completeEvent = startEvent.executionSuccess(); log.trace("Job '{}' executed, item is: '{}'.", jobConfig.getJobName(), item); jobFacade.postJobExecutionEvent(completeEvent); diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java similarity index 75% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java index 98eff5cd59..49c3ed6092 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java @@ -15,22 +15,22 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; +import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; @@ -43,10 +43,10 @@ import java.util.stream.Collectors; /** - * Lite job facade. + * Job facade. */ @Slf4j -public final class LiteJobFacade implements JobFacade { +public final class JobFacade { private final ConfigurationService configService; @@ -62,7 +62,7 @@ public final class LiteJobFacade implements JobFacade { private final JobTracingEventBus jobTracingEventBus; - public LiteJobFacade(final CoordinatorRegistryCenter regCenter, final String jobName, final Collection elasticJobListeners, final TracingConfiguration tracingConfig) { + public JobFacade(final CoordinatorRegistryCenter regCenter, final String jobName, final Collection elasticJobListeners, final TracingConfiguration tracingConfig) { configService = new ConfigurationService(regCenter, jobName); shardingService = new ShardingService(regCenter, jobName); executionContextService = new ExecutionContextService(regCenter, jobName); @@ -72,29 +72,48 @@ public LiteJobFacade(final CoordinatorRegistryCenter regCenter, final String job this.jobTracingEventBus = null == tracingConfig ? new JobTracingEventBus() : new JobTracingEventBus(tracingConfig); } - @Override + /** + * Load job configuration. + * + * @param fromCache load from cache or not + * @return job configuration + */ public JobConfiguration loadJobConfiguration(final boolean fromCache) { return configService.load(fromCache); } - @Override + /** + * Check job execution environment. + * + * @throws JobExecutionEnvironmentException job execution environment exception + */ public void checkJobExecutionEnvironment() throws JobExecutionEnvironmentException { configService.checkMaxTimeDiffSecondsTolerable(); } - @Override + /** + * Failover If necessary. + */ public void failoverIfNecessary() { if (configService.load(true).isFailover()) { failoverService.failoverIfNecessary(); } } - @Override + /** + * Register job begin. + * + * @param shardingContexts sharding contexts + */ public void registerJobBegin(final ShardingContexts shardingContexts) { executionService.registerJobBegin(shardingContexts); } - @Override + /** + * Register job completed. + * + * @param shardingContexts sharding contexts + */ public void registerJobCompleted(final ShardingContexts shardingContexts) { executionService.registerJobCompleted(shardingContexts); if (configService.load(true).isFailover()) { @@ -102,7 +121,11 @@ public void registerJobCompleted(final ShardingContexts shardingContexts) { } } - @Override + /** + * Get sharding contexts. + * + * @return sharding contexts + */ public ShardingContexts getShardingContexts() { boolean isFailover = configService.load(true).isFailover(); if (isFailover) { @@ -120,46 +143,82 @@ public ShardingContexts getShardingContexts() { return executionContextService.getJobShardingContext(shardingItems); } - @Override + /** + * Set task misfire flag. + * + * @param shardingItems sharding items to be set misfire flag + * @return whether satisfy misfire condition + */ public boolean misfireIfRunning(final Collection shardingItems) { return executionService.misfireIfHasRunningItems(shardingItems); } - @Override + /** + * Clear misfire flag. + * + * @param shardingItems sharding items to be cleared misfire flag + */ public void clearMisfire(final Collection shardingItems) { executionService.clearMisfire(shardingItems); } - @Override + /** + * Judge job whether to need to execute misfire tasks. + * + * @param shardingItems sharding items + * @return need to execute misfire tasks or not + */ public boolean isExecuteMisfired(final Collection shardingItems) { return configService.load(true).isMisfire() && !isNeedSharding() && !executionService.getMisfiredJobItems(shardingItems).isEmpty(); } - @Override + /** + * Judge job whether to need resharding. + * + * @return need resharding or not + */ public boolean isNeedSharding() { return shardingService.isNeedSharding(); } - @Override + /** + * Call before job executed. + * + * @param shardingContexts sharding contexts + */ public void beforeJobExecuted(final ShardingContexts shardingContexts) { for (ElasticJobListener each : elasticJobListeners) { each.beforeJobExecuted(shardingContexts); } } - @Override + /** + * Call after job executed. + * + * @param shardingContexts sharding contexts + */ public void afterJobExecuted(final ShardingContexts shardingContexts) { for (ElasticJobListener each : elasticJobListeners) { each.afterJobExecuted(shardingContexts); } } - @Override + /** + * Post job execution event. + * + * @param jobExecutionEvent job execution event + */ public void postJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { jobTracingEventBus.post(jobExecutionEvent); } - @Override + /** + * Post job status trace event. + * + * @param taskId task Id + * @param state job state + * @param message job message + */ public void postJobStatusTraceEvent(final String taskId, final State state, final String message) { TaskContext taskContext = TaskContext.from(taskId); jobTracingEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), @@ -168,4 +227,13 @@ public void postJobStatusTraceEvent(final String taskId, final State state, fina log.trace(message); } } + + /** + * Get job runtime service. + * + * @return job runtime service + */ + public JobRuntimeService getJobRuntimeService() { + return new JobJobRuntimeServiceImpl(this); + } } diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java similarity index 51% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java index e5554dcd29..47d965c37f 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/ClassedFooJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java @@ -15,23 +15,21 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.fixture.executor; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor; -import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob; -import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; +import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -public final class ClassedFooJobExecutor implements ClassedJobItemExecutor { +/** + * Job runtime service implementation. + */ +@RequiredArgsConstructor +public final class JobJobRuntimeServiceImpl implements JobRuntimeService { - @Override - public void process(final FooJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { - elasticJob.foo(shardingContext); - } + private final JobFacade jobFacade; @Override - public Class getElasticJobClass() { - return FooJob.class; + public boolean isNeedSharding() { + return jobFacade.isNeedSharding(); } } diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloader.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java similarity index 92% rename from ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloader.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java index 3d5a68a8e5..39881ca5ae 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloader.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.io.Closeable; diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java similarity index 92% rename from ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java index 5a7978e21c..84a9990bb4 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java similarity index 93% rename from ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java index 75723b7103..0ab9bc3643 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; diff --git a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java similarity index 93% rename from ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java index 8883e8e5f5..9e24463ee6 100644 --- a/ecosystem/error-handler/type/general/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java similarity index 89% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java index 4632f8ce36..f2a9848f84 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java @@ -15,12 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.item; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.item; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorService.java similarity index 96% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorService.java index 0dc38cb80e..bef37b753e 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; import com.google.common.util.concurrent.MoreExecutors; import org.apache.commons.lang3.concurrent.BasicThreadFactory; diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloader.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloader.java similarity index 96% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloader.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloader.java index 6c3e771934..6cd7b505ba 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloader.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/JobExecutorThreadPoolSizeProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/JobExecutorThreadPoolSizeProvider.java similarity index 93% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/JobExecutorThreadPoolSizeProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/JobExecutorThreadPoolSizeProvider.java index a2e29883b6..64ce2d5080 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/JobExecutorThreadPoolSizeProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/JobExecutorThreadPoolSizeProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java similarity index 86% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java index 1903142c9f..9fa4f55f22 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with use CPU available processors. diff --git a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java similarity index 84% rename from ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java index 1248e30579..ed5e9f5580 100644 --- a/ecosystem/executor/kernel/src/main/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with single thread. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index d27dac9224..5030f0ae85 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -23,8 +23,9 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ElasticJobExecutor; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.JobFacade; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; @@ -64,7 +65,7 @@ public final class JobScheduler { private final SchedulerFacade schedulerFacade; - private final LiteJobFacade jobFacade; + private final JobFacade jobFacade; private final ElasticJobExecutor jobExecutor; @@ -79,7 +80,7 @@ public JobScheduler(final CoordinatorRegistryCenter regCenter, final ElasticJob Collection jobListeners = getElasticJobListeners(this.jobConfig); setUpFacade = new SetUpFacade(regCenter, this.jobConfig.getJobName(), jobListeners); schedulerFacade = new SchedulerFacade(regCenter, this.jobConfig.getJobName()); - jobFacade = new LiteJobFacade(regCenter, this.jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); + jobFacade = new JobFacade(regCenter, this.jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); validateJobProperties(); jobExecutor = new ElasticJobExecutor(elasticJob, this.jobConfig, jobFacade); setGuaranteeServiceForElasticJobListeners(regCenter, jobListeners); @@ -93,7 +94,7 @@ public JobScheduler(final CoordinatorRegistryCenter regCenter, final String elas Collection jobListeners = getElasticJobListeners(this.jobConfig); setUpFacade = new SetUpFacade(regCenter, this.jobConfig.getJobName(), jobListeners); schedulerFacade = new SchedulerFacade(regCenter, this.jobConfig.getJobName()); - jobFacade = new LiteJobFacade(regCenter, this.jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); + jobFacade = new JobFacade(regCenter, this.jobConfig.getJobName(), jobListeners, findTracingConfiguration().orElse(null)); validateJobProperties(); jobExecutor = new ElasticJobExecutor(elasticJobType, this.jobConfig, jobFacade); setGuaranteeServiceForElasticJobListeners(regCenter, jobListeners); diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java index 8189e05c06..252465f484 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.executor.ElasticJobExecutor; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ElasticJobExecutor; import org.quartz.Job; import org.quartz.JobExecutionContext; diff --git a/ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler similarity index 71% rename from ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler index 02da0be3a9..9b191fc16d 100644 --- a/ecosystem/error-handler/type/general/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler +++ b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler @@ -15,6 +15,6 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.error.handler.general.LogJobErrorHandler -org.apache.shardingsphere.elasticjob.error.handler.general.IgnoreJobErrorHandler -org.apache.shardingsphere.elasticjob.error.handler.general.ThrowJobErrorHandler +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.LogJobErrorHandler +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.IgnoreJobErrorHandler +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.ThrowJobErrorHandler diff --git a/ecosystem/executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider similarity index 76% rename from ecosystem/executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider rename to kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider index 40f0e643db..5b7167c4f0 100644 --- a/ecosystem/executor/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider +++ b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.executor.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider -org.apache.shardingsphere.elasticjob.executor.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/LiteYamlConstants.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/YamlConstants.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/LiteYamlConstants.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/YamlConstants.java index c7820a9f46..fdc3a4c3d3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/LiteYamlConstants.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/YamlConstants.java @@ -21,7 +21,7 @@ import lombok.NoArgsConstructor; @NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class LiteYamlConstants { +public final class YamlConstants { private static final String JOB_YAML = "jobName: test_job\n" + "cron: 0/1 * * * * ?\n" diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java index 7c033faafe..507d0e1f20 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java @@ -18,15 +18,15 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; public final class ClassedFooJobExecutor implements ClassedJobItemExecutor { @Override - public void process(final FooJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final FooJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { elasticJob.foo(shardingContext); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java index 74aedd3b12..a6c4a39b01 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java @@ -20,7 +20,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; @Getter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java index a75257759b..eda26d1eea 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java @@ -19,7 +19,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; @Getter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java index 7d3f5087b6..c21446e3b9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java index f0fe640568..e2d02c3c53 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; public interface FooJob extends ElasticJob { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java index e10e08c81a..3b445d3ee6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; @@ -53,7 +53,7 @@ void setUp() { @Test void assertLoadDirectly() { - when(jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); + when(jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT)).thenReturn(YamlConstants.getJobYaml()); JobConfiguration actual = configService.load(false); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); @@ -62,7 +62,7 @@ void assertLoadDirectly() { @Test void assertLoadFromCache() { - when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); + when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(YamlConstants.getJobYaml()); JobConfiguration actual = configService.load(true); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); @@ -72,7 +72,7 @@ void assertLoadFromCache() { @Test void assertLoadFromCacheButNull() { when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(null); - when(jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); + when(jobNodeStorage.getJobNodeDataDirectly(ConfigurationNode.ROOT)).thenReturn(YamlConstants.getJobYaml()); JobConfiguration actual = configService.load(true); assertThat(actual.getJobName(), is("test_job")); assertThat(actual.getCron(), is("0/1 * * * * ?")); @@ -120,13 +120,13 @@ void assertSetUpJobConfigurationExistedJobConfigurationAndNotOverwrite() { @Test void assertIsMaxTimeDiffSecondsTolerableWithDefaultValue() throws JobExecutionEnvironmentException { - when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml(-1)); + when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(YamlConstants.getJobYaml(-1)); configService.checkMaxTimeDiffSecondsTolerable(); } @Test void assertIsMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { - when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); + when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(YamlConstants.getJobYaml()); when(jobNodeStorage.getRegistryCenterTime()).thenReturn(System.currentTimeMillis()); configService.checkMaxTimeDiffSecondsTolerable(); verify(jobNodeStorage).getRegistryCenterTime(); @@ -135,7 +135,7 @@ void assertIsMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentExcepti @Test void assertIsNotMaxTimeDiffSecondsTolerable() { assertThrows(JobExecutionEnvironmentException.class, () -> { - when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(LiteYamlConstants.getJobYaml()); + when(jobNodeStorage.getJobNodeData(ConfigurationNode.ROOT)).thenReturn(YamlConstants.getJobYaml()); when(jobNodeStorage.getRegistryCenterTime()).thenReturn(0L); try { configService.checkMaxTimeDiffSecondsTolerable(); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java index 9f2ddd25d1..dd2006808d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; @@ -63,19 +63,19 @@ void assertStart() { @Test void assertCronSettingChangedJobListenerWhenIsNotCronPath() { - rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/config/other", LiteYamlConstants.getJobYaml())); + rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/config/other", YamlConstants.getJobYaml())); verify(jobScheduleController, times(0)).rescheduleJob(any(), any()); } @Test void assertCronSettingChangedJobListenerWhenIsCronPathButNotUpdate() { - rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/config", LiteYamlConstants.getJobYaml())); + rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/config", YamlConstants.getJobYaml())); verify(jobScheduleController, times(0)).rescheduleJob(any(), any()); } @Test void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateButCannotFindJob() { - rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); + rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.UPDATED, "/test_job/config", YamlConstants.getJobYaml())); verify(jobScheduleController, times(0)).rescheduleJob(any(), any()); } @@ -84,7 +84,7 @@ void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateAndFindJob() { JobRegistry.getInstance().addJobInstance("test_job", new JobInstance("127.0.0.1@-@0")); JobRegistry.getInstance().registerRegistryCenter("test_job", regCenter); JobRegistry.getInstance().registerJob("test_job", jobScheduleController); - rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); + rescheduleListenerManager.new CronSettingAndJobEventChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.UPDATED, "/test_job/config", YamlConstants.getJobYaml())); verify(jobScheduleController).rescheduleJob("0/1 * * * * ?", null); JobRegistry.getInstance().shutdown("test_job"); } diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java similarity index 91% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java index 2e3abe8cd8..984801d19a 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java @@ -15,21 +15,24 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor; -import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; import java.lang.reflect.Field; import java.util.Collections; @@ -47,6 +50,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) class ElasticJobExecutorTest { @Mock @@ -57,6 +61,9 @@ class ElasticJobExecutorTest { @Mock private JobFacade jobFacade; + @Mock + private JobRuntimeService jobRuntimeService; + @Mock private ClassedFooJobExecutor jobItemExecutor; @@ -66,6 +73,7 @@ class ElasticJobExecutorTest { void setUp() { jobConfig = createJobConfiguration(); when(jobFacade.loadJobConfiguration(anyBoolean())).thenReturn(jobConfig); + when(jobFacade.getJobRuntimeService()).thenReturn(jobRuntimeService); elasticJobExecutor = new ElasticJobExecutor(fooJob, jobConfig, jobFacade); setJobItemExecutor(); } @@ -89,7 +97,7 @@ void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() { try { elasticJobExecutor.execute(); } finally { - verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); } }); } @@ -103,7 +111,7 @@ void assertExecuteWhenPreviousJobStillRunning() { verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin."); verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "Previous job 'test_job' - shardingItems '[]' is still running, misfired job will start after previous job completed."); - verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); } @Test @@ -113,7 +121,7 @@ void assertExecuteWhenShardingItemsIsEmpty() { elasticJobExecutor.execute(); verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin."); verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "Sharding item for job 'test_job' is empty."); - verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); } @Test @@ -128,7 +136,7 @@ void assertExecuteFailureWhenThrowExceptionForMultipleShardingItems() { private void assertExecuteFailureWhenThrowException(final ShardingContexts shardingContexts) { prepareForIsNotMisfire(jobFacade, shardingContexts); - doThrow(RuntimeException.class).when(jobItemExecutor).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + doThrow(RuntimeException.class).when(jobItemExecutor).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); try { elasticJobExecutor.execute(); } finally { @@ -136,7 +144,7 @@ private void assertExecuteFailureWhenThrowException(final ShardingContexts shard verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_RUNNING, ""); verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_ERROR, getErrorMessage(shardingContexts)); verify(jobFacade).registerJobBegin(shardingContexts); - verify(jobItemExecutor, times(shardingContexts.getShardingTotalCount())).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(shardingContexts.getShardingTotalCount())).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); verify(jobFacade).registerJobCompleted(shardingContexts); } } @@ -163,7 +171,7 @@ private void assertExecuteSuccess(final ShardingContexts shardingContexts) { verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin."); verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, ""); verifyForIsNotMisfire(jobFacade, shardingContexts); - verify(jobItemExecutor, times(shardingContexts.getShardingTotalCount())).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(shardingContexts.getShardingTotalCount())).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); } @Test @@ -172,7 +180,7 @@ void assertExecuteWithMisfireIsEmpty() { when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); elasticJobExecutor.execute(); verifyForIsNotMisfire(jobFacade, shardingContexts); - verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); } @Test @@ -181,7 +189,7 @@ void assertExecuteWithMisfireIsNotEmptyButIsNotEligibleForJobRunning() { when(jobFacade.getShardingContexts()).thenReturn(shardingContexts); elasticJobExecutor.execute(); verifyForIsNotMisfire(jobFacade, shardingContexts); - verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); verify(jobFacade, times(0)).clearMisfire(shardingContexts.getShardingItemParameters().keySet()); } @@ -195,7 +203,7 @@ void assertExecuteWithMisfire() { verify(jobFacade, times(2)).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_RUNNING, ""); verify(jobFacade).misfireIfRunning(shardingContexts.getShardingItemParameters().keySet()); verify(jobFacade, times(2)).registerJobBegin(shardingContexts); - verify(jobItemExecutor, times(4)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(4)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); verify(jobFacade, times(2)).registerJobCompleted(shardingContexts); } @@ -208,7 +216,7 @@ void assertBeforeJobExecutedFailure() { try { elasticJobExecutor.execute(); } finally { - verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(0)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); } }); } @@ -222,7 +230,7 @@ void assertAfterJobExecutedFailure() { try { elasticJobExecutor.execute(); } finally { - verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobFacade), any()); + verify(jobItemExecutor, times(2)).process(eq(fooJob), eq(jobConfig), eq(jobRuntimeService), any()); } }); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java similarity index 80% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java index 79a25322cf..2ab96dba5a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -46,7 +46,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -class LiteJobFacadeTest { +class JobFacadeTest { @Mock private ConfigurationService configService; @@ -69,55 +69,54 @@ class LiteJobFacadeTest { @Mock private ElasticJobListenerCaller caller; - private LiteJobFacade liteJobFacade; + private JobFacade jobFacade; private StringBuilder orderResult; @BeforeEach void setUp() { orderResult = new StringBuilder(); - TestElasticJobListener l1 = new TestElasticJobListener(caller, "l1", 2, orderResult); - TestElasticJobListener l2 = new TestElasticJobListener(caller, "l2", 1, orderResult); - liteJobFacade = new LiteJobFacade(null, "test_job", Lists.newArrayList(l1, l2), null); - ReflectionUtils.setFieldValue(liteJobFacade, "configService", configService); - ReflectionUtils.setFieldValue(liteJobFacade, "shardingService", shardingService); - ReflectionUtils.setFieldValue(liteJobFacade, "executionContextService", executionContextService); - ReflectionUtils.setFieldValue(liteJobFacade, "executionService", executionService); - ReflectionUtils.setFieldValue(liteJobFacade, "failoverService", failoverService); - ReflectionUtils.setFieldValue(liteJobFacade, "jobTracingEventBus", jobTracingEventBus); + jobFacade = new JobFacade(null, "test_job", + Arrays.asList(new TestElasticJobListener(caller, "l1", 2, orderResult), new TestElasticJobListener(caller, "l2", 1, orderResult)), null); + ReflectionUtils.setFieldValue(jobFacade, "configService", configService); + ReflectionUtils.setFieldValue(jobFacade, "shardingService", shardingService); + ReflectionUtils.setFieldValue(jobFacade, "executionContextService", executionContextService); + ReflectionUtils.setFieldValue(jobFacade, "executionService", executionService); + ReflectionUtils.setFieldValue(jobFacade, "failoverService", failoverService); + ReflectionUtils.setFieldValue(jobFacade, "jobTracingEventBus", jobTracingEventBus); } @Test void assertLoad() { JobConfiguration expected = JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").build(); when(configService.load(true)).thenReturn(expected); - assertThat(liteJobFacade.loadJobConfiguration(true), is(expected)); + assertThat(jobFacade.loadJobConfiguration(true), is(expected)); } @Test void assertCheckMaxTimeDiffSecondsTolerable() throws JobExecutionEnvironmentException { - liteJobFacade.checkJobExecutionEnvironment(); + jobFacade.checkJobExecutionEnvironment(); verify(configService).checkMaxTimeDiffSecondsTolerable(); } @Test void assertFailoverIfUnnecessary() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); - liteJobFacade.failoverIfNecessary(); + jobFacade.failoverIfNecessary(); verify(failoverService, times(0)).failoverIfNecessary(); } @Test void assertFailoverIfNecessary() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).monitorExecution(true).build()); - liteJobFacade.failoverIfNecessary(); + jobFacade.failoverIfNecessary(); verify(failoverService).failoverIfNecessary(); } @Test void assertRegisterJobBegin() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); - liteJobFacade.registerJobBegin(shardingContexts); + jobFacade.registerJobBegin(shardingContexts); verify(executionService).registerJobBegin(shardingContexts); } @@ -125,7 +124,7 @@ void assertRegisterJobBegin() { void assertRegisterJobCompletedWhenFailoverDisabled() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); - liteJobFacade.registerJobCompleted(shardingContexts); + jobFacade.registerJobCompleted(shardingContexts); verify(executionService).registerJobCompleted(shardingContexts); verify(failoverService, times(0)).updateFailoverComplete(shardingContexts.getShardingItemParameters().keySet()); } @@ -134,7 +133,7 @@ void assertRegisterJobCompletedWhenFailoverDisabled() { void assertRegisterJobCompletedWhenFailoverEnabled() { ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap()); when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).monitorExecution(true).build()); - liteJobFacade.registerJobCompleted(shardingContexts); + jobFacade.registerJobCompleted(shardingContexts); verify(executionService).registerJobCompleted(shardingContexts); verify(failoverService).updateFailoverComplete(shardingContexts.getShardingItemParameters().keySet()); } @@ -145,7 +144,7 @@ void assertGetShardingContextWhenIsFailoverEnableAndFailover() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(true).monitorExecution(true).build()); when(failoverService.getLocalFailoverItems()).thenReturn(Collections.singletonList(1)); when(executionContextService.getJobShardingContext(Collections.singletonList(1))).thenReturn(shardingContexts); - assertThat(liteJobFacade.getShardingContexts(), is(shardingContexts)); + assertThat(jobFacade.getShardingContexts(), is(shardingContexts)); verify(shardingService, times(0)).shardingIfNecessary(); } @@ -157,7 +156,7 @@ void assertGetShardingContextWhenIsFailoverEnableAndNotFailover() { when(shardingService.getLocalShardingItems()).thenReturn(Lists.newArrayList(0, 1)); when(failoverService.getLocalTakeOffItems()).thenReturn(Collections.singletonList(0)); when(executionContextService.getJobShardingContext(Collections.singletonList(1))).thenReturn(shardingContexts); - assertThat(liteJobFacade.getShardingContexts(), is(shardingContexts)); + assertThat(jobFacade.getShardingContexts(), is(shardingContexts)); verify(shardingService).shardingIfNecessary(); } @@ -167,7 +166,7 @@ void assertGetShardingContextWhenIsFailoverDisable() { when(configService.load(true)).thenReturn(JobConfiguration.newBuilder("test_job", 3).cron("0/1 * * * * ?").failover(false).build()); when(shardingService.getLocalShardingItems()).thenReturn(Arrays.asList(0, 1)); when(executionContextService.getJobShardingContext(Arrays.asList(0, 1))).thenReturn(shardingContexts); - assertThat(liteJobFacade.getShardingContexts(), is(shardingContexts)); + assertThat(jobFacade.getShardingContexts(), is(shardingContexts)); verify(shardingService).shardingIfNecessary(); } @@ -178,45 +177,45 @@ void assertGetShardingContextWhenHasDisabledItems() { when(shardingService.getLocalShardingItems()).thenReturn(Lists.newArrayList(0, 1)); when(executionService.getDisabledItems(Arrays.asList(0, 1))).thenReturn(Collections.singletonList(1)); when(executionContextService.getJobShardingContext(Collections.singletonList(0))).thenReturn(shardingContexts); - assertThat(liteJobFacade.getShardingContexts(), is(shardingContexts)); + assertThat(jobFacade.getShardingContexts(), is(shardingContexts)); verify(shardingService).shardingIfNecessary(); } @Test void assertMisfireIfRunning() { when(executionService.misfireIfHasRunningItems(Arrays.asList(0, 1))).thenReturn(true); - assertThat(liteJobFacade.misfireIfRunning(Arrays.asList(0, 1)), is(true)); + assertThat(jobFacade.misfireIfRunning(Arrays.asList(0, 1)), is(true)); } @Test void assertClearMisfire() { - liteJobFacade.clearMisfire(Arrays.asList(0, 1)); + jobFacade.clearMisfire(Arrays.asList(0, 1)); verify(executionService).clearMisfire(Arrays.asList(0, 1)); } @Test void assertIsNeedSharding() { when(shardingService.isNeedSharding()).thenReturn(true); - assertThat(liteJobFacade.isNeedSharding(), is(true)); + assertThat(jobFacade.isNeedSharding(), is(true)); } @Test void assertBeforeJobExecuted() { - liteJobFacade.beforeJobExecuted(new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap())); + jobFacade.beforeJobExecuted(new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap())); verify(caller, times(2)).before(); assertThat(orderResult.toString(), is("l2l1")); } @Test void assertAfterJobExecuted() { - liteJobFacade.afterJobExecuted(new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap())); + jobFacade.afterJobExecuted(new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap())); verify(caller, times(2)).after(); assertThat(orderResult.toString(), is("l2l1")); } @Test void assertPostJobExecutionEvent() { - liteJobFacade.postJobExecutionEvent(null); + jobFacade.postJobExecutionEvent(null); verify(jobTracingEventBus).post(null); } } diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java similarity index 92% rename from ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloaderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java index faf4a697dd..741b22113f 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java @@ -15,12 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.error.handler.general.IgnoreJobErrorHandler; -import org.apache.shardingsphere.elasticjob.error.handler.general.LogJobErrorHandler; +import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.IgnoreJobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.LogJobErrorHandler; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java similarity index 93% rename from ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java index 7bb3f14d98..9bb99f4a50 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java similarity index 96% rename from ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java index 64bd48d023..e658c41dab 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/LogJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; diff --git a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java similarity index 93% rename from ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java index 8b8da22380..9c401430f5 100644 --- a/ecosystem/error-handler/type/general/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/executor/TypedFooJobExecutor.java similarity index 73% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/executor/TypedFooJobExecutor.java index 3e46cbf9b0..766927ba2d 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/executor/TypedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/executor/TypedFooJobExecutor.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.fixture.executor; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.executor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; public final class TypedFooJobExecutor implements TypedJobItemExecutor { @Override - public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { } @Override diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/DetailedFooJob.java similarity index 85% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/DetailedFooJob.java index c0101e7f53..7ef0cf84be 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/DetailedFooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/DetailedFooJob.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.fixture.job; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/FailedJob.java similarity index 91% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/FailedJob.java index ad2deef881..326cc2cb00 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/fixture/job/FailedJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/FailedJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.fixture.job; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java similarity index 80% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java index 0695a8bd24..c4baf90808 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/item/JobItemExecutorFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.item; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.item; -import org.apache.shardingsphere.elasticjob.executor.fixture.executor.ClassedFooJobExecutor; -import org.apache.shardingsphere.elasticjob.executor.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.executor.fixture.job.FailedJob; -import org.apache.shardingsphere.elasticjob.executor.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.job.FailedJob; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorServiceTest.java similarity index 97% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorServiceTest.java index 293bfbf62e..9e0066941e 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ElasticJobExecutorServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorServiceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java similarity index 98% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloaderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java index 92f54d8773..e2bc5e5cd7 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/ExecutorServiceReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java similarity index 86% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java index 50b61a8642..fd99b1b0b8 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java similarity index 86% rename from ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java index 97119b5cec..a99df1b194 100644 --- a/ecosystem/executor/kernel/src/test/java/org/apache/shardingsphere/elasticjob/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java index 3ff61b6e86..ed83b72c79 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; @@ -163,7 +163,7 @@ void assertJobCrashedJobListenerWhenIsOtherFailoverInstanceCrashed() { @Test void assertFailoverSettingsChangedJobListenerWhenIsNotFailoverPath() { - failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/other", LiteYamlConstants.getJobYaml())); + failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/other", YamlConstants.getJobYaml())); verify(failoverService, times(0)).removeFailoverInfo(); } @@ -175,13 +175,13 @@ void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathButNotUpdate() { @Test void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButEnableFailover() { - failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); + failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", YamlConstants.getJobYaml())); verify(failoverService, times(0)).removeFailoverInfo(); } @Test void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButDisableFailover() { - failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYamlWithFailover(false))); + failoverListenerManager.new FailoverSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", YamlConstants.getJobYamlWithFailover(false))); verify(failoverService).removeFailoverInfo(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java index 20fa06d6dd..b492175833 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; -import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; @@ -50,7 +50,7 @@ void setUp() { @Test void assertMonitorExecutionSettingsChangedJobListenerWhenIsNotFailoverPath() { - monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/other", LiteYamlConstants.getJobYaml())); + monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(new DataChangedEvent(DataChangedEvent.Type.ADDED, "/test_job/other", YamlConstants.getJobYaml())); verify(executionService, times(0)).clearAllRunningInfo(); } @@ -62,13 +62,13 @@ void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathButNotUpd @Test void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButEnableFailover() { - monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); + monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", YamlConstants.getJobYaml())); verify(executionService, times(0)).clearAllRunningInfo(); } @Test void assertMonitorExecutionSettingsChangedJobListenerWhenIsFailoverPathAndUpdateButDisableFailover() { - DataChangedEvent event = new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYamlWithMonitorExecution(false)); + DataChangedEvent event = new DataChangedEvent(Type.UPDATED, "/test_job/config", YamlConstants.getJobYamlWithMonitorExecution(false)); monitorExecutionListenerManager.new MonitorExecutionSettingsChangedJobListener().onChange(event); verify(executionService).clearAllRunningInfo(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java index 5782f8d51f..2006512257 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.fixture.LiteYamlConstants; +import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; @@ -83,14 +83,14 @@ void assertShardingTotalCountChangedJobListenerWhenIsNotConfigPath() { @Test void assertShardingTotalCountChangedJobListenerWhenIsConfigPathButCurrentShardingTotalCountIsZero() { - shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", LiteYamlConstants.getJobYaml())); + shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", YamlConstants.getJobYaml())); verify(shardingService, times(0)).setReshardingFlag(); } @Test void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsEqualToNewShardingTotalCount() { JobRegistry.getInstance().setCurrentShardingTotalCount("test_job", 3); - shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", LiteYamlConstants.getJobYaml())); + shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.ADDED, "/test_job/config", YamlConstants.getJobYaml())); verify(shardingService, times(0)).setReshardingFlag(); JobRegistry.getInstance().setCurrentShardingTotalCount("test_job", 0); } @@ -98,7 +98,7 @@ void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardin @Test void assertShardingTotalCountChangedJobListenerWhenIsConfigPathAndCurrentShardingTotalCountIsNotEqualToNewShardingTotalCount() { JobRegistry.getInstance().setCurrentShardingTotalCount("test_job", 5); - shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", LiteYamlConstants.getJobYaml())); + shardingListenerManager.new ShardingTotalCountChangedJobListener().onChange(new DataChangedEvent(Type.UPDATED, "/test_job/config", YamlConstants.getJobYaml())); verify(shardingService).setReshardingFlag(); JobRegistry.getInstance().setCurrentShardingTotalCount("test_job", 0); } diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor similarity index 88% rename from ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor index 9fde771ab1..2199d1f8fa 100644 --- a/ecosystem/executor/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.executor.fixture.executor.TypedFooJobExecutor +org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.executor.TypedFooJobExecutor diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index 72a2eade8a..ae5d682429 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -33,6 +33,7 @@ ${log.pattern} + @@ -41,4 +42,7 @@ + + + diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java index eb558d1a64..8a7032dae6 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java @@ -18,15 +18,15 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; public final class CustomClassedJobExecutor implements ClassedJobItemExecutor { @Override - public void process(final CustomJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final CustomJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { elasticJob.execute(shardingContext); } diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java index 35479eb174..35a0c3fe8b 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java @@ -20,15 +20,15 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; -import org.apache.shardingsphere.elasticjob.executor.JobFacade; -import org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; @Slf4j public final class PrintJobExecutor implements TypedJobItemExecutor { @Override - public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobFacade jobFacade, final ShardingContext shardingContext) { + public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { log.info(jobConfig.getProps().getProperty(PrintJobProperties.CONTENT_KEY)); } diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java index 5533160ff8..d204129f1a 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; public interface CustomJob extends ElasticJob { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java index 7ce8dcf247..1b5ac1ef44 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; import org.springframework.transaction.annotation.Transactional; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java index 19633b9202..abc8712270 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; import org.apache.shardingsphere.elasticjob.spring.boot.job.repository.BarRepository; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.ClassedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.executor.item.impl.TypedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor diff --git a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java index cb71cde0ed..32c8b0ab6e 100644 --- a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java +++ b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.core.util; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; public class TargetJob implements ElasticJob { diff --git a/spring/core/src/test/resources/META-INF/logback-test.xml b/spring/core/src/test/resources/META-INF/logback-test.xml index c169e22ca8..cb19e66db2 100644 --- a/spring/core/src/test/resources/META-INF/logback-test.xml +++ b/spring/core/src/test/resources/META-INF/logback-test.xml @@ -38,5 +38,5 @@ - + diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java index 6693833b52..13fdb6fddc 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import java.util.Collections; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java index 1bbcb567aa..dd96a6920f 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; public class FooSimpleElasticJob implements SimpleJob { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java index 67fcdb6413..fbcc8e0008 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java @@ -20,7 +20,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; @Getter diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java index d607a29072..3456ba7eaa 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java index 4ad7fdf0c4..d2f9889c22 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.api.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; diff --git a/spring/namespace/src/test/resources/logback-test.xml b/spring/namespace/src/test/resources/logback-test.xml index c169e22ca8..cb19e66db2 100644 --- a/spring/namespace/src/test/resources/logback-test.xml +++ b/spring/namespace/src/test/resources/logback-test.xml @@ -38,5 +38,5 @@ - + From 9d3a2e95726d7c01492c9414e2deff3857bdda09 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 20:05:12 +0800 Subject: [PATCH 108/178] Rename PropertiesPreconditions (#2324) * Rename PropertiesPreconditions * Rename PropertiesPreconditions * Fix test cases * Fix test cases --- ...alkJobErrorHandlerPropertiesValidator.java | 8 +-- ...obErrorHandlerPropertiesValidatorTest.java | 2 +- ...ailJobErrorHandlerPropertiesValidator.java | 16 ++--- ...obErrorHandlerPropertiesValidatorTest.java | 2 +- ...hatJobErrorHandlerPropertiesValidator.java | 8 +-- ...obErrorHandlerPropertiesValidatorTest.java | 2 +- .../exception/PropertiesPreconditions.java | 61 +++++++++++++++++++ .../validate/JobPropertiesValidateRule.java | 60 ------------------ .../PropertiesPreconditionsTest.java} | 18 +++--- 9 files changed, 89 insertions(+), 88 deletions(-) create mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditions.java delete mode 100644 infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRule.java rename infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/{validate/JobPropertiesValidateRuleTest.java => exception/PropertiesPreconditionsTest.java} (78%) diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java index a652779f07..de97f1bb88 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.validate.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.infra.exception.PropertiesPreconditions; import java.util.Properties; @@ -29,9 +29,9 @@ public final class DingtalkJobErrorHandlerPropertiesValidator implements JobErro @Override public void validate(final Properties props) { - JobPropertiesValidateRule.validateIsRequired(props, DingtalkPropertiesConstants.WEBHOOK); - JobPropertiesValidateRule.validateIsPositiveInteger(props, DingtalkPropertiesConstants.CONNECT_TIMEOUT_MILLISECONDS); - JobPropertiesValidateRule.validateIsPositiveInteger(props, DingtalkPropertiesConstants.READ_TIMEOUT_MILLISECONDS); + PropertiesPreconditions.checkRequired(props, DingtalkPropertiesConstants.WEBHOOK); + PropertiesPreconditions.checkPositiveInteger(props, DingtalkPropertiesConstants.CONNECT_TIMEOUT_MILLISECONDS); + PropertiesPreconditions.checkPositiveInteger(props, DingtalkPropertiesConstants.READ_TIMEOUT_MILLISECONDS); } @Override diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index 4ee20ef25d..55ddddf94a 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -47,7 +47,7 @@ void assertValidateWithPropsIsNull() { void assertValidateWithWebhookIsNull() { try { TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "DINGTALK").validate(new Properties()); - } catch (final NullPointerException ex) { + } catch (final IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` is required.", DingtalkPropertiesConstants.WEBHOOK))); } } diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java index 3b0fa050ad..a48e20c50f 100644 --- a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.validate.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.infra.exception.PropertiesPreconditions; import java.util.Properties; @@ -29,13 +29,13 @@ public final class EmailJobErrorHandlerPropertiesValidator implements JobErrorHa @Override public void validate(final Properties props) { - JobPropertiesValidateRule.validateIsRequired(props, EmailPropertiesConstants.HOST); - JobPropertiesValidateRule.validateIsRequired(props, EmailPropertiesConstants.PORT); - JobPropertiesValidateRule.validateIsPositiveInteger(props, EmailPropertiesConstants.PORT); - JobPropertiesValidateRule.validateIsRequired(props, EmailPropertiesConstants.USERNAME); - JobPropertiesValidateRule.validateIsRequired(props, EmailPropertiesConstants.PASSWORD); - JobPropertiesValidateRule.validateIsRequired(props, EmailPropertiesConstants.FROM); - JobPropertiesValidateRule.validateIsRequired(props, EmailPropertiesConstants.TO); + PropertiesPreconditions.checkRequired(props, EmailPropertiesConstants.HOST); + PropertiesPreconditions.checkRequired(props, EmailPropertiesConstants.PORT); + PropertiesPreconditions.checkPositiveInteger(props, EmailPropertiesConstants.PORT); + PropertiesPreconditions.checkRequired(props, EmailPropertiesConstants.USERNAME); + PropertiesPreconditions.checkRequired(props, EmailPropertiesConstants.PASSWORD); + PropertiesPreconditions.checkRequired(props, EmailPropertiesConstants.FROM); + PropertiesPreconditions.checkRequired(props, EmailPropertiesConstants.TO); } @Override diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index b4d614b9dc..34e7dd76ab 100644 --- a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -51,7 +51,7 @@ void assertValidateWithPropsIsNull() { void assertValidateWithHostIsNull() { try { TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "EMAIL").validate(new Properties()); - } catch (final NullPointerException ex) { + } catch (final IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` is required.", EmailPropertiesConstants.HOST))); } } diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java index b0b07ff544..c2a6947c60 100644 --- a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.validate.JobPropertiesValidateRule; +import org.apache.shardingsphere.elasticjob.infra.exception.PropertiesPreconditions; import java.util.Properties; @@ -29,9 +29,9 @@ public final class WechatJobErrorHandlerPropertiesValidator implements JobErrorH @Override public void validate(final Properties props) { - JobPropertiesValidateRule.validateIsRequired(props, WechatPropertiesConstants.WEBHOOK); - JobPropertiesValidateRule.validateIsPositiveInteger(props, WechatPropertiesConstants.CONNECT_TIMEOUT_MILLISECONDS); - JobPropertiesValidateRule.validateIsPositiveInteger(props, WechatPropertiesConstants.READ_TIMEOUT_MILLISECONDS); + PropertiesPreconditions.checkRequired(props, WechatPropertiesConstants.WEBHOOK); + PropertiesPreconditions.checkPositiveInteger(props, WechatPropertiesConstants.CONNECT_TIMEOUT_MILLISECONDS); + PropertiesPreconditions.checkPositiveInteger(props, WechatPropertiesConstants.READ_TIMEOUT_MILLISECONDS); } @Override diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index 05882b65de..254e2a0125 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -47,7 +47,7 @@ void assertValidateWithPropsIsNull() { void assertValidateWithWebhookIsNull() { try { TypedSPILoader.getService(JobErrorHandlerPropertiesValidator.class, "WECHAT").validate(new Properties()); - } catch (final NullPointerException ex) { + } catch (final IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` is required.", WechatPropertiesConstants.WEBHOOK))); } } diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditions.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditions.java new file mode 100644 index 0000000000..60aaecde66 --- /dev/null +++ b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditions.java @@ -0,0 +1,61 @@ +/* + * 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.elasticjob.infra.exception; + +import com.google.common.base.Preconditions; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +import java.util.Properties; + +/** + * Properties preconditions. + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class PropertiesPreconditions { + + /** + * Check property value is required. + * + * @param props properties to be checked + * @param key property key to be checked + */ + public static void checkRequired(final Properties props, final String key) { + Preconditions.checkArgument(props.containsKey(key), "The property `%s` is required.", key); + } + + /** + * Check property value is positive integer. + * + * @param props properties to be checked + * @param key property key to be checked + */ + public static void checkPositiveInteger(final Properties props, final String key) { + String propertyValue = props.getProperty(key); + if (null == propertyValue) { + return; + } + int integerValue; + try { + integerValue = Integer.parseInt(propertyValue); + } catch (final NumberFormatException ignored) { + throw new IllegalArgumentException(String.format("The property `%s` should be integer.", key)); + } + Preconditions.checkArgument(integerValue > 0, "The property `%s` should be positive.", key); + } +} diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRule.java b/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRule.java deleted file mode 100644 index a13d04ad03..0000000000 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRule.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.elasticjob.infra.validate; - -import com.google.common.base.Preconditions; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; - -import java.util.Properties; - -/** - * Job properties validate rule. - */ -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class JobPropertiesValidateRule { - - /** - * Validate property value is required. - * - * @param props properties to be validated - * @param key property key to be validated - */ - public static void validateIsRequired(final Properties props, final String key) { - Preconditions.checkNotNull(props.getProperty(key), "The property `%s` is required.", key); - } - - /** - * Validate property value is positive integer. - * - * @param props properties to be validated - * @param key property key to be validated - */ - public static void validateIsPositiveInteger(final Properties props, final String key) { - String propertyValue = props.getProperty(key); - if (null != propertyValue) { - int integerValue; - try { - integerValue = Integer.parseInt(propertyValue); - } catch (final NumberFormatException ignored) { - throw new IllegalArgumentException(String.format("The property `%s` should be integer.", key)); - } - Preconditions.checkArgument(integerValue > 0, "The property `%s` should be positive.", key); - } - } -} diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRuleTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditionsTest.java similarity index 78% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRuleTest.java rename to infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditionsTest.java index aed6124fec..7500c99b92 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/validate/JobPropertiesValidateRuleTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditionsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.validate; +package org.apache.shardingsphere.elasticjob.infra.exception; import org.junit.jupiter.api.Test; @@ -24,13 +24,13 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; -class JobPropertiesValidateRuleTest { +class PropertiesPreconditionsTest { @Test void assertValidateIsRequiredWithValidateError() { try { - JobPropertiesValidateRule.validateIsRequired(new Properties(), "key"); - } catch (NullPointerException ex) { + PropertiesPreconditions.checkRequired(new Properties(), "key"); + } catch (IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` is required.", "key"))); } } @@ -39,19 +39,19 @@ void assertValidateIsRequiredWithValidateError() { void assertValidateIsRequiredWithNormal() { Properties props = new Properties(); props.setProperty("key", "value"); - JobPropertiesValidateRule.validateIsRequired(props, "key"); + PropertiesPreconditions.checkRequired(props, "key"); } @Test void assertValidateIsPositiveIntegerWithValueNoExist() { - JobPropertiesValidateRule.validateIsPositiveInteger(new Properties(), "key"); + PropertiesPreconditions.checkPositiveInteger(new Properties(), "key"); } @Test void assertValidateIsPositiveIntegerWithNormal() { Properties props = new Properties(); props.setProperty("key", "1"); - JobPropertiesValidateRule.validateIsPositiveInteger(props, "key"); + PropertiesPreconditions.checkPositiveInteger(props, "key"); } @Test @@ -59,7 +59,7 @@ void assertValidateIsPositiveIntegerWithWrongString() { Properties props = new Properties(); props.setProperty("key", "wrong_value"); try { - JobPropertiesValidateRule.validateIsPositiveInteger(props, "key"); + PropertiesPreconditions.checkPositiveInteger(props, "key"); } catch (IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` should be integer.", "key"))); } @@ -70,7 +70,7 @@ void assertValidateIsPositiveIntegerWithNegativeNumber() { Properties props = new Properties(); props.setProperty("key", "-1"); try { - JobPropertiesValidateRule.validateIsPositiveInteger(props, "key"); + PropertiesPreconditions.checkPositiveInteger(props, "key"); } catch (IllegalArgumentException ex) { assertThat(ex.getMessage(), is(String.format("The property `%s` should be positive.", "key"))); } From fd93fa19edfdb1b5c721ba343b01f8877e516030 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 20:41:22 +0800 Subject: [PATCH 109/178] Remove duplicated fixture (#2325) --- .../fixture/executor/TypedFooJobExecutor.java | 2 +- .../executor => }/fixture/job/FailedJob.java | 2 +- .../executor/fixture/job/DetailedFooJob.java | 39 ------------------- .../item/JobItemExecutorFactoryTest.java | 2 +- ...e.elasticjob.spi.type.TypedJobItemExecutor | 2 +- 5 files changed, 4 insertions(+), 43 deletions(-) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal/executor => }/fixture/executor/TypedFooJobExecutor.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal/executor => }/fixture/job/FailedJob.java (91%) delete mode 100644 kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/DetailedFooJob.java diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/executor/TypedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/executor/TypedFooJobExecutor.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java index 766927ba2d..50a69c9fe7 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/executor/TypedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.executor; +package org.apache.shardingsphere.elasticjob.kernel.fixture.executor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/FailedJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FailedJob.java similarity index 91% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/FailedJob.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FailedJob.java index 326cc2cb00..d34e381c36 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/FailedJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FailedJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.job; +package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/DetailedFooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/DetailedFooJob.java deleted file mode 100644 index 7ef0cf84be..0000000000 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/fixture/job/DetailedFooJob.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.elasticjob.kernel.internal.executor.fixture.job; - -import lombok.Getter; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; - -import java.util.Collection; -import java.util.concurrent.CopyOnWriteArraySet; - -public final class DetailedFooJob implements FooJob { - - private final Collection completedJobItems = new CopyOnWriteArraySet<>(); - - @Getter - private volatile boolean completed; - - @Override - public void foo(final ShardingContext shardingContext) { - completedJobItems.add(shardingContext.getShardingItem()); - completed = completedJobItems.size() == shardingContext.getShardingTotalCount(); - } -} diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java index c4baf90808..b84d952c60 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.job.FailedJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FailedJob; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor index 2199d1f8fa..d2dcc73faa 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.executor.fixture.executor.TypedFooJobExecutor +org.apache.shardingsphere.elasticjob.kernel.fixture.executor.TypedFooJobExecutor From e4a89f3b3666ac16c3da102b6ba338a09203a88a Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 20:49:17 +0800 Subject: [PATCH 110/178] Rename ElasticJobLiteAutoConfiguration to ElasticJobAutoConfiguration (#2326) --- ...eAutoConfiguration.java => ElasticJobAutoConfiguration.java} | 2 +- .../boot-starter/src/main/resources/META-INF/spring.factories | 2 +- ...springframework.boot.autoconfigure.AutoConfiguration.imports | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/{ElasticJobLiteAutoConfiguration.java => ElasticJobAutoConfiguration.java} (97%) diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobLiteAutoConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobAutoConfiguration.java similarity index 97% rename from spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobLiteAutoConfiguration.java rename to spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobAutoConfiguration.java index d6ed04b500..68a8e71082 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobLiteAutoConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobAutoConfiguration.java @@ -35,7 +35,7 @@ @ConditionalOnProperty(name = "elasticjob.enabled", havingValue = "true", matchIfMissing = true) @Import({ElasticJobRegistryCenterConfiguration.class, ElasticJobTracingConfiguration.class, ElasticJobSnapshotServiceConfiguration.class}) @EnableConfigurationProperties(ElasticJobProperties.class) -public class ElasticJobLiteAutoConfiguration { +public class ElasticJobAutoConfiguration { @Configuration(proxyBeanMethods = false) @Import({ElasticJobBootstrapConfiguration.class, ScheduleJobBootstrapStartupRunner.class}) diff --git a/spring/boot-starter/src/main/resources/META-INF/spring.factories b/spring/boot-starter/src/main/resources/META-INF/spring.factories index 72ca9c32e4..c5665e1ef2 100644 --- a/spring/boot-starter/src/main/resources/META-INF/spring.factories +++ b/spring/boot-starter/src/main/resources/META-INF/spring.factories @@ -15,4 +15,4 @@ # limitations under the License. # org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobLiteAutoConfiguration + org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobAutoConfiguration diff --git a/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index c008333f6b..0cc69e7fff 100644 --- a/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring/boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobLiteAutoConfiguration +org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobAutoConfiguration From 4b580bdef9b94dcbe7e00f10ba1855ef1dfa0d4c Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 20:59:43 +0800 Subject: [PATCH 111/178] Refactor executor module (#2327) --- .../executor/{type => }/dataflow/pom.xml | 2 +- .../executor/DataflowJobExecutor.java | 0 .../elasticjob/dataflow/job/DataflowJob.java | 0 .../dataflow/props/DataflowJobProperties.java | 0 ...elasticjob.spi.type.ClassedJobItemExecutor | 0 .../executor/DataflowJobExecutorTest.java | 0 ecosystem/executor/{type => }/http/pom.xml | 2 +- .../http/executor/HttpJobExecutor.java | 0 .../elasticjob/http/pojo/HttpParam.java | 0 .../http/props/HttpJobProperties.java | 0 ...e.elasticjob.spi.type.TypedJobItemExecutor | 0 .../http/executor/HttpJobExecutorTest.java | 0 .../executor/fixture/InternalController.java | 0 ecosystem/executor/pom.xml | 5 ++- ecosystem/executor/{type => }/script/pom.xml | 2 +- .../script/executor/ScriptJobExecutor.java | 0 .../script/props/ScriptJobProperties.java | 0 ...e.elasticjob.spi.type.TypedJobItemExecutor | 0 .../script/ScriptJobExecutorTest.java | 0 ecosystem/executor/{type => }/simple/pom.xml | 2 +- .../simple/executor/SimpleJobExecutor.java | 0 .../elasticjob/simple/job/SimpleJob.java | 0 ...elasticjob.spi.type.ClassedJobItemExecutor | 0 .../executor/SimpleJobExecutorTest.java | 0 .../elasticjob/simple/job/FooSimpleJob.java | 0 ecosystem/executor/type/pom.xml | 36 ------------------- 26 files changed, 8 insertions(+), 41 deletions(-) rename ecosystem/executor/{type => }/dataflow/pom.xml (96%) rename ecosystem/executor/{type => }/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java (100%) rename ecosystem/executor/{type => }/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java (100%) rename ecosystem/executor/{type => }/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java (100%) rename ecosystem/executor/{type => }/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor (100%) rename ecosystem/executor/{type => }/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java (100%) rename ecosystem/executor/{type => }/http/pom.xml (97%) rename ecosystem/executor/{type => }/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java (100%) rename ecosystem/executor/{type => }/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java (100%) rename ecosystem/executor/{type => }/http/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java (100%) rename ecosystem/executor/{type => }/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor (100%) rename ecosystem/executor/{type => }/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java (100%) rename ecosystem/executor/{type => }/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java (100%) rename ecosystem/executor/{type => }/script/pom.xml (96%) rename ecosystem/executor/{type => }/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java (100%) rename ecosystem/executor/{type => }/script/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java (100%) rename ecosystem/executor/{type => }/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor (100%) rename ecosystem/executor/{type => }/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java (100%) rename ecosystem/executor/{type => }/simple/pom.xml (96%) rename ecosystem/executor/{type => }/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java (100%) rename ecosystem/executor/{type => }/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java (100%) rename ecosystem/executor/{type => }/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor (100%) rename ecosystem/executor/{type => }/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java (100%) rename ecosystem/executor/{type => }/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java (100%) delete mode 100644 ecosystem/executor/type/pom.xml diff --git a/ecosystem/executor/type/dataflow/pom.xml b/ecosystem/executor/dataflow/pom.xml similarity index 96% rename from ecosystem/executor/type/dataflow/pom.xml rename to ecosystem/executor/dataflow/pom.xml index 0aea857214..582eab26e1 100644 --- a/ecosystem/executor/type/dataflow/pom.xml +++ b/ecosystem/executor/dataflow/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-executor-type + elasticjob-executor 3.1.0-SNAPSHOT elasticjob-dataflow-executor diff --git a/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java similarity index 100% rename from ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java rename to ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java diff --git a/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java similarity index 100% rename from ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java rename to ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java diff --git a/ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java similarity index 100% rename from ecosystem/executor/type/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java rename to ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java diff --git a/ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor rename to ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java similarity index 100% rename from ecosystem/executor/type/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java rename to ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java diff --git a/ecosystem/executor/type/http/pom.xml b/ecosystem/executor/http/pom.xml similarity index 97% rename from ecosystem/executor/type/http/pom.xml rename to ecosystem/executor/http/pom.xml index 147e53570e..7a27436cec 100644 --- a/ecosystem/executor/type/http/pom.xml +++ b/ecosystem/executor/http/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-executor-type + elasticjob-executor 3.1.0-SNAPSHOT elasticjob-http-executor diff --git a/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java similarity index 100% rename from ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java rename to ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java diff --git a/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java similarity index 100% rename from ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java rename to ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java diff --git a/ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java similarity index 100% rename from ecosystem/executor/type/http/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java rename to ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/props/HttpJobProperties.java diff --git a/ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor b/ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor rename to ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor diff --git a/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java similarity index 100% rename from ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java rename to ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java diff --git a/ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java similarity index 100% rename from ecosystem/executor/type/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java rename to ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/fixture/InternalController.java diff --git a/ecosystem/executor/pom.xml b/ecosystem/executor/pom.xml index 602069602e..201992c57a 100644 --- a/ecosystem/executor/pom.xml +++ b/ecosystem/executor/pom.xml @@ -28,6 +28,9 @@ ${project.artifactId} - type + simple + dataflow + script + http diff --git a/ecosystem/executor/type/script/pom.xml b/ecosystem/executor/script/pom.xml similarity index 96% rename from ecosystem/executor/type/script/pom.xml rename to ecosystem/executor/script/pom.xml index a3eb8be61e..977417bfb5 100644 --- a/ecosystem/executor/type/script/pom.xml +++ b/ecosystem/executor/script/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-executor-type + elasticjob-executor 3.1.0-SNAPSHOT elasticjob-script-executor diff --git a/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java similarity index 100% rename from ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java rename to ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java diff --git a/ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java similarity index 100% rename from ecosystem/executor/type/script/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java rename to ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/props/ScriptJobProperties.java diff --git a/ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor b/ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor rename to ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor diff --git a/ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java similarity index 100% rename from ecosystem/executor/type/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java rename to ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java diff --git a/ecosystem/executor/type/simple/pom.xml b/ecosystem/executor/simple/pom.xml similarity index 96% rename from ecosystem/executor/type/simple/pom.xml rename to ecosystem/executor/simple/pom.xml index a32dc8efc4..372e7aa8f0 100644 --- a/ecosystem/executor/type/simple/pom.xml +++ b/ecosystem/executor/simple/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-executor-type + elasticjob-executor 3.1.0-SNAPSHOT elasticjob-simple-executor diff --git a/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java similarity index 100% rename from ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java rename to ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java diff --git a/ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java similarity index 100% rename from ecosystem/executor/type/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java rename to ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java diff --git a/ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/type/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor rename to ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java similarity index 100% rename from ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java rename to ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java diff --git a/ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java similarity index 100% rename from ecosystem/executor/type/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java rename to ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java diff --git a/ecosystem/executor/type/pom.xml b/ecosystem/executor/type/pom.xml deleted file mode 100644 index 66f974728e..0000000000 --- a/ecosystem/executor/type/pom.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-executor - 3.1.0-SNAPSHOT - - elasticjob-executor-type - pom - ${project.artifactId} - - - simple - dataflow - script - http - - From ada191d2c5f2655673ea4d6574c4365de8e0325a Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 23:34:55 +0800 Subject: [PATCH 112/178] Add test-util module (#2328) * Add test-util module * Add test-util module * Add test-util module * Add test-util module --- kernel/pom.xml | 11 +- .../impl/OneOffJobBootstrapTest.java | 12 +- .../kernel/integrate/BaseIntegrateTest.java | 8 +- .../integrate/BaseAnnotationTest.java | 8 +- .../snapshot/BaseSnapshotServiceTest.java | 8 +- pom.xml | 4 + .../provider/zookeeper-curator/pom.xml | 12 +- .../ZookeeperElectionServiceTest.java | 12 +- ...eperRegistryCenterExecuteInLeaderTest.java | 8 +- .../ZookeeperRegistryCenterForAuthTest.java | 12 +- ...keeperRegistryCenterMiscellaneousTest.java | 8 +- .../ZookeeperRegistryCenterModifyTest.java | 14 +- ...eeperRegistryCenterQueryWithCacheTest.java | 8 +- ...erRegistryCenterQueryWithoutCacheTest.java | 8 +- ...ookeeperRegistryCenterTransactionTest.java | 8 +- .../ZookeeperRegistryCenterWatchTest.java | 8 +- .../zookeeper/fixture/EmbedTestingServer.java | 135 ------------------ spring/boot-starter/pom.xml | 10 +- .../job/ElasticJobSpringBootScannerTest.java | 4 +- .../boot/job/ElasticJobSpringBootTest.java | 8 +- .../boot/job/fixture/EmbedTestingServer.java | 135 ------------------ ...icJobSnapshotServiceConfigurationTest.java | 4 +- .../tracing/TracingConfigurationTest.java | 4 +- test/pom.xml | 33 +++++ test/util/pom.xml | 40 ++++++ .../test/util}/EmbedTestingServer.java | 30 ++-- 26 files changed, 198 insertions(+), 354 deletions(-) delete mode 100644 registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java delete mode 100644 spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/EmbedTestingServer.java create mode 100644 test/pom.xml create mode 100644 test/util/pom.xml rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture => test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util}/EmbedTestingServer.java (88%) diff --git a/kernel/pom.xml b/kernel/pom.xml index 7f354083da..6a0c2c1b6f 100644 --- a/kernel/pom.xml +++ b/kernel/pom.xml @@ -74,6 +74,13 @@ ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + org.apache.commons commons-lang3 @@ -91,10 +98,6 @@ quartz - - org.apache.curator - curator-test - org.awaitility awaitility diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java index f7110eef75..91e7c4d678 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -19,12 +19,12 @@ import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -42,7 +42,9 @@ class OneOffJobBootstrapTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), OneOffJobBootstrapTest.class.getSimpleName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); + + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), OneOffJobBootstrapTest.class.getSimpleName()); private static final int SHARDING_TOTAL_COUNT = 3; @@ -50,7 +52,7 @@ class OneOffJobBootstrapTest { @BeforeAll static void init() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); } @BeforeEach @@ -60,7 +62,7 @@ void setUp() { } @AfterEach - void teardown() { + void tearDown() { zkRegCenter.close(); } @@ -108,7 +110,7 @@ private Scheduler getScheduler(final OneOffJobBootstrap oneOffJobBootstrap) { private void blockUtilFinish(final OneOffJobBootstrap oneOffJobBootstrap, final AtomicInteger counter) { Scheduler scheduler = getScheduler(oneOffJobBootstrap); while (0 == counter.get() || !scheduler.getCurrentlyExecutingJobs().isEmpty()) { - Thread.sleep(100); + Thread.sleep(100L); } } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java index a91788f42a..55b803da28 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java @@ -24,13 +24,13 @@ import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -38,7 +38,9 @@ @Getter(AccessLevel.PROTECTED) public abstract class BaseIntegrateTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), "zkRegTestCenter"); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); + + private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); @Getter(AccessLevel.PROTECTED) private static final CoordinatorRegistryCenter REGISTRY_CENTER = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIG); @@ -75,7 +77,7 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el @BeforeAll static void init() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REGISTRY_CENTER.init(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java index 1e92e5a255..3b729764cb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java @@ -24,7 +24,6 @@ import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; @@ -32,6 +31,7 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -39,7 +39,9 @@ @Getter(AccessLevel.PROTECTED) public abstract class BaseAnnotationTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), "zkRegTestCenter"); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); + + private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); @Getter(AccessLevel.PROTECTED) private static final CoordinatorRegistryCenter REGISTRY_CENTER = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIG); @@ -75,7 +77,7 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el @BeforeAll static void init() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REGISTRY_CENTER.init(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java index 98309a2cfa..abf59a8761 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java @@ -22,12 +22,12 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -36,7 +36,9 @@ public abstract class BaseSnapshotServiceTest { static final int DUMP_PORT = 9000; - private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), "zkRegTestCenter"); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); + + private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); @Getter(value = AccessLevel.PROTECTED) private static final CoordinatorRegistryCenter REG_CENTER = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIG); @@ -55,7 +57,7 @@ public BaseSnapshotServiceTest(final ElasticJob elasticJob) { @BeforeAll static void init() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); REG_CENTER.init(); } diff --git a/pom.xml b/pom.xml index 8bafe34355..49db7719f4 100644 --- a/pom.xml +++ b/pom.xml @@ -37,8 +37,12 @@ kernel lifecycle restful + ecosystem spring + + test + distribution diff --git a/registry-center/provider/zookeeper-curator/pom.xml b/registry-center/provider/zookeeper-curator/pom.xml index fb7221feef..5390269236 100644 --- a/registry-center/provider/zookeeper-curator/pom.xml +++ b/registry-center/provider/zookeeper-curator/pom.xml @@ -33,6 +33,13 @@ ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + org.apache.curator curator-framework @@ -45,10 +52,5 @@ org.apache.curator curator-recipes - - - org.apache.curator - curator-test - diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index ec14a7a951..9256db60f0 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -24,7 +24,7 @@ import org.apache.curator.retry.RetryOneTime; import org.apache.curator.test.KillSession; import org.apache.shardingsphere.elasticjob.reg.base.ElectionCandidate; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -42,6 +42,8 @@ @ExtendWith(MockitoExtension.class) class ZookeeperElectionServiceTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final String HOST_AND_PORT = "localhost:8899"; private static final String ELECTION_PATH = "/election"; @@ -51,18 +53,18 @@ class ZookeeperElectionServiceTest { @BeforeAll static void init() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); } @Test void assertContend() throws Exception { - CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); + CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); client.start(); client.blockUntilConnected(); ZookeeperElectionService service = new ZookeeperElectionService(HOST_AND_PORT, client, ELECTION_PATH, electionCandidate); service.start(); ElectionCandidate anotherElectionCandidate = mock(ElectionCandidate.class); - CuratorFramework anotherClient = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); + CuratorFramework anotherClient = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); ZookeeperElectionService anotherService = new ZookeeperElectionService("ANOTHER_CLIENT:8899", anotherClient, ELECTION_PATH, anotherElectionCandidate); anotherClient.start(); anotherClient.blockUntilConnected(); @@ -80,7 +82,7 @@ void assertContend() throws Exception { @SneakyThrows private void blockUntilCondition(final Supplier condition) { while (!condition.get()) { - Thread.sleep(100); + Thread.sleep(100L); } } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java index ec43699cc4..2bead8dae4 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java @@ -19,7 +19,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -33,14 +33,16 @@ class ZookeeperRegistryCenterExecuteInLeaderTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterExecuteInLeaderTest.class.getName()); + new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterExecuteInLeaderTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index c86f4396f8..34fa53a612 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -20,8 +20,8 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.RetryOneTime; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.zookeeper.KeeperException.NoAuthException; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -33,15 +33,17 @@ class ZookeeperRegistryCenterForAuthTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final String NAME_SPACE = ZookeeperRegistryCenterForAuthTest.class.getName(); - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), NAME_SPACE); + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), NAME_SPACE); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); ZOOKEEPER_CONFIGURATION.setDigest("digest:password"); ZOOKEEPER_CONFIGURATION.setSessionTimeoutMilliseconds(5000); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(5000); @@ -58,7 +60,7 @@ static void tearDown() { @Test void assertInitWithDigestSuccess() throws Exception { CuratorFramework client = CuratorFrameworkFactory.builder() - .connectString(EmbedTestingServer.getConnectionString()) + .connectString(EMBED_TESTING_SERVER.getConnectionString()) .retryPolicy(new RetryOneTime(2000)) .authorization("digest", "digest:password".getBytes()).build(); client.start(); @@ -69,7 +71,7 @@ void assertInitWithDigestSuccess() throws Exception { @Test void assertInitWithDigestFailure() { assertThrows(NoAuthException.class, () -> { - CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); + CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); client.start(); client.blockUntilConnected(); client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java index d5fc1fe656..c92d551989 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java @@ -19,7 +19,7 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -30,14 +30,16 @@ class ZookeeperRegistryCenterMiscellaneousTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterMiscellaneousTest.class.getName()); + new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterMiscellaneousTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); zkRegCenter.init(); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index 5736390517..10eda57b7c 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -20,8 +20,8 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.RetryOneTime; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -37,13 +37,15 @@ class ZookeeperRegistryCenterModifyTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterModifyTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterModifyTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); @@ -77,7 +79,7 @@ void assertPersistEphemeral() throws Exception { assertThat(zkRegCenter.get("/persist"), is("persist_value")); assertThat(zkRegCenter.get("/ephemeral"), is("ephemeral_value")); zkRegCenter.close(); - CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); + CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); client.start(); client.blockUntilConnected(); assertThat(client.getData().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/persist"), is("persist_value".getBytes())); @@ -89,7 +91,7 @@ void assertPersistEphemeral() throws Exception { void assertPersistSequential() throws Exception { assertThat(zkRegCenter.persistSequential("/sequential/test_sequential", "test_value"), startsWith("/sequential/test_sequential")); assertThat(zkRegCenter.persistSequential("/sequential/test_sequential", "test_value"), startsWith("/sequential/test_sequential")); - CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); + CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); client.start(); client.blockUntilConnected(); List actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); @@ -106,7 +108,7 @@ void assertPersistSequential() throws Exception { void assertPersistEphemeralSequential() throws Exception { zkRegCenter.persistEphemeralSequential("/sequential/test_ephemeral_sequential"); zkRegCenter.persistEphemeralSequential("/sequential/test_ephemeral_sequential"); - CuratorFramework client = CuratorFrameworkFactory.newClient(EmbedTestingServer.getConnectionString(), new RetryOneTime(2000)); + CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); client.start(); client.blockUntilConnected(); List actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index 7a54c80851..5a27306906 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -29,14 +29,16 @@ class ZookeeperRegistryCenterQueryWithCacheTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithCacheTest.class.getName()); + new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterQueryWithCacheTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index c15e81dd26..99fa81960c 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -34,14 +34,16 @@ class ZookeeperRegistryCenterQueryWithoutCacheTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterQueryWithoutCacheTest.class.getName()); + new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterQueryWithoutCacheTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); zkRegCenter.init(); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index 6ff7882c12..d520728109 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.zookeeper.KeeperException; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -34,14 +34,16 @@ class ZookeeperRegistryCenterTransactionTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); + new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index 8720358229..8318bc4f9d 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -19,8 +19,8 @@ import org.apache.curator.utils.ThreadUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -37,13 +37,15 @@ class ZookeeperRegistryCenterWatchTest { - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EmbedTestingServer.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + + private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java deleted file mode 100644 index 70ae28a00b..0000000000 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/fixture/EmbedTestingServer.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.elasticjob.reg.zookeeper.fixture; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.CuratorFrameworkFactory; -import org.apache.curator.framework.imps.CuratorFrameworkState; -import org.apache.curator.retry.ExponentialBackoffRetry; -import org.apache.curator.test.TestingServer; -import org.apache.zookeeper.KeeperException; - -import java.io.IOException; -import java.util.Collection; -import java.util.concurrent.TimeUnit; - -@Slf4j -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class EmbedTestingServer { - - private static final int PORT = 9181; - - private static volatile TestingServer testingServer; - - private static final Object INIT_LOCK = new Object(); - - /** - * Start embed zookeeper server. - */ - public static void start() { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); - return; - } - log.info("Starting embed zookeeper server..."); - synchronized (INIT_LOCK) { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); - return; - } - start0(); - waitTestingServerReady(); - } - } - - private static void start0() { - try { - testingServer = new TestingServer(PORT, true); - // CHECKSTYLE:OFF - } catch (final Exception ex) { - // CHECKSTYLE:ON - if (!isIgnoredException(ex)) { - throw new RuntimeException(ex); - } else { - log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); - } - } finally { - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - testingServer.close(); - } catch (final IOException ignored) { - } - log.info("Close embed zookeeper server done"); - })); - } - } - - private static void waitTestingServerReady() { - int maxRetries = 60; - try (CuratorFramework client = buildCuratorClient()) { - client.start(); - int round = 0; - while (round < maxRetries) { - try { - if (client.getZookeeperClient().isConnected()) { - log.info("client is connected"); - break; - } - if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { - CuratorFrameworkState state = client.getState(); - Collection childrenKeys = client.getChildren().forPath("/"); - log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); - break; - } - // CHECKSTYLE:OFF - } catch (final Exception ignored) { - // CHECKSTYLE:ON - } - ++round; - } - } - } - - private static CuratorFramework buildCuratorClient() { - CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); - int retryIntervalMilliseconds = 500; - int maxRetries = 3; - builder.connectString(getConnectionString()) - .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) - .namespace("test"); - builder.sessionTimeoutMs(60 * 1000); - builder.connectionTimeoutMs(500); - return builder.build(); - } - - private static boolean isIgnoredException(final Throwable cause) { - return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; - } - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } -} diff --git a/spring/boot-starter/pom.xml b/spring/boot-starter/pom.xml index 805c895f81..d747fdf586 100644 --- a/spring/boot-starter/pom.xml +++ b/spring/boot-starter/pom.xml @@ -32,6 +32,12 @@ elasticjob-spring-core ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + org.springframework.boot @@ -53,10 +59,6 @@ spring-boot-starter-test test - - org.apache.curator - curator-test - com.h2database h2 diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java index 2e4a8630fa..c95e430916 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.AnnotationCustomJob; import org.apache.shardingsphere.elasticjob.spring.core.scanner.ElasticJobScan; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -46,7 +46,7 @@ class ElasticJobSpringBootScannerTest { @BeforeAll static void init() { - EmbedTestingServer.start(); + new EmbedTestingServer(18181).start(); AnnotationCustomJob.reset(); } diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 6774eb45c2..2cd365349d 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -24,10 +24,10 @@ import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; -import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob; import org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; @@ -60,19 +60,21 @@ @ActiveProfiles("elasticjob") class ElasticJobSpringBootTest { + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(18181); + @Autowired private ApplicationContext applicationContext; @BeforeAll static void init() { - EmbedTestingServer.start(); + EMBED_TESTING_SERVER.start(); } @Test void assertZookeeperProperties() { assertNotNull(applicationContext); ZookeeperProperties actual = applicationContext.getBean(ZookeeperProperties.class); - assertThat(actual.getServerLists(), is(EmbedTestingServer.getConnectionString())); + assertThat(actual.getServerLists(), is(EMBED_TESTING_SERVER.getConnectionString())); assertThat(actual.getNamespace(), is("elasticjob-spring-boot-starter")); } diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/EmbedTestingServer.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/EmbedTestingServer.java deleted file mode 100644 index dacd73e0c9..0000000000 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/EmbedTestingServer.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.elasticjob.spring.boot.job.fixture; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.CuratorFrameworkFactory; -import org.apache.curator.framework.imps.CuratorFrameworkState; -import org.apache.curator.retry.ExponentialBackoffRetry; -import org.apache.curator.test.TestingServer; -import org.apache.zookeeper.KeeperException; - -import java.io.IOException; -import java.util.Collection; -import java.util.concurrent.TimeUnit; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@Slf4j -public final class EmbedTestingServer { - - private static final int PORT = 18181; - - private static volatile TestingServer testingServer; - - private static final Object INIT_LOCK = new Object(); - - /** - * Start embed zookeeper server. - */ - public static void start() { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); - return; - } - log.info("Starting embed zookeeper server..."); - synchronized (INIT_LOCK) { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); - return; - } - start0(); - waitTestingServerReady(); - } - } - - private static void start0() { - try { - testingServer = new TestingServer(PORT, true); - // CHECKSTYLE:OFF - } catch (final Exception ex) { - // CHECKSTYLE:ON - if (!isIgnoredException(ex)) { - throw new RuntimeException(ex); - } else { - log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); - } - } finally { - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - testingServer.close(); - } catch (final IOException ignored) { - } - log.info("Close embed zookeeper server done"); - })); - } - } - - private static void waitTestingServerReady() { - int maxRetries = 60; - try (CuratorFramework client = buildCuratorClient()) { - client.start(); - int round = 0; - while (round < maxRetries) { - try { - if (client.getZookeeperClient().isConnected()) { - log.info("client is connected"); - break; - } - if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { - CuratorFrameworkState state = client.getState(); - Collection childrenKeys = client.getChildren().forPath("/"); - log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); - break; - } - // CHECKSTYLE:OFF - } catch (final Exception ignored) { - // CHECKSTYLE:ON - } - ++round; - } - } - } - - private static CuratorFramework buildCuratorClient() { - CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); - int retryIntervalMilliseconds = 500; - int maxRetries = 3; - builder.connectString(getConnectionString()) - .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) - .namespace("test"); - builder.sessionTimeoutMs(60 * 1000); - builder.connectionTimeoutMs(500); - return builder.build(); - } - - private static boolean isIgnoredException(final Throwable cause) { - return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; - } - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } -} diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java index ac3bfea062..42736a9dd6 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.reg.snapshot; import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -39,7 +39,7 @@ class ElasticJobSnapshotServiceConfigurationTest { @BeforeAll static void init() { - EmbedTestingServer.start(); + new EmbedTestingServer(18181).start(); } @Test diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java index 89f029a5b8..c88e187d7f 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.tracing; -import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -45,7 +45,7 @@ class TracingConfigurationTest { @BeforeAll static void init() { - EmbedTestingServer.start(); + new EmbedTestingServer(18181).start(); } @Test diff --git a/test/pom.xml b/test/pom.xml new file mode 100644 index 0000000000..d2a8a291e1 --- /dev/null +++ b/test/pom.xml @@ -0,0 +1,33 @@ + + + + + 4.0.0 + + org.apache.shardingsphere.elasticjob + elasticjob + 3.1.0-SNAPSHOT + + elasticjob-test + pom + ${project.artifactId} + + + util + + diff --git a/test/util/pom.xml b/test/util/pom.xml new file mode 100644 index 0000000000..96e14fc0f2 --- /dev/null +++ b/test/util/pom.xml @@ -0,0 +1,40 @@ + + + + + 4.0.0 + + org.apache.shardingsphere.elasticjob + elasticjob-test + 3.1.0-SNAPSHOT + + elasticjob-test-util + ${project.artifactId} + + + + org.apache.curator + curator-framework + + + org.apache.curator + curator-test + compile + + + diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/EmbedTestingServer.java b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/EmbedTestingServer.java similarity index 88% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/EmbedTestingServer.java rename to test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/EmbedTestingServer.java index 6c704fb401..ee460f25cb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/EmbedTestingServer.java +++ b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/EmbedTestingServer.java @@ -15,10 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.fixture; +package org.apache.shardingsphere.elasticjob.test.util; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; @@ -31,20 +30,23 @@ import java.util.Collection; import java.util.concurrent.TimeUnit; -@NoArgsConstructor(access = AccessLevel.PRIVATE) +/** + * Embed ZooKeeper testing server. + */ +@RequiredArgsConstructor @Slf4j public final class EmbedTestingServer { - private static final int PORT = 7181; - private static volatile TestingServer testingServer; private static final Object INIT_LOCK = new Object(); + private final int port; + /** * Start embed zookeeper server. */ - public static void start() { + public void start() { if (null != testingServer) { log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); return; @@ -60,9 +62,9 @@ public static void start() { } } - private static void start0() { + private void start0() { try { - testingServer = new TestingServer(PORT, true); + testingServer = new TestingServer(port, true); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON @@ -82,7 +84,7 @@ private static void start0() { } } - private static void waitTestingServerReady() { + private void waitTestingServerReady() { int maxRetries = 60; try (CuratorFramework client = buildCuratorClient()) { client.start(); @@ -108,7 +110,7 @@ private static void waitTestingServerReady() { } } - private static CuratorFramework buildCuratorClient() { + private CuratorFramework buildCuratorClient() { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); int retryIntervalMilliseconds = 500; int maxRetries = 3; @@ -120,7 +122,7 @@ private static CuratorFramework buildCuratorClient() { return builder.build(); } - private static boolean isIgnoredException(final Throwable cause) { + private boolean isIgnoredException(final Throwable cause) { return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; } @@ -129,7 +131,7 @@ private static boolean isIgnoredException(final Throwable cause) { * * @return connection string */ - public static String getConnectionString() { - return "localhost:" + PORT; + public String getConnectionString() { + return "localhost:" + port; } } From 33273fbc027af927b79d5b54fcab0a78bdaa82ff Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sat, 28 Oct 2023 23:46:13 +0800 Subject: [PATCH 113/178] Use EmbedTestingServer on lifecycle module (#2329) --- lifecycle/pom.xml | 7 + .../AbstractEmbedZookeeperBaseTest.java | 138 ------------------ .../lifecycle/api/JobAPIFactoryTest.java | 24 ++- .../reg/RegistryCenterFactoryTest.java | 20 ++- 4 files changed, 37 insertions(+), 152 deletions(-) delete mode 100644 lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/AbstractEmbedZookeeperBaseTest.java diff --git a/lifecycle/pom.xml b/lifecycle/pom.xml index c9b00630ed..e3166172b3 100644 --- a/lifecycle/pom.xml +++ b/lifecycle/pom.xml @@ -39,6 +39,13 @@ provided + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + commons-codec commons-codec diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/AbstractEmbedZookeeperBaseTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/AbstractEmbedZookeeperBaseTest.java deleted file mode 100644 index b2ab7d1bde..0000000000 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/AbstractEmbedZookeeperBaseTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.elasticjob.lifecycle; - -import lombok.extern.slf4j.Slf4j; -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.CuratorFrameworkFactory; -import org.apache.curator.framework.imps.CuratorFrameworkState; -import org.apache.curator.retry.ExponentialBackoffRetry; -import org.apache.curator.test.TestingServer; -import org.apache.zookeeper.KeeperException; -import org.junit.jupiter.api.BeforeAll; - -import java.io.IOException; -import java.util.Collection; -import java.util.concurrent.TimeUnit; - -@Slf4j -public abstract class AbstractEmbedZookeeperBaseTest { - - private static final int PORT = 8181; - - private static volatile TestingServer testingServer; - - private static final Object INIT_LOCK = new Object(); - - @BeforeAll - static void setUp() { - startEmbedTestingServer(); - } - - /** - * Start embed zookeeper server. - */ - private static void startEmbedTestingServer() { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); - return; - } - log.info("Starting embed zookeeper server..."); - synchronized (INIT_LOCK) { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); - return; - } - start0(); - waitTestingServerReady(); - } - } - - private static void start0() { - try { - testingServer = new TestingServer(PORT, true); - // CHECKSTYLE:OFF - } catch (final Exception ex) { - // CHECKSTYLE:ON - if (!isIgnoredException(ex)) { - throw new RuntimeException(ex); - } else { - log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); - } - } finally { - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - testingServer.close(); - } catch (final IOException ignored) { - } - log.info("Close embed zookeeper server done"); - })); - } - } - - private static void waitTestingServerReady() { - int maxRetries = 60; - try (CuratorFramework client = buildCuratorClient()) { - client.start(); - int round = 0; - while (round < maxRetries) { - try { - if (client.getZookeeperClient().isConnected()) { - log.info("client is connected"); - break; - } - if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { - CuratorFrameworkState state = client.getState(); - Collection childrenKeys = client.getChildren().forPath("/"); - log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); - break; - } - // CHECKSTYLE:OFF - } catch (final Exception ignored) { - // CHECKSTYLE:ON - } - ++round; - } - } - } - - private static CuratorFramework buildCuratorClient() { - CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); - int retryIntervalMilliseconds = 500; - int maxRetries = 3; - builder.connectString(getConnectionString()) - .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) - .namespace("test"); - builder.sessionTimeoutMs(60 * 1000); - builder.connectionTimeoutMs(500); - return builder.build(); - } - - private static boolean isIgnoredException(final Throwable cause) { - return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; - } - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } -} diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java index 53eb758cbd..bf9e40f677 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java @@ -17,41 +17,49 @@ package org.apache.shardingsphere.elasticjob.lifecycle.api; -import org.apache.shardingsphere.elasticjob.lifecycle.AbstractEmbedZookeeperBaseTest; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; -class JobAPIFactoryTest extends AbstractEmbedZookeeperBaseTest { +class JobAPIFactoryTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(8181); + + @BeforeAll + static void setUp() { + EMBED_TESTING_SERVER.start(); + } @Test void assertCreateJobConfigAPI() { - assertThat(JobAPIFactory.createJobConfigurationAPI(getConnectionString(), "namespace", null), instanceOf(JobConfigurationAPI.class)); + assertThat(JobAPIFactory.createJobConfigurationAPI(EMBED_TESTING_SERVER.getConnectionString(), "namespace", null), instanceOf(JobConfigurationAPI.class)); } @Test void assertCreateJobOperateAPI() { - assertThat(JobAPIFactory.createJobOperateAPI(getConnectionString(), "namespace", null), instanceOf(JobOperateAPI.class)); + assertThat(JobAPIFactory.createJobOperateAPI(EMBED_TESTING_SERVER.getConnectionString(), "namespace", null), instanceOf(JobOperateAPI.class)); } @Test void assertCreateServerOperateAPI() { - assertThat(JobAPIFactory.createShardingOperateAPI(getConnectionString(), "namespace", null), instanceOf(ShardingOperateAPI.class)); + assertThat(JobAPIFactory.createShardingOperateAPI(EMBED_TESTING_SERVER.getConnectionString(), "namespace", null), instanceOf(ShardingOperateAPI.class)); } @Test void assertCreateJobStatisticsAPI() { - assertThat(JobAPIFactory.createJobStatisticsAPI(getConnectionString(), "namespace", null), instanceOf(JobStatisticsAPI.class)); + assertThat(JobAPIFactory.createJobStatisticsAPI(EMBED_TESTING_SERVER.getConnectionString(), "namespace", null), instanceOf(JobStatisticsAPI.class)); } @Test void assertCreateServerStatisticsAPI() { - assertThat(JobAPIFactory.createServerStatisticsAPI(getConnectionString(), "namespace", null), instanceOf(ServerStatisticsAPI.class)); + assertThat(JobAPIFactory.createServerStatisticsAPI(EMBED_TESTING_SERVER.getConnectionString(), "namespace", null), instanceOf(ServerStatisticsAPI.class)); } @Test void assertCreateShardingStatisticsAPI() { - assertThat(JobAPIFactory.createShardingStatisticsAPI(getConnectionString(), "namespace", null), instanceOf(ShardingStatisticsAPI.class)); + assertThat(JobAPIFactory.createShardingStatisticsAPI(EMBED_TESTING_SERVER.getConnectionString(), "namespace", null), instanceOf(ShardingStatisticsAPI.class)); } } diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java index 22c6eaaa09..48ba2e25be 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java @@ -17,10 +17,11 @@ package org.apache.shardingsphere.elasticjob.lifecycle.internal.reg; -import org.apache.shardingsphere.elasticjob.lifecycle.AbstractEmbedZookeeperBaseTest; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import java.lang.reflect.Method; @@ -29,26 +30,33 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertNull; -class RegistryCenterFactoryTest extends AbstractEmbedZookeeperBaseTest { +class RegistryCenterFactoryTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(8181); + + @BeforeAll + static void setUp() { + EMBED_TESTING_SERVER.start(); + } @Test void assertCreateCoordinatorRegistryCenterWithoutDigest() throws ReflectiveOperationException { - ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "namespace", null)); + ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(EMBED_TESTING_SERVER.getConnectionString(), "namespace", null)); assertThat(zkConfig.getNamespace(), is("namespace")); assertNull(zkConfig.getDigest()); } @Test void assertCreateCoordinatorRegistryCenterWithDigest() throws ReflectiveOperationException { - ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "namespace", "digest")); + ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(EMBED_TESTING_SERVER.getConnectionString(), "namespace", "digest")); assertThat(zkConfig.getNamespace(), is("namespace")); assertThat(zkConfig.getDigest(), is("digest")); } @Test void assertCreateCoordinatorRegistryCenterFromCache() throws ReflectiveOperationException { - RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "otherNamespace", null); - ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(getConnectionString(), "otherNamespace", null)); + RegistryCenterFactory.createCoordinatorRegistryCenter(EMBED_TESTING_SERVER.getConnectionString(), "otherNamespace", null); + ZookeeperConfiguration zkConfig = getZookeeperConfiguration(RegistryCenterFactory.createCoordinatorRegistryCenter(EMBED_TESTING_SERVER.getConnectionString(), "otherNamespace", null)); assertThat(zkConfig.getNamespace(), is("otherNamespace")); assertNull(zkConfig.getDigest()); } From 7b5a5406ae501e620fb316017c63bf77b46ae095 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 29 Oct 2023 00:28:18 +0800 Subject: [PATCH 114/178] Use EmbedTestingServer on spring-namespace module (#2330) --- lifecycle/pom.xml | 4 - spring/namespace/pom.xml | 11 +- .../job/AbstractJobSpringIntegrateTest.java | 17 ++- .../AbstractOneOffJobSpringIntegrateTest.java | 17 ++- .../job/JobSpringNamespaceWithRefTest.java | 17 ++- .../job/JobSpringNamespaceWithTypeTest.java | 15 +- .../OneOffJobSpringNamespaceWithRefTest.java | 17 ++- .../OneOffJobSpringNamespaceWithTypeTest.java | 15 +- .../AbstractJobSpringIntegrateTest.java | 17 ++- .../SnapshotSpringNamespaceDisableTest.java | 15 +- .../SnapshotSpringNamespaceEnableTest.java | 15 +- ...okeeperJUnitJupiterSpringContextTests.java | 33 ---- .../EmbedZookeeperTestExecutionListener.java | 142 ------------------ 13 files changed, 129 insertions(+), 206 deletions(-) delete mode 100644 spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java delete mode 100644 spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/EmbedZookeeperTestExecutionListener.java diff --git a/lifecycle/pom.xml b/lifecycle/pom.xml index e3166172b3..6432c4edf0 100644 --- a/lifecycle/pom.xml +++ b/lifecycle/pom.xml @@ -50,9 +50,5 @@ commons-codec commons-codec - - org.apache.curator - curator-test - diff --git a/spring/namespace/pom.xml b/spring/namespace/pom.xml index 53a038bb7d..48ba28d340 100644 --- a/spring/namespace/pom.xml +++ b/spring/namespace/pom.xml @@ -52,6 +52,13 @@ provided + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + org.springframework spring-context @@ -65,10 +72,6 @@ org.aspectj aspectjweaver - - org.apache.curator - curator-test - org.springframework spring-test diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java index 0fe0e9f515..aa501154de 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractJobSpringIntegrateTest.java @@ -19,15 +19,18 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.concurrent.TimeUnit; @@ -35,8 +38,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(SpringExtension.class) @RequiredArgsConstructor -public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +public abstract class AbstractJobSpringIntegrateTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); private final String simpleJobName; @@ -45,6 +51,11 @@ public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJU @Autowired private CoordinatorRegistryCenter regCenter; + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } + @BeforeEach @AfterEach void reset() { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index d690c6b49b..3682c0b2a2 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -20,16 +20,19 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.FooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; -import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.concurrent.TimeUnit; @@ -37,8 +40,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(SpringExtension.class) @RequiredArgsConstructor -public abstract class AbstractOneOffJobSpringIntegrateTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +public abstract class AbstractOneOffJobSpringIntegrateTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); private final String simpleJobName; @@ -50,6 +56,11 @@ public abstract class AbstractOneOffJobSpringIntegrateTest extends AbstractZooke @Autowired private CoordinatorRegistryCenter regCenter; + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } + @BeforeEach @AfterEach void reset() { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java index 3443e123f2..e4cf732ee7 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithRefTest.java @@ -18,15 +18,18 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.concurrent.TimeUnit; @@ -34,14 +37,22 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(SpringExtension.class) @ContextConfiguration(locations = "classpath:META-INF/job/withJobRef.xml") -class JobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class JobSpringNamespaceWithRefTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); private final String simpleJobName = "simpleElasticJob_job_ref"; @Autowired private CoordinatorRegistryCenter regCenter; + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } + @BeforeEach @AfterEach void reset() { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java index e33cd687c7..7dbc902389 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/JobSpringNamespaceWithTypeTest.java @@ -18,15 +18,18 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.util.ReflectionTestUtils; import java.util.concurrent.TimeUnit; @@ -35,8 +38,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(SpringExtension.class) @ContextConfiguration(locations = "classpath:META-INF/job/withJobType.xml") -class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class JobSpringNamespaceWithTypeTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); private final String scriptJobName = "scriptElasticJob_job_type"; @@ -45,6 +51,11 @@ class JobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpring private Scheduler scheduler; + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } + @AfterEach void tearDown() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(scheduler.getCurrentlyExecutingJobs().isEmpty(), is(true))); diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index c2e5c17d31..9d6003fd3a 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -19,16 +19,19 @@ import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.concurrent.TimeUnit; @@ -36,8 +39,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(SpringExtension.class) @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobRef.xml") -class OneOffJobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class OneOffJobSpringNamespaceWithRefTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); private final String oneOffSimpleJobName = "oneOffSimpleElasticJobRef"; @@ -47,6 +53,11 @@ class OneOffJobSpringNamespaceWithRefTest extends AbstractZookeeperJUnitJupiterS @Autowired private CoordinatorRegistryCenter regCenter; + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } + @BeforeEach @AfterEach void reset() { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index 784cbada79..6bffa1ae08 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -19,21 +19,27 @@ import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.concurrent.TimeUnit; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(SpringExtension.class) @ContextConfiguration(locations = "classpath:META-INF/job/oneOffWithJobType.xml") -class OneOffJobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class OneOffJobSpringNamespaceWithTypeTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); private final String scriptJobName = "oneOffScriptElasticJob_job_type"; @@ -43,6 +49,11 @@ class OneOffJobSpringNamespaceWithTypeTest extends AbstractZookeeperJUnitJupiter @Autowired private CoordinatorRegistryCenter regCenter; + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } + @AfterEach void tearDown() { JobRegistry.getInstance().shutdown(scriptJobName); diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java index a28f60b4cc..8a84cb0fda 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/scanner/AbstractJobSpringIntegrateTest.java @@ -19,14 +19,17 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.annotation.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.util.concurrent.TimeUnit; @@ -34,14 +37,22 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; +@ExtendWith(SpringExtension.class) @RequiredArgsConstructor -public abstract class AbstractJobSpringIntegrateTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +public abstract class AbstractJobSpringIntegrateTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); private final String simpleJobName; @Autowired private CoordinatorRegistryCenter regCenter; + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } + @BeforeEach @AfterEach void reset() { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java index 126a792343..96ad3b721a 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceDisableTest.java @@ -18,16 +18,27 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot; import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.io.IOException; import static org.junit.jupiter.api.Assertions.assertThrows; +@ExtendWith(SpringExtension.class) @ContextConfiguration(locations = "classpath:META-INF/snapshot/snapshotDisabled.xml") -class SnapshotSpringNamespaceDisableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class SnapshotSpringNamespaceDisableTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); + + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } @Test void assertSnapshotDisable() { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java index a52e334832..d7d9a33d7c 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/snapshot/SnapshotSpringNamespaceEnableTest.java @@ -17,16 +17,27 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.snapshot; -import org.apache.shardingsphere.elasticjob.spring.namespace.test.AbstractZookeeperJUnitJupiterSpringContextTests; +import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import java.io.IOException; import static org.junit.jupiter.api.Assertions.assertNull; +@ExtendWith(SpringExtension.class) @ContextConfiguration(locations = "classpath:META-INF/snapshot/snapshotEnabled.xml") -class SnapshotSpringNamespaceEnableTest extends AbstractZookeeperJUnitJupiterSpringContextTests { +class SnapshotSpringNamespaceEnableTest { + + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(3181); + + @BeforeAll + static void init() { + EMBED_TESTING_SERVER.start(); + } @Test void assertSnapshotEnable() throws IOException { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java deleted file mode 100644 index bde8ca1248..0000000000 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/AbstractZookeeperJUnitJupiterSpringContextTests.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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.elasticjob.spring.namespace.test; - -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.test.context.TestExecutionListeners; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -/** - * Background reference AbstractJUnit4SpringContextTests - * and spring-projects/spring-framework#29149. - * - * @see org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests - */ -@ExtendWith(SpringExtension.class) -@TestExecutionListeners(listeners = EmbedZookeeperTestExecutionListener.class, inheritListeners = false, mergeMode = TestExecutionListeners.MergeMode.MERGE_WITH_DEFAULTS) -public abstract class AbstractZookeeperJUnitJupiterSpringContextTests { -} diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/EmbedZookeeperTestExecutionListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/EmbedZookeeperTestExecutionListener.java deleted file mode 100644 index f79ac9100b..0000000000 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/test/EmbedZookeeperTestExecutionListener.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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.elasticjob.spring.namespace.test; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.curator.framework.CuratorFramework; -import org.apache.curator.framework.CuratorFrameworkFactory; -import org.apache.curator.framework.imps.CuratorFrameworkState; -import org.apache.curator.retry.ExponentialBackoffRetry; -import org.apache.curator.test.TestingServer; -import org.apache.zookeeper.KeeperException; -import org.springframework.test.context.TestContext; -import org.springframework.test.context.support.AbstractTestExecutionListener; - -import java.io.IOException; -import java.util.Collection; -import java.util.concurrent.TimeUnit; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -@Slf4j -public final class EmbedZookeeperTestExecutionListener extends AbstractTestExecutionListener { - - private static final int PORT = 3181; - - private static volatile TestingServer testingServer; - - private static final Object INIT_LOCK = new Object(); - - @Override - public void beforeTestClass(final TestContext testContext) { - startEmbedTestingServer(); - } - - /** - * Start embed zookeeper server. - */ - private static void startEmbedTestingServer() { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 1, on {}", testingServer.getConnectString()); - return; - } - log.info("Starting embed zookeeper server..."); - synchronized (INIT_LOCK) { - if (null != testingServer) { - log.info("Embed zookeeper server already exists 2, on {}", testingServer.getConnectString()); - return; - } - start0(); - waitTestingServerReady(); - } - } - - private static void start0() { - try { - testingServer = new TestingServer(PORT, true); - // CHECKSTYLE:OFF - } catch (final Exception ex) { - // CHECKSTYLE:ON - if (!isIgnoredException(ex)) { - throw new RuntimeException(ex); - } else { - log.warn("Start embed zookeeper server got exception: {}", ex.getMessage()); - } - } finally { - Runtime.getRuntime().addShutdownHook(new Thread(() -> { - try { - testingServer.close(); - } catch (final IOException ignored) { - } - log.info("Close embed zookeeper server done"); - })); - } - } - - private static void waitTestingServerReady() { - int maxRetries = 60; - try (CuratorFramework client = buildCuratorClient()) { - client.start(); - int round = 0; - while (round < maxRetries) { - try { - if (client.getZookeeperClient().isConnected()) { - log.info("client is connected"); - break; - } - if (client.blockUntilConnected(500, TimeUnit.MILLISECONDS)) { - CuratorFrameworkState state = client.getState(); - Collection childrenKeys = client.getChildren().forPath("/"); - log.info("TestingServer connected, state={}, childrenKeys={}", state, childrenKeys); - break; - } - // CHECKSTYLE:OFF - } catch (final Exception ignored) { - // CHECKSTYLE:ON - } - ++round; - } - } - } - - private static CuratorFramework buildCuratorClient() { - CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); - int retryIntervalMilliseconds = 500; - int maxRetries = 3; - builder.connectString(getConnectionString()) - .retryPolicy(new ExponentialBackoffRetry(retryIntervalMilliseconds, maxRetries, retryIntervalMilliseconds * maxRetries)) - .namespace("test"); - builder.sessionTimeoutMs(60 * 1000); - builder.connectionTimeoutMs(500); - return builder.build(); - } - - private static boolean isIgnoredException(final Throwable cause) { - return cause instanceof KeeperException.ConnectionLossException || cause instanceof KeeperException.NoNodeException || cause instanceof KeeperException.NodeExistsException; - } - - /** - * Get the connection string. - * - * @return connection string - */ - public static String getConnectionString() { - return "localhost:" + PORT; - } -} From 7873f492ce5b36cc3163d244a097f980bd813332 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 29 Oct 2023 10:36:33 +0800 Subject: [PATCH 115/178] Add skip deploy on test module --- pom.xml | 8 ++++++++ test/util/pom.xml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/pom.xml b/pom.xml index 49db7719f4..605d772382 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,7 @@ 1.8 [3.5.0,) UTF-8 + false 5.4.1 @@ -509,6 +510,13 @@ maven-source-plugin ${maven-source-plugin.version} + + maven-deploy-plugin + ${maven-deploy-plugin.version} + + ${maven.deploy.skip} + + net.nicoulaj.maven.plugins checksum-maven-plugin diff --git a/test/util/pom.xml b/test/util/pom.xml index 96e14fc0f2..272a0e545a 100644 --- a/test/util/pom.xml +++ b/test/util/pom.xml @@ -26,6 +26,10 @@ elasticjob-test-util ${project.artifactId} + + true + + org.apache.curator From fbd53d1e2f33bcd61dabf654860480488b4830b6 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 29 Oct 2023 12:03:58 +0800 Subject: [PATCH 116/178] Remove useless org.apache.maven.plugins declaration (#2332) * Remove useless org.apache.maven.plugins declaration * Remove useless org.apache.maven.plugins declaration --- examples/pom.xml | 1 - pom.xml | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/examples/pom.xml b/examples/pom.xml index 35960d578e..329a324c37 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -119,7 +119,6 @@ - org.apache.maven.plugins maven-compiler-plugin ${java.version} diff --git a/pom.xml b/pom.xml index 605d772382..16392a4cd1 100644 --- a/pom.xml +++ b/pom.xml @@ -411,7 +411,6 @@ - org.apache.maven.plugins maven-compiler-plugin ${maven-compiler-plugin.version} @@ -422,27 +421,22 @@ - org.apache.maven.plugins maven-resources-plugin ${maven-resources-plugin.version} - org.apache.maven.plugins maven-jar-plugin ${maven-jar-plugin.version} - org.apache.maven.plugins maven-surefire-plugin ${maven-surefire-plugin.version} - org.apache.maven.plugins maven-surefire-report-plugin ${maven-surefire-report-plugin.version} - org.apache.maven.plugins maven-site-plugin ${maven-site-plugin.version} @@ -458,7 +452,6 @@ - org.apache.maven.plugins maven-enforcer-plugin [1.0.0,) @@ -471,7 +464,6 @@ - org.apache.maven.plugins maven-plugin-plugin [1.0.0,) @@ -487,7 +479,6 @@ - org.apache.maven.plugins maven-plugin-plugin ${maven-plugin-plugin.version} @@ -501,12 +492,10 @@ - org.apache.maven.plugins maven-javadoc-plugin ${maven-javadoc-plugin.version} - org.apache.maven.plugins maven-source-plugin ${maven-source-plugin.version} @@ -548,7 +537,6 @@ - org.apache.maven.plugins maven-source-plugin @@ -561,7 +549,6 @@ - org.apache.maven.plugins maven-javadoc-plugin true @@ -580,7 +567,6 @@ - org.apache.maven.plugins maven-enforcer-plugin ${maven-enforcer-plugin.version} @@ -663,7 +649,6 @@ - org.apache.maven.plugins maven-project-info-reports-plugin ${maven-project-info-reports-plugin.version} @@ -671,7 +656,6 @@ - org.apache.maven.plugins maven-jxr-plugin ${maven-jxr-plugin.version} @@ -694,7 +678,6 @@ - org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} @@ -703,7 +686,6 @@ - org.apache.maven.plugins maven-pmd-plugin ${maven-pmd-plugin.version} @@ -846,7 +828,6 @@ - org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} @@ -902,7 +883,6 @@ apache-rat-plugin - org.apache.maven.plugins maven-checkstyle-plugin ${maven-checkstyle-plugin.version} From 4944f53a73a241643de8f6118efa10f1ff638d44 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 29 Oct 2023 12:22:34 +0800 Subject: [PATCH 117/178] Use Awaitility to instead of Thread.sleep (#2333) --- ecosystem/tracing/api/pom.xml | 5 +++++ .../elasticjob/tracing/JobTracingEventBusTest.java | 8 ++++---- .../api/bootstrap/impl/OneOffJobBootstrapTest.java | 11 +++++------ registry-center/provider/zookeeper-curator/pom.xml | 4 ++++ .../reg/zookeeper/ZookeeperElectionServiceTest.java | 7 +++---- .../ZookeeperRegistryCenterExecuteInLeaderTest.java | 2 +- 6 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ecosystem/tracing/api/pom.xml b/ecosystem/tracing/api/pom.xml index db999d0723..2d1c9eedfd 100644 --- a/ecosystem/tracing/api/pom.xml +++ b/ecosystem/tracing/api/pom.xml @@ -42,5 +42,10 @@ org.apache.commons commons-lang3 + + + org.awaitility + awaitility + diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java index d1ba019871..239950f667 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java @@ -24,6 +24,7 @@ import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; import org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListener; +import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentMatchers; @@ -31,6 +32,7 @@ import org.mockito.junit.jupiter.MockitoExtension; import java.lang.reflect.Field; +import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; @@ -55,13 +57,11 @@ void assertRegisterFailure() { } @Test - void assertPost() throws InterruptedException { + void assertPost() { jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("TEST", jobEventCaller)); assertIsRegistered(true); jobTracingEventBus.post(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); - while (!TestTracingListener.isExecutionEventCalled()) { - Thread.sleep(100L); - } + Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(TestTracingListener::isExecutionEventCalled); verify(jobEventCaller).call(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java index 91e7c4d678..908a0ee81d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -25,6 +25,7 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -33,6 +34,7 @@ import org.quartz.SchedulerException; import java.lang.reflect.Field; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import static org.hamcrest.CoreMatchers.is; @@ -91,14 +93,14 @@ void assertShutdown() throws SchedulerException { assertTrue(getScheduler(oneOffJobBootstrap).isShutdown()); } - @SneakyThrows + @SneakyThrows(ReflectiveOperationException.class) private JobScheduler getJobScheduler(final OneOffJobBootstrap oneOffJobBootstrap) { Field field = OneOffJobBootstrap.class.getDeclaredField("jobScheduler"); field.setAccessible(true); return (JobScheduler) field.get(oneOffJobBootstrap); } - @SneakyThrows + @SneakyThrows(ReflectiveOperationException.class) private Scheduler getScheduler(final OneOffJobBootstrap oneOffJobBootstrap) { JobScheduler jobScheduler = getJobScheduler(oneOffJobBootstrap); Field schedulerField = JobScheduleController.class.getDeclaredField("scheduler"); @@ -106,11 +108,8 @@ private Scheduler getScheduler(final OneOffJobBootstrap oneOffJobBootstrap) { return (Scheduler) schedulerField.get(jobScheduler.getJobScheduleController()); } - @SneakyThrows private void blockUtilFinish(final OneOffJobBootstrap oneOffJobBootstrap, final AtomicInteger counter) { Scheduler scheduler = getScheduler(oneOffJobBootstrap); - while (0 == counter.get() || !scheduler.getCurrentlyExecutingJobs().isEmpty()) { - Thread.sleep(100L); - } + Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(() -> 0 != counter.get() && scheduler.getCurrentlyExecutingJobs().isEmpty()); } } diff --git a/registry-center/provider/zookeeper-curator/pom.xml b/registry-center/provider/zookeeper-curator/pom.xml index 5390269236..97609432a2 100644 --- a/registry-center/provider/zookeeper-curator/pom.xml +++ b/registry-center/provider/zookeeper-curator/pom.xml @@ -52,5 +52,9 @@ org.apache.curator curator-recipes + + org.awaitility + awaitility + diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 9256db60f0..131479fd03 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -25,6 +25,7 @@ import org.apache.curator.test.KillSession; import org.apache.shardingsphere.elasticjob.reg.base.ElectionCandidate; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -33,6 +34,7 @@ import java.lang.reflect.Field; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import java.util.function.Supplier; import static org.mockito.Mockito.atLeastOnce; @@ -79,11 +81,8 @@ void assertContend() throws Exception { verify(anotherElectionCandidate, atLeastOnce()).stopLeadership(); } - @SneakyThrows private void blockUntilCondition(final Supplier condition) { - while (!condition.get()) { - Thread.sleep(100L); - } + Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(condition::get); } @SneakyThrows diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java index 2bead8dae4..f44fb68d2d 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java @@ -82,7 +82,7 @@ public void execute() { handleConcurrentExecution(); } try { - Thread.sleep(100); + Thread.sleep(100L); } catch (final InterruptedException ex) { waitingThread.interrupt(); } From d413b44e7bd399601cc5a6294e636293ba593056 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 29 Oct 2023 13:23:46 +0800 Subject: [PATCH 118/178] Add ReflectionUtils into test module (#2334) * Add ReflectionUtils into test module * Add ReflectionUtils into test module * Add ReflectionUtils into test module * Add ReflectionUtils into test module --- .../fixture/DingtalkInternalController.java | 9 ++- ecosystem/error-handler/type/email/pom.xml | 7 ++ .../email/EmailJobErrorHandlerTest.java | 18 ++--- .../DistributeOnceElasticJobListenerTest.java | 2 +- .../kernel/integrate/BaseIntegrateTest.java | 2 +- .../integrate/BaseAnnotationTest.java | 2 +- .../config/ConfigurationServiceTest.java | 2 +- .../config/RescheduleListenerManagerTest.java | 2 +- .../election/ElectionListenerManagerTest.java | 2 +- .../internal/election/LeaderServiceTest.java | 2 +- .../internal/executor/JobFacadeTest.java | 2 +- .../handler/JobErrorHandlerReloaderTest.java | 20 ++---- .../ExecutorServiceReloaderTest.java | 20 ++---- .../failover/FailoverListenerManagerTest.java | 2 +- .../failover/FailoverServiceTest.java | 2 +- .../GuaranteeListenerManagerTest.java | 2 +- .../guarantee/GuaranteeServiceTest.java | 2 +- .../instance/InstanceServiceTest.java | 2 +- .../instance/ShutdownListenerManagerTest.java | 2 +- .../listener/ListenerManagerTest.java | 2 +- ...stryCenterConnectionStateListenerTest.java | 2 +- .../reconcile/ReconcileServiceTest.java | 2 +- .../internal/schedule/JobRegistryTest.java | 2 +- .../schedule/JobScheduleControllerTest.java | 2 +- .../schedule/SchedulerFacadeTest.java | 2 +- .../internal/server/ServerServiceTest.java | 2 +- .../internal/setup/SetUpFacadeTest.java | 2 +- .../sharding/ExecutionContextServiceTest.java | 2 +- .../sharding/ExecutionServiceTest.java | 2 +- .../MonitorExecutionListenerManagerTest.java | 2 +- .../sharding/ShardingListenerManagerTest.java | 2 +- .../sharding/ShardingServiceTest.java | 2 +- .../snapshot/BaseSnapshotServiceTest.java | 2 +- .../snapshot/SnapshotServiceDisableTest.java | 15 ++-- .../internal/storage/JobNodeStorageTest.java | 2 +- .../trigger/TriggerListenerManagerTest.java | 2 +- .../ZookeeperElectionServiceTest.java | 13 +--- .../ZookeeperRegistryCenterForAuthTest.java | 29 ++++---- .../ZookeeperRegistryCenterListenerTest.java | 10 +-- .../ZookeeperRegistryCenterModifyTest.java | 48 ++++++------- ...eeperRegistryCenterQueryWithCacheTest.java | 4 +- ...erRegistryCenterQueryWithoutCacheTest.java | 4 +- ...ookeeperRegistryCenterTransactionTest.java | 4 +- .../ZookeeperRegistryCenterWatchTest.java | 4 +- .../RegistryCenterEnvironmentPreparer.java | 37 ++++++++++ .../util/ZookeeperRegistryCenterTestUtil.java | 68 ------------------- .../NettyRestfulServiceConfiguration.java | 17 +++-- .../boot/job/ElasticJobSpringBootTest.java | 30 +++----- .../test}/util/ReflectionUtils.java | 37 ++++++++-- 49 files changed, 202 insertions(+), 252 deletions(-) create mode 100644 registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/env/RegistryCenterEnvironmentPreparer.java delete mode 100644 registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel => test/util/src/main/java/org/apache/shardingsphere/elasticjob/test}/util/ReflectionUtils.java (61%) diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java index 1dd005ba9a..08572cacf2 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java @@ -31,7 +31,6 @@ import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; -import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; @@ -53,7 +52,7 @@ public final class DingtalkInternalController implements RestfulController { * @param timestamp timestamp * @param sign sign * @param body body - * @return send Result + * @return send result */ @SneakyThrows @Mapping(method = Http.POST, path = "/send") @@ -64,7 +63,7 @@ public String send(@Param(name = "access_token", source = ParamSource.QUERY) fin if (!ACCESS_TOKEN.equals(accessToken)) { return GsonFactory.getGson().toJson(ImmutableMap.of("errcode", 300001, "errmsg", "token is not exist")); } - String content = Map.class.cast(body.get("text")).get("content").toString(); + String content = ((Map) body.get("text")).get("content").toString(); if (!content.startsWith(KEYWORD)) { return GsonFactory.getGson().toJson(ImmutableMap.of("errcode", 310000, "errmsg", "keywords not in content, more: [https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq]")); } @@ -78,11 +77,11 @@ public String send(@Param(name = "access_token", source = ParamSource.QUERY) fin return GsonFactory.getGson().toJson(ImmutableMap.of("errcode", 0, "errmsg", "ok")); } - private String sign(final Long timestamp) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException { + private String sign(final Long timestamp) throws NoSuchAlgorithmException, InvalidKeyException { String stringToSign = timestamp + "\n" + SECRET; Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(SECRET.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8)); - return new String(Base64.getEncoder().encode(signData), StandardCharsets.UTF_8.name()); + return new String(Base64.getEncoder().encode(signData), StandardCharsets.UTF_8); } } diff --git a/ecosystem/error-handler/type/email/pom.xml b/ecosystem/error-handler/type/email/pom.xml index 82932ddd94..78853f3cae 100644 --- a/ecosystem/error-handler/type/email/pom.xml +++ b/ecosystem/error-handler/type/email/pom.xml @@ -32,6 +32,13 @@ ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + com.sun.mail javax.mail diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index 78a1cf3597..3c216f262d 100644 --- a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -20,8 +20,8 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -33,9 +33,9 @@ import javax.mail.Address; import javax.mail.Message; +import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; -import java.lang.reflect.Field; import java.util.List; import java.util.Properties; @@ -81,11 +81,10 @@ void assertHandleExceptionWithMessagingException() { } @Test - @SneakyThrows - void assertHandleExceptionSucceedInSendingEmail() { + void assertHandleExceptionSucceedInSendingEmail() throws MessagingException { EmailJobErrorHandler emailJobErrorHandler = getEmailJobErrorHandler(createConfigurationProperties()); setUpMockSession(session); - setFieldValue(emailJobErrorHandler, "session", session); + ReflectionUtils.setFieldValue(emailJobErrorHandler, "session", session); Throwable cause = new RuntimeException("test"); String jobName = "test_job"; when(session.getTransport()).thenReturn(transport); @@ -102,17 +101,10 @@ private EmailJobErrorHandler getEmailJobErrorHandler(final Properties props) { private void setUpMockSession(final Session session) { Properties props = new Properties(); - setFieldValue(session, "props", props); + ReflectionUtils.setFieldValue(session, "props", props); when(session.getProperties()).thenReturn(props); } - @SneakyThrows - private void setFieldValue(final Object target, final String fieldName, final Object fieldValue) { - Field field = target.getClass().getDeclaredField(fieldName); - field.setAccessible(true); - field.set(target, fieldValue); - } - private Properties createConfigurationProperties() { Properties result = new Properties(); result.setProperty(EmailPropertiesConstants.HOST, "localhost"); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java index eebcfcf16f..8b4b57f30b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java index 55b803da28..3a8b340c6c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java index 3b729764cb..483bf963c6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java @@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java index 3b445d3ee6..62d8c8e150 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java index dd2006808d..a59224e5fe 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManagerTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java index eca460720a..448ec37ce3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/ElectionListenerManagerTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java index d5729780cc..4b37afff8e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderServiceTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java index 2ab96dba5a..b84c0191d2 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java @@ -28,7 +28,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java index 741b22113f..cbf0899268 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java @@ -17,17 +17,16 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.IgnoreJobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.LogJobErrorHandler; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.lang.reflect.Field; import java.util.Properties; import static org.hamcrest.CoreMatchers.is; @@ -59,8 +58,8 @@ void assertReload() { JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { when(jobErrorHandler.getType()).thenReturn("mock"); - setField(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); - setField(jobErrorHandlerReloader, "props", new Properties()); + ReflectionUtils.setFieldValue(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); + ReflectionUtils.setFieldValue(jobErrorHandlerReloader, "props", new Properties()); String newJobErrorHandlerType = "LOG"; JobConfiguration newJobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(newJobErrorHandlerType).build(); jobErrorHandlerReloader.reloadIfNecessary(newJobConfig); @@ -86,20 +85,9 @@ void assertUnnecessaryToReload() { void assertShutdown() { JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { - setField(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); + ReflectionUtils.setFieldValue(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); jobErrorHandlerReloader.close(); verify(jobErrorHandler).close(); } } - - @SneakyThrows - private void setField(final Object target, final String fieldName, final Object value) { - Field field = target.getClass().getDeclaredField(fieldName); - boolean originAccessible = field.isAccessible(); - if (!originAccessible) { - field.setAccessible(true); - } - field.set(target, value); - field.setAccessible(originAccessible); - } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java index e2bc5e5cd7..dff7117bf4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java @@ -17,14 +17,13 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.lang.reflect.Field; import java.util.concurrent.ExecutorService; import static org.hamcrest.CoreMatchers.is; @@ -54,8 +53,8 @@ void assertInitialize() { @Test void assertReload() { ExecutorServiceReloader executorServiceReloader = new ExecutorServiceReloader(JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").build()); - setField(executorServiceReloader, "jobExecutorThreadPoolSizeProviderType", "mock"); - setField(executorServiceReloader, "executorService", mockExecutorService); + ReflectionUtils.setFieldValue(executorServiceReloader, "jobExecutorThreadPoolSizeProviderType", "mock"); + ReflectionUtils.setFieldValue(executorServiceReloader, "executorService", mockExecutorService); JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).build(); executorServiceReloader.reloadIfNecessary(jobConfig); verify(mockExecutorService).shutdown(); @@ -80,19 +79,8 @@ void assertUnnecessaryToReload() { @Test void assertShutdown() { ExecutorServiceReloader executorServiceReloader = new ExecutorServiceReloader(JobConfiguration.newBuilder("job", 1).jobExecutorThreadPoolSizeProviderType("SINGLE_THREAD").build()); - setField(executorServiceReloader, "executorService", mockExecutorService); + ReflectionUtils.setFieldValue(executorServiceReloader, "executorService", mockExecutorService); executorServiceReloader.close(); verify(mockExecutorService).shutdown(); } - - @SneakyThrows - private void setField(final Object target, final String fieldName, final Object value) { - Field field = target.getClass().getDeclaredField(fieldName); - boolean originAccessible = field.isAccessible(); - if (!originAccessible) { - field.setAccessible(true); - } - field.set(target, value); - field.setAccessible(originAccessible); - } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java index ed83b72c79..a5dfafa4c5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManagerTest.java @@ -28,7 +28,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java index 700d42121d..5d2c1a0a07 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverServiceTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java index b51f851ea4..8de42c1832 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java index b57d475955..0db9a27296 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java index 7fbb551c63..ae01059cda 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceServiceTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java index d6bcf4146f..da8c0f7624 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/ShutdownListenerManagerTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.SchedulerFacade; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManagerTest.java index 3b24e005f8..e952653c42 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManagerTest.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.kernel.internal.trigger.TriggerListenerManager; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java index 2eaacd6992..ce55241397 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/RegistryCenterConnectionStateListenerTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener.State; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java index c086172ac4..ea91034a79 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/reconcile/ReconcileServiceTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java index c9e8f46c83..04e7fe28b3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobRegistryTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java index 7638f6eae9..b85551f921 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java index b97a253e8c..a63e34cae6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/SchedulerFacadeTest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java index 5352f9f69f..d808119bb5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerServiceTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java index 0a9393b62e..c61434c7e8 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacadeTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.reconcile.ReconcileService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java index 08d77ff142..04f2c930a2 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java index b67b695994..e66d54fdcc 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java index b492175833..48101f36c3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManagerTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java index 2006512257..06f8f75f36 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManagerTest.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent.Type; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java index df8c4f550e..f0d9c9eaa0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingServiceTest.java @@ -26,7 +26,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java index abf59a8761..023a62c148 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java index 62c5a02fbe..1024fa4bd4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java @@ -17,12 +17,11 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import java.io.IOException; -import java.lang.reflect.Field; import java.net.ServerSocket; import static org.junit.jupiter.api.Assertions.assertNull; @@ -41,21 +40,15 @@ void assertMonitorWithDumpCommand() { @Test void assertPortInvalid() { - assertThrows(IllegalArgumentException.class, () -> { - SnapshotService snapshotService = new SnapshotService(getREG_CENTER(), -1); - snapshotService.listen(); - }); + assertThrows(IllegalArgumentException.class, () -> new SnapshotService(getREG_CENTER(), -1).listen()); } @Test - @SneakyThrows - void assertListenException() { + void assertListenException() throws IOException { ServerSocket serverSocket = new ServerSocket(9898); SnapshotService snapshotService = new SnapshotService(getREG_CENTER(), 9898); snapshotService.listen(); serverSocket.close(); - Field field = snapshotService.getClass().getDeclaredField("serverSocket"); - field.setAccessible(true); - assertNull(field.get(snapshotService)); + assertNull(ReflectionUtils.getFieldValue(snapshotService, "serverSocket")); } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java index 2d43bcb628..33e69ac903 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.storage; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerNotifierManager; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; import org.apache.shardingsphere.elasticjob.reg.exception.RegException; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java index bb070e647a..811bbce8eb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/trigger/TriggerListenerManagerTest.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; -import org.apache.shardingsphere.elasticjob.kernel.util.ReflectionUtils; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; import org.junit.jupiter.api.BeforeEach; diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 131479fd03..50cecb141b 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -25,6 +25,7 @@ import org.apache.curator.test.KillSession; import org.apache.shardingsphere.elasticjob.reg.base.ElectionCandidate; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -32,7 +33,6 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.lang.reflect.Field; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; @@ -74,7 +74,7 @@ void assertContend() throws Exception { KillSession.kill(client.getZookeeperClient().getZooKeeper()); service.stop(); blockUntilCondition(() -> hasLeadership(anotherService)); - ((CountDownLatch) getFieldValue(anotherService, "leaderLatch")).countDown(); + ((CountDownLatch) ReflectionUtils.getFieldValue(anotherService, "leaderLatch")).countDown(); blockUntilCondition(() -> !hasLeadership(anotherService)); anotherService.stop(); verify(anotherElectionCandidate, atLeastOnce()).startLeadership(); @@ -87,13 +87,6 @@ private void blockUntilCondition(final Supplier condition) { @SneakyThrows private boolean hasLeadership(final ZookeeperElectionService zookeeperElectionService) { - return ((LeaderSelector) getFieldValue(zookeeperElectionService, "leaderSelector")).hasLeadership(); - } - - @SneakyThrows - private Object getFieldValue(final Object target, final String fieldName) { - Field field = target.getClass().getDeclaredField(fieldName); - field.setAccessible(true); - return field.get(target); + return ((LeaderSelector) ReflectionUtils.getFieldValue(zookeeperElectionService, "leaderSelector")).hasLeadership(); } } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index 34fa53a612..95592c85c8 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -20,7 +20,7 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.RetryOneTime; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.env.RegistryCenterEnvironmentPreparer; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.zookeeper.KeeperException.NoAuthException; import org.junit.jupiter.api.AfterAll; @@ -49,7 +49,7 @@ static void setUp() { ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(5000); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); zkRegCenter.init(); - ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); + RegistryCenterEnvironmentPreparer.persist(zkRegCenter); } @AfterAll @@ -59,22 +59,25 @@ static void tearDown() { @Test void assertInitWithDigestSuccess() throws Exception { - CuratorFramework client = CuratorFrameworkFactory.builder() - .connectString(EMBED_TESTING_SERVER.getConnectionString()) - .retryPolicy(new RetryOneTime(2000)) - .authorization("digest", "digest:password".getBytes()).build(); - client.start(); - client.blockUntilConnected(); - assertThat(client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"), is("deepNested".getBytes())); + try ( + CuratorFramework client = CuratorFrameworkFactory.builder() + .connectString(EMBED_TESTING_SERVER.getConnectionString()) + .retryPolicy(new RetryOneTime(2000)) + .authorization("digest", "digest:password".getBytes()).build()) { + client.start(); + client.blockUntilConnected(); + assertThat(client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"), is("deepNested".getBytes())); + } } @Test void assertInitWithDigestFailure() { assertThrows(NoAuthException.class, () -> { - CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); - client.start(); - client.blockUntilConnected(); - client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"); + try (CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000))) { + client.start(); + client.blockUntilConnected(); + client.getData().forPath("/" + ZookeeperRegistryCenterForAuthTest.class.getName() + "/test/deep/nested"); + } }); } } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java index 1b1657b417..205861e812 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterListenerTest.java @@ -22,7 +22,7 @@ import org.apache.curator.framework.recipes.cache.CuratorCache; import org.apache.curator.framework.recipes.cache.CuratorCacheListener; import org.apache.curator.framework.state.ConnectionStateListener; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -66,8 +66,8 @@ class ZookeeperRegistryCenterListenerTest { @BeforeEach void setUp() { regCenter = new ZookeeperRegistryCenter(null); - ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "caches", caches); - ZookeeperRegistryCenterTestUtil.setFieldValue(regCenter, "client", client); + ReflectionUtils.setFieldValue(regCenter, "caches", caches); + ReflectionUtils.setFieldValue(regCenter, "client", client); } @Test @@ -140,11 +140,11 @@ void testRemoveConnStateListenerEmptyListeners() { @SuppressWarnings("unchecked") private Map> getConnStateListeners() { - return (Map>) ZookeeperRegistryCenterTestUtil.getFieldValue(regCenter, "connStateListeners"); + return (Map>) ReflectionUtils.getFieldValue(regCenter, "connStateListeners"); } @SuppressWarnings("unchecked") private Map> getDataListeners() { - return (Map>) ZookeeperRegistryCenterTestUtil.getFieldValue(regCenter, "dataListeners"); + return (Map>) ReflectionUtils.getFieldValue(regCenter, "dataListeners"); } } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index 10eda57b7c..d4a1c9c5fc 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -20,7 +20,7 @@ import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.retry.RetryOneTime; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.env.RegistryCenterEnvironmentPreparer; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -49,7 +49,7 @@ static void setUp() { zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); - ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); + RegistryCenterEnvironmentPreparer.persist(zkRegCenter); } @AfterAll @@ -91,35 +91,37 @@ void assertPersistEphemeral() throws Exception { void assertPersistSequential() throws Exception { assertThat(zkRegCenter.persistSequential("/sequential/test_sequential", "test_value"), startsWith("/sequential/test_sequential")); assertThat(zkRegCenter.persistSequential("/sequential/test_sequential", "test_value"), startsWith("/sequential/test_sequential")); - CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); - client.start(); - client.blockUntilConnected(); - List actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); - assertThat(actual.size(), is(2)); - for (String each : actual) { - assertThat(each, startsWith("test_sequential")); - assertThat(zkRegCenter.get("/sequential/" + each), startsWith("test_value")); + try (CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000))) { + client.start(); + client.blockUntilConnected(); + List actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); + assertThat(actual.size(), is(2)); + for (String each : actual) { + assertThat(each, startsWith("test_sequential")); + assertThat(zkRegCenter.get("/sequential/" + each), startsWith("test_value")); + } + zkRegCenter.remove("/sequential"); + assertFalse(zkRegCenter.isExisted("/sequential")); } - zkRegCenter.remove("/sequential"); - assertFalse(zkRegCenter.isExisted("/sequential")); } @Test void assertPersistEphemeralSequential() throws Exception { zkRegCenter.persistEphemeralSequential("/sequential/test_ephemeral_sequential"); zkRegCenter.persistEphemeralSequential("/sequential/test_ephemeral_sequential"); - CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); - client.start(); - client.blockUntilConnected(); - List actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); - assertThat(actual.size(), is(2)); - for (String each : actual) { - assertThat(each, startsWith("test_ephemeral_sequential")); + try (CuratorFramework client = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000))) { + client.start(); + client.blockUntilConnected(); + List actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); + assertThat(actual.size(), is(2)); + for (String each : actual) { + assertThat(each, startsWith("test_ephemeral_sequential")); + } + zkRegCenter.close(); + actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); + assertTrue(actual.isEmpty()); + zkRegCenter.init(); } - zkRegCenter.close(); - actual = client.getChildren().forPath("/" + ZookeeperRegistryCenterModifyTest.class.getName() + "/sequential"); - assertTrue(actual.isEmpty()); - zkRegCenter.init(); } @Test diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index 5a27306906..59eb61cf83 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.env.RegistryCenterEnvironmentPreparer; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -42,7 +42,7 @@ static void setUp() { zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); - ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); + RegistryCenterEnvironmentPreparer.persist(zkRegCenter); zkRegCenter.addCacheData("/test"); } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index 99fa81960c..c370073a85 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.env.RegistryCenterEnvironmentPreparer; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -47,7 +47,7 @@ static void setUp() { ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); zkRegCenter.init(); - ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); + RegistryCenterEnvironmentPreparer.persist(zkRegCenter); zkRegCenter.addCacheData("/other"); } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index d520728109..b08795a04b 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.env.RegistryCenterEnvironmentPreparer; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.zookeeper.KeeperException; import org.junit.jupiter.api.BeforeAll; @@ -51,7 +51,7 @@ static void setUp() { @BeforeEach void setup() { - ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); + RegistryCenterEnvironmentPreparer.persist(zkRegCenter); } @Test diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index 8318bc4f9d..1ead5e3f15 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -19,7 +19,7 @@ import org.apache.curator.utils.ThreadUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.util.ZookeeperRegistryCenterTestUtil; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.env.RegistryCenterEnvironmentPreparer; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -49,7 +49,7 @@ static void setUp() { zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); - ZookeeperRegistryCenterTestUtil.persist(zkRegCenter); + RegistryCenterEnvironmentPreparer.persist(zkRegCenter); } @AfterAll diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/env/RegistryCenterEnvironmentPreparer.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/env/RegistryCenterEnvironmentPreparer.java new file mode 100644 index 0000000000..1e86d4e932 --- /dev/null +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/env/RegistryCenterEnvironmentPreparer.java @@ -0,0 +1,37 @@ +/* + * 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.elasticjob.reg.zookeeper.env; + +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; + +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class RegistryCenterEnvironmentPreparer { + + /** + * Persist the data to registry center. + * + * @param registryCenter ZooKeeper registry center + */ + public static void persist(final ZookeeperRegistryCenter registryCenter) { + registryCenter.persist("/test", "test"); + registryCenter.persist("/test/deep/nested", "deepNested"); + registryCenter.persist("/test/child", "child"); + } +} diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java deleted file mode 100644 index dc16f0dd99..0000000000 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/util/ZookeeperRegistryCenterTestUtil.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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.elasticjob.reg.zookeeper.util; - -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; - -import java.lang.reflect.Field; - -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class ZookeeperRegistryCenterTestUtil { - - /** - * Persist the data to registry center. - * - * @param zookeeperRegistryCenter registry center - */ - public static void persist(final ZookeeperRegistryCenter zookeeperRegistryCenter) { - zookeeperRegistryCenter.persist("/test", "test"); - zookeeperRegistryCenter.persist("/test/deep/nested", "deepNested"); - zookeeperRegistryCenter.persist("/test/child", "child"); - } - - /** - * Set field value use reflection. - * - * @param target target object - * @param fieldName field name - * @param fieldValue field value - */ - @SneakyThrows - public static void setFieldValue(final Object target, final String fieldName, final Object fieldValue) { - Field field = target.getClass().getDeclaredField(fieldName); - field.setAccessible(true); - field.set(target, fieldValue); - } - - /** - * Get field value use reflection. - * - * @param target target object - * @param fieldName field name - * @return field value - */ - @SneakyThrows - public static Object getFieldValue(final Object target, final String fieldName) { - Field field = target.getClass().getDeclaredField(fieldName); - field.setAccessible(true); - return field.get(target); - } -} diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java index 9a68787261..4b4414b1fc 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulServiceConfiguration.java @@ -32,27 +32,26 @@ /** * Configuration for {@link NettyRestfulService}. */ -@Getter @RequiredArgsConstructor +@Getter +@Setter public final class NettyRestfulServiceConfiguration { + private final List filterInstances = new LinkedList<>(); + + private final List controllerInstances = new LinkedList<>(); + + private final Map, ExceptionHandler> exceptionHandlers = new HashMap<>(); + private final int port; - @Setter private String host; /** * If trailing slash sensitive, /foo/bar is not equals to /foo/bar/. */ - @Setter private boolean trailingSlashSensitive; - private final List filterInstances = new LinkedList<>(); - - private final List controllerInstances = new LinkedList<>(); - - private final Map, ExceptionHandler> exceptionHandlers = new HashMap<>(); - /** * Add instances of {@link Filter}. * diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 2cd365349d..1937eacd02 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -28,6 +28,7 @@ import org.apache.shardingsphere.elasticjob.spring.boot.reg.ZookeeperProperties; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; @@ -39,7 +40,6 @@ import org.springframework.test.context.ActiveProfiles; import javax.sql.DataSource; -import java.lang.reflect.Field; import java.sql.SQLException; import java.util.Arrays; import java.util.Collection; @@ -147,36 +147,26 @@ void assertJobScheduleCreation() { } @Test - void assertOneOffJobBootstrapBeanName() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException { + void assertOneOffJobBootstrapBeanName() { assertNotNull(applicationContext); - OneOffJobBootstrap customTestJobBootstrap = - applicationContext.getBean("customTestJobBean", OneOffJobBootstrap.class); + OneOffJobBootstrap customTestJobBootstrap = applicationContext.getBean("customTestJobBean", OneOffJobBootstrap.class); assertNotNull(customTestJobBootstrap); - Field jobSchedulerField = customTestJobBootstrap.getClass().getDeclaredField("jobScheduler"); - jobSchedulerField.setAccessible(true); - Collection extraConfigurations = - ((JobScheduler) jobSchedulerField.get(customTestJobBootstrap)).getJobConfig().getExtraConfigurations(); - assertThat(extraConfigurations.size(), is(0)); - OneOffJobBootstrap printTestJobBootstrap = - applicationContext.getBean("printTestJobBean", OneOffJobBootstrap.class); - jobSchedulerField = printTestJobBootstrap.getClass().getDeclaredField("jobScheduler"); - jobSchedulerField.setAccessible(true); - extraConfigurations = - ((JobScheduler) jobSchedulerField.get(printTestJobBootstrap)).getJobConfig().getExtraConfigurations(); - assertThat(extraConfigurations.size(), is(1)); + Collection extraConfigs = ((JobScheduler) ReflectionUtils.getFieldValue(customTestJobBootstrap, "jobScheduler")).getJobConfig().getExtraConfigurations(); + assertThat(extraConfigs.size(), is(0)); + OneOffJobBootstrap printTestJobBootstrap = applicationContext.getBean("printTestJobBean", OneOffJobBootstrap.class); + extraConfigs = ((JobScheduler) ReflectionUtils.getFieldValue(printTestJobBootstrap, "jobScheduler")).getJobConfig().getExtraConfigurations(); + assertThat(extraConfigs.size(), is(1)); } @Test void assertDefaultBeanNameWithClassJob() { assertNotNull(applicationContext); - assertNotNull(applicationContext.getBean("defaultBeanNameClassJobScheduleJobBootstrap", - ScheduleJobBootstrap.class)); + assertNotNull(applicationContext.getBean("defaultBeanNameClassJobScheduleJobBootstrap", ScheduleJobBootstrap.class)); } @Test void assertDefaultBeanNameWithTypeJob() { assertNotNull(applicationContext); - assertNotNull(applicationContext.getBean("defaultBeanNameTypeJobScheduleJobBootstrap", - ScheduleJobBootstrap.class)); + assertNotNull(applicationContext.getBean("defaultBeanNameTypeJobScheduleJobBootstrap", ScheduleJobBootstrap.class)); } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/util/ReflectionUtils.java b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/ReflectionUtils.java similarity index 61% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/util/ReflectionUtils.java rename to test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/ReflectionUtils.java index cc93be2bec..68e9e07d08 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/util/ReflectionUtils.java +++ b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/ReflectionUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.util; +package org.apache.shardingsphere.elasticjob.test.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -29,6 +29,25 @@ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class ReflectionUtils { + /** + * Get field value. + * + * @param target target object + * @param fieldName field name + * @return field value + */ + @SneakyThrows(ReflectiveOperationException.class) + public static Object getFieldValue(final Object target, final String fieldName) { + Field field = target.getClass().getDeclaredField(fieldName); + boolean originAccessible = field.isAccessible(); + if (!originAccessible) { + field.setAccessible(true); + } + Object result = field.get(target); + field.setAccessible(originAccessible); + return result; + } + /** * Set field value. * @@ -36,11 +55,15 @@ public final class ReflectionUtils { * @param fieldName field name * @param fieldValue field value */ - @SneakyThrows + @SneakyThrows(ReflectiveOperationException.class) public static void setFieldValue(final Object target, final String fieldName, final Object fieldValue) { Field field = target.getClass().getDeclaredField(fieldName); - field.setAccessible(true); + boolean originAccessible = field.isAccessible(); + if (!originAccessible) { + field.setAccessible(true); + } field.set(target, fieldValue); + field.setAccessible(originAccessible); } /** @@ -50,10 +73,14 @@ public static void setFieldValue(final Object target, final String fieldName, fi * @param fieldName field name * @param fieldValue field value */ - @SneakyThrows + @SneakyThrows(ReflectiveOperationException.class) public static void setSuperclassFieldValue(final Object target, final String fieldName, final Object fieldValue) { Field field = target.getClass().getSuperclass().getDeclaredField(fieldName); - field.setAccessible(true); + boolean originAccessible = field.isAccessible(); + if (!originAccessible) { + field.setAccessible(true); + } field.set(target, fieldValue); + field.setAccessible(originAccessible); } } From 58ae7ce2cfcf98aaa5f506a893082fd130549920 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 29 Oct 2023 13:45:04 +0800 Subject: [PATCH 119/178] Add exception declaration of @SneakyThrows --- .../handler/dingtalk/DingtalkJobErrorHandler.java | 4 ++-- .../fixture/DingtalkInternalController.java | 4 ++-- .../handler/wechat/WechatJobErrorHandler.java | 4 ++-- .../wechat/fixture/WechatInternalController.java | 6 ++---- .../tracing/rdb/storage/RDBStorageSQLMapper.java | 3 ++- .../elasticjob/infra/env/IpUtilsTest.java | 14 +++++--------- .../zookeeper/ZookeeperElectionServiceTest.java | 2 -- .../elasticjob/restful/NettyRestfulService.java | 2 +- .../pipeline/FilterChainInboundHandlerTest.java | 2 -- .../elasticjob/restful/pipeline/HttpClient.java | 2 +- .../restful/pipeline/NettyRestfulServiceTest.java | 5 ++--- 11 files changed, 19 insertions(+), 29 deletions(-) diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java index 175527e746..7fd77b094a 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java @@ -131,7 +131,7 @@ private String getJsonParameter(final String message) { private String getErrorMessage(final String jobName, final Throwable cause) { StringWriter writer = new StringWriter(); cause.printStackTrace(new PrintWriter(writer, true)); - String result = String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer.toString()); + String result = String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer); if (!Strings.isNullOrEmpty(keyword)) { result = keyword.concat(result); } @@ -143,7 +143,7 @@ public String getType() { return "DINGTALK"; } - @SneakyThrows + @SneakyThrows(IOException.class) @Override public void close() { httpclient.close(); diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java index 08572cacf2..1c2c6c7d5a 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java @@ -54,7 +54,6 @@ public final class DingtalkInternalController implements RestfulController { * @param body body * @return send result */ - @SneakyThrows @Mapping(method = Http.POST, path = "/send") public String send(@Param(name = "access_token", source = ParamSource.QUERY) final String accessToken, @Param(name = "timestamp", source = ParamSource.QUERY, required = false) final Long timestamp, @@ -77,7 +76,8 @@ public String send(@Param(name = "access_token", source = ParamSource.QUERY) fin return GsonFactory.getGson().toJson(ImmutableMap.of("errcode", 0, "errmsg", "ok")); } - private String sign(final Long timestamp) throws NoSuchAlgorithmException, InvalidKeyException { + @SneakyThrows({NoSuchAlgorithmException.class, InvalidKeyException.class}) + private String sign(final Long timestamp) { String stringToSign = timestamp + "\n" + SECRET; Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(SECRET.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java index 64db934c23..496e28d038 100644 --- a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java +++ b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java @@ -99,7 +99,7 @@ private String getJsonParameter(final String message) { private String getErrorMessage(final String jobName, final Throwable cause) { StringWriter stringWriter = new StringWriter(); cause.printStackTrace(new PrintWriter(stringWriter, true)); - return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, stringWriter.toString()); + return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, stringWriter); } @Override @@ -107,7 +107,7 @@ public String getType() { return "WECHAT"; } - @SneakyThrows + @SneakyThrows(IOException.class) @Override public void close() { httpclient.close(); diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java index 4acf631c6b..90d572abe8 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture; import com.google.common.collect.ImmutableMap; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.restful.Http; import org.apache.shardingsphere.elasticjob.restful.RestfulController; @@ -31,12 +30,11 @@ public final class WechatInternalController implements RestfulController { private static final String KEY = "mocked_key"; /** - * Send wechat message. + * Send Wechat message. * * @param key access token - * @return send Result + * @return send result */ - @SneakyThrows @Mapping(method = Http.POST, path = "/send") public String send(@Param(name = "key", source = ParamSource.QUERY) final String key) { if (!KEY.equals(key)) { diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java index e3751336f3..63e55d21bf 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java @@ -20,6 +20,7 @@ import lombok.Getter; import lombok.SneakyThrows; +import java.io.IOException; import java.io.InputStream; import java.util.Properties; @@ -66,7 +67,7 @@ public RDBStorageSQLMapper(final String sqlPropertiesFileName) { selectOriginalTaskIdForJobStatusTraceLog = props.getProperty("JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID"); } - @SneakyThrows + @SneakyThrows(IOException.class) private Properties loadProps(final String sqlPropertiesFileName) { Properties result = new Properties(); result.load(getPropertiesInputStream(sqlPropertiesFileName)); diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index 49fbe4a05a..bb948c623f 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.infra.env; -import lombok.SneakyThrows; import org.junit.jupiter.api.Test; +import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.Inet4Address; @@ -45,8 +45,7 @@ void assertGetIp() { } @Test - @SneakyThrows - void assertPreferredNetworkInterface() { + void assertPreferredNetworkInterface() throws ReflectiveOperationException { System.setProperty(IpUtils.PREFERRED_NETWORK_INTERFACE, "eth0"); Method declaredMethod = IpUtils.class.getDeclaredMethod("isPreferredNetworkInterface", NetworkInterface.class); declaredMethod.setAccessible(true); @@ -58,8 +57,7 @@ void assertPreferredNetworkInterface() { } @Test - @SneakyThrows - void assertPreferredNetworkAddress() { + void assertPreferredNetworkAddress() throws ReflectiveOperationException { Method declaredMethod = IpUtils.class.getDeclaredMethod("isPreferredAddress", InetAddress.class); declaredMethod.setAccessible(true); InetAddress inetAddress = mock(InetAddress.class); @@ -78,8 +76,7 @@ void assertPreferredNetworkAddress() { } @Test - @SneakyThrows - void assertGetFirstNetworkInterface() { + void assertGetFirstNetworkInterface() throws IOException, ReflectiveOperationException { InetAddress address1 = mock(Inet4Address.class); when(address1.isLoopbackAddress()).thenReturn(false); when(address1.isAnyLocalAddress()).thenReturn(false); @@ -113,8 +110,7 @@ void assertGetFirstNetworkInterface() { } @Test - @SneakyThrows - void assertGetHostName() { + void assertGetHostName() throws ReflectiveOperationException { assertNotNull(IpUtils.getHostName()); Field field = IpUtils.class.getDeclaredField("cachedHostName"); field.setAccessible(true); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 50cecb141b..440191c2e9 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -17,7 +17,6 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; -import lombok.SneakyThrows; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.recipes.leader.LeaderSelector; @@ -85,7 +84,6 @@ private void blockUntilCondition(final Supplier condition) { Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(condition::get); } - @SneakyThrows private boolean hasLeadership(final ZookeeperElectionService zookeeperElectionService) { return ((LeaderSelector) ReflectionUtils.getFieldValue(zookeeperElectionService, "leaderSelector")).hasLeadership(); } diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java index dfba296ad6..a12c5a7dd2 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java @@ -55,7 +55,7 @@ private void initServerBootstrap() { .childHandler(new RestfulServiceChannelInitializer(config)); } - @SneakyThrows + @SneakyThrows(InterruptedException.class) @Override public void startup() { initServerBootstrap(); diff --git a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java index 67cc066545..5bc635c1a6 100644 --- a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java +++ b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.restful.pipeline; import io.netty.channel.embedded.EmbeddedChannel; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.restful.Filter; import org.apache.shardingsphere.elasticjob.restful.handler.HandleContext; import org.apache.shardingsphere.elasticjob.restful.handler.Handler; @@ -52,7 +51,6 @@ void setUp() { } @Test - @SneakyThrows void assertNoFilter() { when(filterInstances.isEmpty()).thenReturn(true); channel.writeOneInbound(handleContext); diff --git a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java index 2c2296d138..6c38050090 100644 --- a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java +++ b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java @@ -49,7 +49,7 @@ public final class HttpClient { * @param consumer HTTP response consumer * @param timeoutSeconds wait for consume */ - @SneakyThrows + @SneakyThrows(InterruptedException.class) public static void request(final String host, final int port, final FullHttpRequest request, final Consumer consumer, final Long timeoutSeconds) { CountDownLatch countDownLatch = new CountDownLatch(1); EventLoopGroup eventLoopGroup = new NioEventLoopGroup(); diff --git a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java index 446feaeba7..eabf443a4f 100644 --- a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java +++ b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java @@ -26,7 +26,6 @@ import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpUtil; import io.netty.handler.codec.http.HttpVersion; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; @@ -39,6 +38,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; @@ -67,10 +67,9 @@ static void init() { restfulService.startup(); } - @SneakyThrows @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - void assertRequestWithParameters() { + void assertRequestWithParameters() throws UnsupportedEncodingException { String cron = "0 * * * * ?"; String uri = String.format("/job/myGroup/myJob?cron=%s", URLEncoder.encode(cron, "UTF-8")); String description = "Descriptions about this job."; From 0b9aab879a38adae1faa3e6e3bacd0ad1f2b60ab Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 29 Oct 2023 13:47:25 +0800 Subject: [PATCH 120/178] Add exception declaration of @SneakyThrows (#2335) --- .../handler/dingtalk/DingtalkJobErrorHandler.java | 4 ++-- .../fixture/DingtalkInternalController.java | 4 ++-- .../handler/wechat/WechatJobErrorHandler.java | 4 ++-- .../wechat/fixture/WechatInternalController.java | 6 ++---- .../tracing/rdb/storage/RDBStorageSQLMapper.java | 3 ++- .../elasticjob/infra/env/IpUtilsTest.java | 14 +++++--------- .../zookeeper/ZookeeperElectionServiceTest.java | 2 -- .../elasticjob/restful/NettyRestfulService.java | 2 +- .../pipeline/FilterChainInboundHandlerTest.java | 2 -- .../elasticjob/restful/pipeline/HttpClient.java | 2 +- .../restful/pipeline/NettyRestfulServiceTest.java | 5 ++--- 11 files changed, 19 insertions(+), 29 deletions(-) diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java index 175527e746..7fd77b094a 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java @@ -131,7 +131,7 @@ private String getJsonParameter(final String message) { private String getErrorMessage(final String jobName, final Throwable cause) { StringWriter writer = new StringWriter(); cause.printStackTrace(new PrintWriter(writer, true)); - String result = String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer.toString()); + String result = String.format("Job '%s' exception occur in job processing, caused by %s", jobName, writer); if (!Strings.isNullOrEmpty(keyword)) { result = keyword.concat(result); } @@ -143,7 +143,7 @@ public String getType() { return "DINGTALK"; } - @SneakyThrows + @SneakyThrows(IOException.class) @Override public void close() { httpclient.close(); diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java index 08572cacf2..1c2c6c7d5a 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java @@ -54,7 +54,6 @@ public final class DingtalkInternalController implements RestfulController { * @param body body * @return send result */ - @SneakyThrows @Mapping(method = Http.POST, path = "/send") public String send(@Param(name = "access_token", source = ParamSource.QUERY) final String accessToken, @Param(name = "timestamp", source = ParamSource.QUERY, required = false) final Long timestamp, @@ -77,7 +76,8 @@ public String send(@Param(name = "access_token", source = ParamSource.QUERY) fin return GsonFactory.getGson().toJson(ImmutableMap.of("errcode", 0, "errmsg", "ok")); } - private String sign(final Long timestamp) throws NoSuchAlgorithmException, InvalidKeyException { + @SneakyThrows({NoSuchAlgorithmException.class, InvalidKeyException.class}) + private String sign(final Long timestamp) { String stringToSign = timestamp + "\n" + SECRET; Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(SECRET.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java index 64db934c23..496e28d038 100644 --- a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java +++ b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java @@ -99,7 +99,7 @@ private String getJsonParameter(final String message) { private String getErrorMessage(final String jobName, final Throwable cause) { StringWriter stringWriter = new StringWriter(); cause.printStackTrace(new PrintWriter(stringWriter, true)); - return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, stringWriter.toString()); + return String.format("Job '%s' exception occur in job processing, caused by %s", jobName, stringWriter); } @Override @@ -107,7 +107,7 @@ public String getType() { return "WECHAT"; } - @SneakyThrows + @SneakyThrows(IOException.class) @Override public void close() { httpclient.close(); diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java index 4acf631c6b..90d572abe8 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture; import com.google.common.collect.ImmutableMap; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.restful.Http; import org.apache.shardingsphere.elasticjob.restful.RestfulController; @@ -31,12 +30,11 @@ public final class WechatInternalController implements RestfulController { private static final String KEY = "mocked_key"; /** - * Send wechat message. + * Send Wechat message. * * @param key access token - * @return send Result + * @return send result */ - @SneakyThrows @Mapping(method = Http.POST, path = "/send") public String send(@Param(name = "key", source = ParamSource.QUERY) final String key) { if (!KEY.equals(key)) { diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java index e3751336f3..63e55d21bf 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java @@ -20,6 +20,7 @@ import lombok.Getter; import lombok.SneakyThrows; +import java.io.IOException; import java.io.InputStream; import java.util.Properties; @@ -66,7 +67,7 @@ public RDBStorageSQLMapper(final String sqlPropertiesFileName) { selectOriginalTaskIdForJobStatusTraceLog = props.getProperty("JOB_STATUS_TRACE_LOG.SELECT_ORIGINAL_TASK_ID"); } - @SneakyThrows + @SneakyThrows(IOException.class) private Properties loadProps(final String sqlPropertiesFileName) { Properties result = new Properties(); result.load(getPropertiesInputStream(sqlPropertiesFileName)); diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index 49fbe4a05a..bb948c623f 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.infra.env; -import lombok.SneakyThrows; import org.junit.jupiter.api.Test; +import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.Inet4Address; @@ -45,8 +45,7 @@ void assertGetIp() { } @Test - @SneakyThrows - void assertPreferredNetworkInterface() { + void assertPreferredNetworkInterface() throws ReflectiveOperationException { System.setProperty(IpUtils.PREFERRED_NETWORK_INTERFACE, "eth0"); Method declaredMethod = IpUtils.class.getDeclaredMethod("isPreferredNetworkInterface", NetworkInterface.class); declaredMethod.setAccessible(true); @@ -58,8 +57,7 @@ void assertPreferredNetworkInterface() { } @Test - @SneakyThrows - void assertPreferredNetworkAddress() { + void assertPreferredNetworkAddress() throws ReflectiveOperationException { Method declaredMethod = IpUtils.class.getDeclaredMethod("isPreferredAddress", InetAddress.class); declaredMethod.setAccessible(true); InetAddress inetAddress = mock(InetAddress.class); @@ -78,8 +76,7 @@ void assertPreferredNetworkAddress() { } @Test - @SneakyThrows - void assertGetFirstNetworkInterface() { + void assertGetFirstNetworkInterface() throws IOException, ReflectiveOperationException { InetAddress address1 = mock(Inet4Address.class); when(address1.isLoopbackAddress()).thenReturn(false); when(address1.isAnyLocalAddress()).thenReturn(false); @@ -113,8 +110,7 @@ void assertGetFirstNetworkInterface() { } @Test - @SneakyThrows - void assertGetHostName() { + void assertGetHostName() throws ReflectiveOperationException { assertNotNull(IpUtils.getHostName()); Field field = IpUtils.class.getDeclaredField("cachedHostName"); field.setAccessible(true); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 50cecb141b..440191c2e9 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -17,7 +17,6 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; -import lombok.SneakyThrows; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.recipes.leader.LeaderSelector; @@ -85,7 +84,6 @@ private void blockUntilCondition(final Supplier condition) { Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(condition::get); } - @SneakyThrows private boolean hasLeadership(final ZookeeperElectionService zookeeperElectionService) { return ((LeaderSelector) ReflectionUtils.getFieldValue(zookeeperElectionService, "leaderSelector")).hasLeadership(); } diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java index dfba296ad6..a12c5a7dd2 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/NettyRestfulService.java @@ -55,7 +55,7 @@ private void initServerBootstrap() { .childHandler(new RestfulServiceChannelInitializer(config)); } - @SneakyThrows + @SneakyThrows(InterruptedException.class) @Override public void startup() { initServerBootstrap(); diff --git a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java index 67cc066545..5bc635c1a6 100644 --- a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java +++ b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/FilterChainInboundHandlerTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.restful.pipeline; import io.netty.channel.embedded.EmbeddedChannel; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.restful.Filter; import org.apache.shardingsphere.elasticjob.restful.handler.HandleContext; import org.apache.shardingsphere.elasticjob.restful.handler.Handler; @@ -52,7 +51,6 @@ void setUp() { } @Test - @SneakyThrows void assertNoFilter() { when(filterInstances.isEmpty()).thenReturn(true); channel.writeOneInbound(handleContext); diff --git a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java index 2c2296d138..6c38050090 100644 --- a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java +++ b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/HttpClient.java @@ -49,7 +49,7 @@ public final class HttpClient { * @param consumer HTTP response consumer * @param timeoutSeconds wait for consume */ - @SneakyThrows + @SneakyThrows(InterruptedException.class) public static void request(final String host, final int port, final FullHttpRequest request, final Consumer consumer, final Long timeoutSeconds) { CountDownLatch countDownLatch = new CountDownLatch(1); EventLoopGroup eventLoopGroup = new NioEventLoopGroup(); diff --git a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java index 446feaeba7..eabf443a4f 100644 --- a/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java +++ b/restful/src/test/java/org/apache/shardingsphere/elasticjob/restful/pipeline/NettyRestfulServiceTest.java @@ -26,7 +26,6 @@ import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.HttpUtil; import io.netty.handler.codec.http.HttpVersion; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; @@ -39,6 +38,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; +import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; @@ -67,10 +67,9 @@ static void init() { restfulService.startup(); } - @SneakyThrows @Test @Timeout(value = TESTCASE_TIMEOUT, unit = TimeUnit.MILLISECONDS) - void assertRequestWithParameters() { + void assertRequestWithParameters() throws UnsupportedEncodingException { String cron = "0 * * * * ?"; String uri = String.format("/job/myGroup/myJob?cron=%s", URLEncoder.encode(cron, "UTF-8")); String description = "Descriptions about this job."; From d52707f7f365b3d838337b0af63b23ce61c65da9 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 29 Oct 2023 20:51:25 +0800 Subject: [PATCH 121/178] Use ReflectionUtils for all reflection invocations --- ecosystem/tracing/api/pom.xml | 7 +++++ .../tracing/JobTracingEventBusTest.java | 26 ++++++------------- ecosystem/tracing/rdb/pom.xml | 7 +++++ .../rdb/listener/RDBTracingListenerTest.java | 12 ++------- infra/pom.xml | 7 +++++ .../elasticjob/infra/env/IpUtilsTest.java | 9 +++---- .../impl/OneOffJobBootstrapTest.java | 20 +++----------- .../executor/ElasticJobExecutorTest.java | 12 ++------- .../elasticjob/test/util/ReflectionUtils.java | 19 ++++++++++++++ 9 files changed, 59 insertions(+), 60 deletions(-) diff --git a/ecosystem/tracing/api/pom.xml b/ecosystem/tracing/api/pom.xml index 2d1c9eedfd..78dabbd173 100644 --- a/ecosystem/tracing/api/pom.xml +++ b/ecosystem/tracing/api/pom.xml @@ -38,6 +38,13 @@ ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + org.apache.commons commons-lang3 diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java index 239950f667..8b5d50161c 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing; import com.google.common.eventbus.EventBus; -import lombok.SneakyThrows; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobEvent; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; @@ -31,11 +31,10 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.lang.reflect.Field; import java.util.concurrent.TimeUnit; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -53,33 +52,24 @@ class JobTracingEventBusTest { @Test void assertRegisterFailure() { jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("FAIL", null)); - assertIsRegistered(false); + assertFalse((Boolean) ReflectionUtils.getFieldValue(jobTracingEventBus, "isRegistered")); } @Test void assertPost() { jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("TEST", jobEventCaller)); - assertIsRegistered(true); + assertTrue((Boolean) ReflectionUtils.getFieldValue(jobTracingEventBus, "isRegistered")); jobTracingEventBus.post(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(TestTracingListener::isExecutionEventCalled); verify(jobEventCaller).call(); } @Test - void assertPostWithoutListener() throws ReflectiveOperationException { + void assertPostWithoutListener() { jobTracingEventBus = new JobTracingEventBus(); - assertIsRegistered(false); - Field field = JobTracingEventBus.class.getDeclaredField("eventBus"); - field.setAccessible(true); - field.set(jobTracingEventBus, eventBus); + assertFalse((Boolean) ReflectionUtils.getFieldValue(jobTracingEventBus, "isRegistered")); + ReflectionUtils.setFieldValue(jobTracingEventBus, "eventBus", eventBus); jobTracingEventBus.post(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); verify(eventBus, times(0)).post(ArgumentMatchers.any()); } - - @SneakyThrows - private void assertIsRegistered(final boolean actual) { - Field field = JobTracingEventBus.class.getDeclaredField("isRegistered"); - field.setAccessible(true); - assertThat(field.get(jobTracingEventBus), is(actual)); - } } diff --git a/ecosystem/tracing/rdb/pom.xml b/ecosystem/tracing/rdb/pom.xml index 1dab41bf0c..8156d0e1d4 100644 --- a/ecosystem/tracing/rdb/pom.xml +++ b/ecosystem/tracing/rdb/pom.xml @@ -33,6 +33,13 @@ ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + org.apache.commons commons-dbcp2 diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 2e37512bb0..738fe3f344 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import lombok.SneakyThrows; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; @@ -33,7 +33,6 @@ import org.mockito.junit.jupiter.MockitoExtension; import javax.sql.DataSource; -import java.lang.reflect.Field; import java.sql.SQLException; import static org.mockito.Mockito.atMost; @@ -57,17 +56,10 @@ void setUp() throws SQLException { dataSource.setUsername("sa"); dataSource.setPassword(""); RDBTracingListener tracingListener = new RDBTracingListener(dataSource); - setRepository(tracingListener); + ReflectionUtils.setFieldValue(tracingListener, "repository", repository); jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration("RDB", dataSource)); } - @SneakyThrows - private void setRepository(final RDBTracingListener tracingListener) { - Field field = RDBTracingListener.class.getDeclaredField("repository"); - field.setAccessible(true); - field.set(tracingListener, repository); - } - @Test void assertPostJobExecutionEvent() { JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", JOB_NAME, JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); diff --git a/infra/pom.xml b/infra/pom.xml index b2cc16cb07..1a0a2aa4fa 100644 --- a/infra/pom.xml +++ b/infra/pom.xml @@ -33,6 +33,13 @@ ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + org.apache.commons commons-lang3 diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index bb948c623f..eb3bf70137 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -17,10 +17,10 @@ package org.apache.shardingsphere.elasticjob.infra.env; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import java.io.IOException; -import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.Inet4Address; import java.net.InetAddress; @@ -110,11 +110,8 @@ void assertGetFirstNetworkInterface() throws IOException, ReflectiveOperationExc } @Test - void assertGetHostName() throws ReflectiveOperationException { + void assertGetHostName() { assertNotNull(IpUtils.getHostName()); - Field field = IpUtils.class.getDeclaredField("cachedHostName"); - field.setAccessible(true); - String hostName = (String) field.get(null); - assertThat(hostName, is(IpUtils.getHostName())); + assertThat(ReflectionUtils.getStaticFieldValue(IpUtils.class, "cachedHostName"), is(IpUtils.getHostName())); } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java index 908a0ee81d..0d8fa2df2a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java @@ -17,14 +17,13 @@ package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduleController; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; @@ -33,7 +32,6 @@ import org.quartz.Scheduler; import org.quartz.SchedulerException; -import java.lang.reflect.Field; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -82,7 +80,7 @@ void assertExecute() { oneOffJobBootstrap.execute(); blockUtilFinish(oneOffJobBootstrap, counter); assertThat(counter.get(), is(SHARDING_TOTAL_COUNT)); - getJobScheduler(oneOffJobBootstrap).shutdown(); + ((JobScheduler) ReflectionUtils.getFieldValue(oneOffJobBootstrap, "jobScheduler")).shutdown(); } @Test @@ -93,19 +91,9 @@ void assertShutdown() throws SchedulerException { assertTrue(getScheduler(oneOffJobBootstrap).isShutdown()); } - @SneakyThrows(ReflectiveOperationException.class) - private JobScheduler getJobScheduler(final OneOffJobBootstrap oneOffJobBootstrap) { - Field field = OneOffJobBootstrap.class.getDeclaredField("jobScheduler"); - field.setAccessible(true); - return (JobScheduler) field.get(oneOffJobBootstrap); - } - - @SneakyThrows(ReflectiveOperationException.class) private Scheduler getScheduler(final OneOffJobBootstrap oneOffJobBootstrap) { - JobScheduler jobScheduler = getJobScheduler(oneOffJobBootstrap); - Field schedulerField = JobScheduleController.class.getDeclaredField("scheduler"); - schedulerField.setAccessible(true); - return (Scheduler) schedulerField.get(jobScheduler.getJobScheduleController()); + JobScheduler jobScheduler = (JobScheduler) ReflectionUtils.getFieldValue(oneOffJobBootstrap, "jobScheduler"); + return (Scheduler) ReflectionUtils.getFieldValue(jobScheduler.getJobScheduleController(), "scheduler"); } private void blockUtilFinish(final OneOffJobBootstrap oneOffJobBootstrap, final AtomicInteger counter) { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java index 984801d19a..fba118dce3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java @@ -17,7 +17,6 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor; -import lombok.SneakyThrows; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; @@ -25,6 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -34,7 +34,6 @@ import org.mockito.junit.jupiter.MockitoSettings; import org.mockito.quality.Strictness; -import java.lang.reflect.Field; import java.util.Collections; import java.util.HashMap; import java.util.Map; @@ -75,7 +74,7 @@ void setUp() { when(jobFacade.loadJobConfiguration(anyBoolean())).thenReturn(jobConfig); when(jobFacade.getJobRuntimeService()).thenReturn(jobRuntimeService); elasticJobExecutor = new ElasticJobExecutor(fooJob, jobConfig, jobFacade); - setJobItemExecutor(); + ReflectionUtils.setFieldValue(elasticJobExecutor, "jobItemExecutor", jobItemExecutor); } private JobConfiguration createJobConfiguration() { @@ -83,13 +82,6 @@ private JobConfiguration createJobConfiguration() { .cron("0/1 * * * * ?").shardingItemParameters("0=A,1=B,2=C").jobParameter("param").failover(true).misfire(false).jobErrorHandlerType("THROW").description("desc").build(); } - @SneakyThrows - private void setJobItemExecutor() { - Field field = ElasticJobExecutor.class.getDeclaredField("jobItemExecutor"); - field.setAccessible(true); - field.set(elasticJobExecutor, jobItemExecutor); - } - @Test void assertExecuteWhenCheckMaxTimeDiffSecondsIntolerable() { assertThrows(JobSystemException.class, () -> { diff --git a/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/ReflectionUtils.java b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/ReflectionUtils.java index 68e9e07d08..afcc2a2978 100644 --- a/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/ReflectionUtils.java +++ b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/ReflectionUtils.java @@ -48,6 +48,25 @@ public static Object getFieldValue(final Object target, final String fieldName) return result; } + /** + * Get static field value. + * + * @param target target class + * @param fieldName field name + * @return field value + */ + @SneakyThrows(ReflectiveOperationException.class) + public static Object getStaticFieldValue(final Class target, final String fieldName) { + Field field = target.getDeclaredField(fieldName); + boolean originAccessible = field.isAccessible(); + if (!originAccessible) { + field.setAccessible(true); + } + Object result = field.get(null); + field.setAccessible(originAccessible); + return result; + } + /** * Set field value. * From e0e86ca4f39cc9bece23d95a21724de3d0a5472c Mon Sep 17 00:00:00 2001 From: zhangliang Date: Sun, 29 Oct 2023 20:53:49 +0800 Subject: [PATCH 122/178] Use ReflectionUtils for all reflection invocations --- .../apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java index eacce54e45..eb3bf70137 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java @@ -113,5 +113,5 @@ void assertGetFirstNetworkInterface() throws IOException, ReflectiveOperationExc void assertGetHostName() { assertNotNull(IpUtils.getHostName()); assertThat(ReflectionUtils.getStaticFieldValue(IpUtils.class, "cachedHostName"), is(IpUtils.getHostName())); - } + } } From bfba7cd7e614ec95ac44a23430cf56625ba7fdc2 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 29 Oct 2023 22:13:22 +0800 Subject: [PATCH 123/178] Move TimeServiceTest to correct package (#2337) --- .../elasticjob/kernel/{ => internal}/time/TimeServiceTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{ => internal}/time/TimeServiceTest.java (89%) diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/time/TimeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeServiceTest.java similarity index 89% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/time/TimeServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeServiceTest.java index 6bac490370..db043dbf12 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/time/TimeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeServiceTest.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.time; +package org.apache.shardingsphere.elasticjob.kernel.internal.time; -import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertTrue; From cb2c0dbed620660722fb7303173aa84aedc19854 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Sun, 29 Oct 2023 23:04:56 +0800 Subject: [PATCH 124/178] Add e2e module (#2338) * Move TimeServiceTest to correct package * Add e2e module * Add e2e module --- ...asticjob.infra.listener.ElasticJobListener | 2 - test/e2e/pom.xml | 51 +++++++++++++++++++ .../elasticjob/test/e2e/BaseE2ETest.java | 6 +-- .../test/e2e/disable/DisabledJobE2ETest.java | 16 +++--- .../e2e/disable/OneOffDisabledJobE2ETest.java | 6 +-- .../disable/ScheduleDisabledJobE2ETest.java | 10 ++-- .../test/e2e/enable/EnabledJobE2ETest.java | 8 +-- .../e2e/enable/OneOffEnabledJobE2ETest.java | 12 ++--- .../e2e/enable/ScheduleEnabledJobE2ETest.java | 12 ++--- .../executor/E2EFixtureJobExecutor.java | 37 ++++++++++++++ .../test/e2e/fixture/job/E2EFixtureJob.java | 31 +++++++++++ .../e2e/fixture/job/E2EFixtureJobImpl.java | 38 ++++++++++++++ .../DistributeOnceE2EFixtureJobListener.java | 6 +-- .../listener/E2EFixtureJobListener.java | 4 +- ...asticjob.infra.listener.ElasticJobListener | 19 +++++++ ...elasticjob.spi.type.ClassedJobItemExecutor | 18 +++++++ test/e2e/src/test/resources/logback-test.xml | 48 +++++++++++++++++ test/pom.xml | 1 + 18 files changed, 283 insertions(+), 42 deletions(-) create mode 100644 test/e2e/pom.xml rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/BaseE2ETest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/DisabledJobE2ETest.java (87%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/OneOffDisabledJobIntegrateTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/OneOffDisabledJobE2ETest.java (88%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/ScheduleDisabledJobIntegrateTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/ScheduleDisabledJobE2ETest.java (87%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/EnabledJobE2ETest.java (90%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/OneOffEnabledJobIntegrateTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/OneOffEnabledJobE2ETest.java (80%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/ScheduleEnabledJobIntegrateTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/ScheduleEnabledJobE2ETest.java (80%) create mode 100644 test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/executor/E2EFixtureJobExecutor.java create mode 100644 test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJob.java create mode 100644 test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJobImpl.java rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestDistributeOnceElasticJobListener.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/DistributeOnceE2EFixtureJobListener.java (86%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestElasticJobListener.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/E2EFixtureJobListener.java (90%) create mode 100644 test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener create mode 100644 test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor create mode 100644 test/e2e/src/test/resources/logback-test.xml diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index 69fd14c6e0..ec26735634 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -17,5 +17,3 @@ org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestElasticJobListener -org.apache.shardingsphere.elasticjob.kernel.integrate.listener.TestDistributeOnceElasticJobListener -org.apache.shardingsphere.elasticjob.kernel.integrate.listener.TestElasticJobListener diff --git a/test/e2e/pom.xml b/test/e2e/pom.xml new file mode 100644 index 0000000000..28a202ca25 --- /dev/null +++ b/test/e2e/pom.xml @@ -0,0 +1,51 @@ + + + + + 4.0.0 + + org.apache.shardingsphere.elasticjob + elasticjob-test + 3.1.0-SNAPSHOT + + elasticjob-test-e2e + ${project.artifactId} + + + true + + + + + org.apache.shardingsphere.elasticjob + elasticjob-kernel + ${project.parent.version} + + + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + + + + org.awaitility + awaitility + + + diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/BaseE2ETest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/BaseE2ETest.java index 3a8b340c6c..2deb0ea66f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/BaseIntegrateTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/BaseE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate; +package org.apache.shardingsphere.elasticjob.test.e2e; import lombok.AccessLevel; import lombok.Getter; @@ -36,7 +36,7 @@ import org.junit.jupiter.api.BeforeEach; @Getter(AccessLevel.PROTECTED) -public abstract class BaseIntegrateTest { +public abstract class BaseE2ETest { private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); @@ -55,7 +55,7 @@ public abstract class BaseIntegrateTest { private final String jobName = System.nanoTime() + "_test_job"; - protected BaseIntegrateTest(final TestType type, final ElasticJob elasticJob) { + protected BaseE2ETest(final TestType type, final ElasticJob elasticJob) { this.elasticJob = elasticJob; jobConfiguration = getJobConfiguration(jobName); jobBootstrap = createJobBootstrap(type, elasticJob); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/DisabledJobE2ETest.java similarity index 87% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/DisabledJobE2ETest.java index 4a0da3de21..7c37ed9e7a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/DisabledJobIntegrateTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/DisabledJobE2ETest.java @@ -15,30 +15,30 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.disable; +package org.apache.shardingsphere.elasticjob.test.e2e.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.kernel.integrate.BaseIntegrateTest; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.test.e2e.BaseE2ETest; +import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.hamcrest.core.IsNull; import java.util.concurrent.TimeUnit; import static org.hamcrest.CoreMatchers.is; -import static org.junit.jupiter.api.Assertions.assertNull; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNull; -public abstract class DisabledJobIntegrateTest extends BaseIntegrateTest { +public abstract class DisabledJobE2ETest extends BaseE2ETest { - public DisabledJobIntegrateTest(final TestType type) { - super(type, new DetailedFooJob()); + public DisabledJobE2ETest(final TestType type) { + super(type, new E2EFixtureJobImpl()); } protected final void assertDisabledRegCenterInfo() { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/OneOffDisabledJobIntegrateTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/OneOffDisabledJobE2ETest.java similarity index 88% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/OneOffDisabledJobIntegrateTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/OneOffDisabledJobE2ETest.java index 4905aebc6e..634962e1b6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/OneOffDisabledJobIntegrateTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/OneOffDisabledJobE2ETest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.disable; +package org.apache.shardingsphere.elasticjob.test.e2e.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.junit.jupiter.api.Test; -class OneOffDisabledJobIntegrateTest extends DisabledJobIntegrateTest { +class OneOffDisabledJobE2ETest extends DisabledJobE2ETest { - OneOffDisabledJobIntegrateTest() { + OneOffDisabledJobE2ETest() { super(TestType.ONE_OFF); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/ScheduleDisabledJobE2ETest.java similarity index 87% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/ScheduleDisabledJobIntegrateTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/ScheduleDisabledJobE2ETest.java index a2fc80c17c..0b2ded9da3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/disable/ScheduleDisabledJobIntegrateTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/ScheduleDisabledJobE2ETest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.disable; +package org.apache.shardingsphere.elasticjob.test.e2e.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; @@ -30,9 +30,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -class ScheduleDisabledJobIntegrateTest extends DisabledJobIntegrateTest { +class ScheduleDisabledJobE2ETest extends DisabledJobE2ETest { - ScheduleDisabledJobIntegrateTest() { + ScheduleDisabledJobE2ETest() { super(TestType.SCHEDULE); } @@ -46,7 +46,7 @@ protected JobConfiguration getJobConfiguration(final String jobName) { void assertJobRunning() { assertDisabledRegCenterInfo(); setJobEnable(); - Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true))); + Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(((E2EFixtureJobImpl) getElasticJob()).isCompleted(), is(true))); assertEnabledRegCenterInfo(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/EnabledJobE2ETest.java similarity index 90% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/EnabledJobE2ETest.java index 2766f5a560..c4bac7be9f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/EnabledJobIntegrateTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/EnabledJobE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.enable; +package org.apache.shardingsphere.elasticjob.test.e2e.enable; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.integrate.BaseIntegrateTest; +import org.apache.shardingsphere.elasticjob.test.e2e.BaseE2ETest; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.junit.jupiter.api.BeforeEach; @@ -33,9 +33,9 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -public abstract class EnabledJobIntegrateTest extends BaseIntegrateTest { +public abstract class EnabledJobE2ETest extends BaseE2ETest { - protected EnabledJobIntegrateTest(final TestType type, final ElasticJob elasticJob) { + protected EnabledJobE2ETest(final TestType type, final ElasticJob elasticJob) { super(type, elasticJob); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/OneOffEnabledJobIntegrateTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/OneOffEnabledJobE2ETest.java similarity index 80% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/OneOffEnabledJobIntegrateTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/OneOffEnabledJobE2ETest.java index 65b4301de7..35a8634b95 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/OneOffEnabledJobIntegrateTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/OneOffEnabledJobE2ETest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.enable; +package org.apache.shardingsphere.elasticjob.test.e2e.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; @@ -28,10 +28,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -class OneOffEnabledJobIntegrateTest extends EnabledJobIntegrateTest { +class OneOffEnabledJobE2ETest extends EnabledJobE2ETest { - OneOffEnabledJobIntegrateTest() { - super(TestType.ONE_OFF, new DetailedFooJob()); + OneOffEnabledJobE2ETest() { + super(TestType.ONE_OFF, new E2EFixtureJobImpl()); } @Override @@ -42,7 +42,7 @@ protected JobConfiguration getJobConfiguration(final String jobName) { @Test void assertJobInit() { - Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true))); + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((E2EFixtureJobImpl) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/ScheduleEnabledJobE2ETest.java similarity index 80% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/ScheduleEnabledJobIntegrateTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/ScheduleEnabledJobE2ETest.java index c4a6343723..c2630598e7 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/enable/ScheduleEnabledJobIntegrateTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/ScheduleEnabledJobE2ETest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.enable; +package org.apache.shardingsphere.elasticjob.test.e2e.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; @@ -28,10 +28,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -class ScheduleEnabledJobIntegrateTest extends EnabledJobIntegrateTest { +class ScheduleEnabledJobE2ETest extends EnabledJobE2ETest { - ScheduleEnabledJobIntegrateTest() { - super(TestType.SCHEDULE, new DetailedFooJob()); + ScheduleEnabledJobE2ETest() { + super(TestType.SCHEDULE, new E2EFixtureJobImpl()); } @Override @@ -42,7 +42,7 @@ protected JobConfiguration getJobConfiguration(final String jobName) { @Test void assertJobInit() { - Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(((DetailedFooJob) getElasticJob()).isCompleted(), is(true))); + Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(((E2EFixtureJobImpl) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/executor/E2EFixtureJobExecutor.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/executor/E2EFixtureJobExecutor.java new file mode 100644 index 0000000000..56023790a5 --- /dev/null +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/executor/E2EFixtureJobExecutor.java @@ -0,0 +1,37 @@ +/* + * 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.elasticjob.test.e2e.fixture.executor; + +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJob; + +public final class E2EFixtureJobExecutor implements ClassedJobItemExecutor { + + @Override + public void process(final E2EFixtureJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { + elasticJob.foo(shardingContext); + } + + @Override + public Class getElasticJobClass() { + return E2EFixtureJob.class; + } +} diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJob.java new file mode 100644 index 0000000000..56824f0aa7 --- /dev/null +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJob.java @@ -0,0 +1,31 @@ +/* + * 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.elasticjob.test.e2e.fixture.job; + +import org.apache.shardingsphere.elasticjob.api.ElasticJob; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; + +public interface E2EFixtureJob extends ElasticJob { + + /** + * Do job. + * + * @param shardingContext sharding context + */ + void foo(ShardingContext shardingContext); +} diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJobImpl.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJobImpl.java new file mode 100644 index 0000000000..9dc6bb6211 --- /dev/null +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJobImpl.java @@ -0,0 +1,38 @@ +/* + * 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.elasticjob.test.e2e.fixture.job; + +import lombok.Getter; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; + +import java.util.Collection; +import java.util.concurrent.CopyOnWriteArraySet; + +public final class E2EFixtureJobImpl implements E2EFixtureJob { + + private final Collection completedJobItems = new CopyOnWriteArraySet<>(); + + @Getter + private volatile boolean completed; + + @Override + public void foo(final ShardingContext shardingContext) { + completedJobItems.add(shardingContext.getShardingItem()); + completed = completedJobItems.size() == shardingContext.getShardingTotalCount(); + } +} diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestDistributeOnceElasticJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/DistributeOnceE2EFixtureJobListener.java similarity index 86% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestDistributeOnceElasticJobListener.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/DistributeOnceE2EFixtureJobListener.java index b0c654c77e..b1580c55c0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestDistributeOnceElasticJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/DistributeOnceE2EFixtureJobListener.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.listener; +package org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; -public class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { +public class DistributeOnceE2EFixtureJobListener extends AbstractDistributeOnceElasticJobListener { - public TestDistributeOnceElasticJobListener() { + public DistributeOnceE2EFixtureJobListener() { super(100L, 100L); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestElasticJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/E2EFixtureJobListener.java similarity index 90% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestElasticJobListener.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/E2EFixtureJobListener.java index 81fe295709..6f92f7fa20 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/integrate/listener/TestElasticJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/E2EFixtureJobListener.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.integrate.listener; +package org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -public class TestElasticJobListener implements ElasticJobListener { +public class E2EFixtureJobListener implements ElasticJobListener { @Override public void beforeJobExecuted(final ShardingContexts shardingContexts) { diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener new file mode 100644 index 0000000000..9c94b1d7d5 --- /dev/null +++ b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -0,0 +1,19 @@ +# +# 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. +# + +org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener.DistributeOnceE2EFixtureJobListener +org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener.E2EFixtureJobListener diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor new file mode 100644 index 0000000000..f3a27ae285 --- /dev/null +++ b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor @@ -0,0 +1,18 @@ +# +# 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. +# + +org.apache.shardingsphere.elasticjob.test.e2e.fixture.executor.E2EFixtureJobExecutor diff --git a/test/e2e/src/test/resources/logback-test.xml b/test/e2e/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..ae5d682429 --- /dev/null +++ b/test/e2e/src/test/resources/logback-test.xml @@ -0,0 +1,48 @@ + + + + + + + + + ${log.context.name} + + + + + + ERROR + + + ${log.pattern} + + + + + + + + + + + + + + + diff --git a/test/pom.xml b/test/pom.xml index d2a8a291e1..5c11d880af 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -28,6 +28,7 @@ ${project.artifactId} + e2e util From 621cf953cf0382a652145eaf6d72df767f8766c4 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 30 Oct 2023 11:46:20 +0800 Subject: [PATCH 125/178] Move annotation e2e test cases to e2e module (#2339) * Move annotation e2e test cases to e2e module * Refactor JobAnnotationBuilderTest * Move SnapshotService e2e test to e2e module --- .../annotation/JobAnnotationBuilderTest.java | 5 +-- .../fixture/AnnotationJobFixture.java | 45 +++++++++++++++++++ .../e2e/annotation/BaseAnnotationE2ETest.java | 6 +-- .../annotation/OneOffEnabledJobE2ETest.java | 13 +++--- .../annotation/ScheduleEnabledJobE2ETest.java | 13 +++--- .../fixture}/AnnotationSimpleJob.java | 6 +-- .../fixture}/AnnotationUnShardingJob.java | 9 ++-- .../test/e2e/{ => raw}/BaseE2ETest.java | 2 +- .../{ => raw}/disable/DisabledJobE2ETest.java | 6 +-- .../disable/OneOffDisabledJobE2ETest.java | 2 +- .../disable/ScheduleDisabledJobE2ETest.java | 4 +- .../{ => raw}/enable/EnabledJobE2ETest.java | 4 +- .../enable/OneOffEnabledJobE2ETest.java | 4 +- .../enable/ScheduleEnabledJobE2ETest.java | 4 +- .../executor/E2EFixtureJobExecutor.java | 4 +- .../{ => raw}/fixture/job/E2EFixtureJob.java | 2 +- .../fixture/job/E2EFixtureJobImpl.java | 2 +- .../DistributeOnceE2EFixtureJobListener.java | 2 +- .../listener/E2EFixtureJobListener.java | 2 +- .../snapshot/BaseSnapshotServiceE2ETest.java | 7 +-- .../SnapshotServiceDisableE2ETest.java | 11 ++--- .../SnapshotServiceEnableE2ETest.java | 11 ++--- .../test/e2e}/snapshot/SocketUtils.java | 2 +- ...asticjob.infra.listener.ElasticJobListener | 4 +- ...elasticjob.spi.type.ClassedJobItemExecutor | 2 +- 25 files changed, 109 insertions(+), 63 deletions(-) create mode 100644 kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java (88%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java (89%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture}/AnnotationSimpleJob.java (95%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture}/AnnotationUnShardingJob.java (86%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/BaseE2ETest.java (98%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/disable/DisabledJobE2ETest.java (93%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/disable/OneOffDisabledJobE2ETest.java (95%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/disable/ScheduleDisabledJobE2ETest.java (94%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/enable/EnabledJobE2ETest.java (96%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/enable/OneOffEnabledJobE2ETest.java (92%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/enable/ScheduleEnabledJobE2ETest.java (92%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/fixture/executor/E2EFixtureJobExecutor.java (90%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/fixture/job/E2EFixtureJob.java (94%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/fixture/job/E2EFixtureJobImpl.java (95%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/fixture/listener/DistributeOnceE2EFixtureJobListener.java (95%) rename test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/{ => raw}/fixture/listener/E2EFixtureJobListener.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java (91%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java (82%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceEnableTest.java => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceEnableE2ETest.java (82%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal => test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e}/snapshot/SocketUtils.java (96%) diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java index 201e7ad76b..486e829fca 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.annotation; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.fixture.AnnotationJobFixture; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -31,7 +31,7 @@ class JobAnnotationBuilderTest { @Test void assertGenerateJobConfiguration() { - JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(AnnotationSimpleJob.class); + JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(AnnotationJobFixture.class); assertThat(jobConfig.getJobName(), is("AnnotationSimpleJob")); assertThat(jobConfig.getShardingTotalCount(), is(3)); assertThat(jobConfig.getShardingItemParameters(), is("0=a,1=b,2=c")); @@ -50,5 +50,4 @@ void assertGenerateJobConfiguration() { assertFalse(jobConfig.isDisabled()); assertFalse(jobConfig.isOverwrite()); } - } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java new file mode 100644 index 0000000000..343320bf16 --- /dev/null +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java @@ -0,0 +1,45 @@ +/* + * 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.elasticjob.kernel.internal.annotation.fixture; + +import lombok.Getter; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; +import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; +import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; + +@ElasticJobConfiguration( + jobName = "AnnotationSimpleJob", + description = "desc", + shardingTotalCount = 3, + shardingItemParameters = "0=a,1=b,2=c", + cron = "*/10 * * * * ?", + props = { + @ElasticJobProp(key = "print.title", value = "test title"), + @ElasticJobProp(key = "print.content", value = "test content") + }) +@Getter +public class AnnotationJobFixture implements SimpleJob { + + private volatile boolean completed; + + @Override + public void execute(final ShardingContext shardingContext) { + completed = true; + } +} diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java index 483bf963c6..2ac0008128 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/BaseAnnotationTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.test.e2e.annotation; import lombok.AccessLevel; import lombok.Getter; @@ -37,7 +37,7 @@ import org.junit.jupiter.api.BeforeEach; @Getter(AccessLevel.PROTECTED) -public abstract class BaseAnnotationTest { +public abstract class BaseAnnotationE2ETest { private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); @@ -56,7 +56,7 @@ public abstract class BaseAnnotationTest { private final String jobName; - protected BaseAnnotationTest(final TestType type, final ElasticJob elasticJob) { + protected BaseAnnotationE2ETest(final TestType type, final ElasticJob elasticJob) { this.elasticJob = elasticJob; jobConfiguration = JobAnnotationBuilder.generateJobConfiguration(elasticJob.getClass()); jobName = jobConfiguration.getJobName(); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java similarity index 88% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java index 0c84f620ac..63328bd417 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/OneOffEnabledJobTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java @@ -15,16 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.test.e2e.annotation; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationUnShardingJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.test.e2e.annotation.fixture.AnnotationUnShardingJob; import org.awaitility.Awaitility; +import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -35,9 +36,9 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -class OneOffEnabledJobTest extends BaseAnnotationTest { +class OneOffEnabledJobE2ETest extends BaseAnnotationE2ETest { - OneOffEnabledJobTest() { + OneOffEnabledJobE2ETest() { super(TestType.ONE_OFF, new AnnotationUnShardingJob()); } @@ -57,7 +58,7 @@ void assertEnabledRegCenterInfo() { @Test void assertJobInit() { - Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((AnnotationUnShardingJob) getElasticJob()).isCompleted(), is(true))); + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> MatcherAssert.assertThat(((AnnotationUnShardingJob) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java similarity index 89% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java index 111c9a5ab0..cd1f8bce56 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/integrate/ScheduleEnabledJobTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java @@ -15,16 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.annotation.integrate; +package org.apache.shardingsphere.elasticjob.test.e2e.annotation; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.AnnotationSimpleJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; +import org.apache.shardingsphere.elasticjob.test.e2e.annotation.fixture.AnnotationSimpleJob; import org.awaitility.Awaitility; +import org.hamcrest.MatcherAssert; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -35,9 +36,9 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -class ScheduleEnabledJobTest extends BaseAnnotationTest { +class ScheduleEnabledJobE2ETest extends BaseAnnotationE2ETest { - ScheduleEnabledJobTest() { + ScheduleEnabledJobE2ETest() { super(TestType.SCHEDULE, new AnnotationSimpleJob()); } @@ -59,7 +60,7 @@ void assertEnabledRegCenterInfo() { @Test void assertJobInit() { - Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((AnnotationSimpleJob) getElasticJob()).isCompleted(), is(true))); + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> MatcherAssert.assertThat(((AnnotationSimpleJob) getElasticJob()).isCompleted(), is(true))); assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java index a6c4a39b01..c6bade33b0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationSimpleJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java @@ -15,15 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.fixture.job; +package org.apache.shardingsphere.elasticjob.test.e2e.annotation.fixture; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -@Getter @ElasticJobConfiguration( jobName = "AnnotationSimpleJob", description = "desc", @@ -34,6 +33,7 @@ @ElasticJobProp(key = "print.title", value = "test title"), @ElasticJobProp(key = "print.content", value = "test content") }) +@Getter public class AnnotationSimpleJob implements SimpleJob { private volatile boolean completed; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java similarity index 86% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java index eda26d1eea..aa9d890d71 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/AnnotationUnShardingJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java @@ -15,18 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.fixture.job; +package org.apache.shardingsphere.elasticjob.test.e2e.annotation.fixture; import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; +import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +@ElasticJobConfiguration(jobName = "AnnotationUnShardingJob", description = "desc", shardingTotalCount = 1) @Getter -@ElasticJobConfiguration( - jobName = "AnnotationUnShardingJob", - description = "desc", - shardingTotalCount = 1) public final class AnnotationUnShardingJob implements SimpleJob { private volatile boolean completed; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/BaseE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java similarity index 98% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/BaseE2ETest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java index 2deb0ea66f..c3ff41536f 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/BaseE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e; +package org.apache.shardingsphere.elasticjob.test.e2e.raw; import lombok.AccessLevel; import lombok.Getter; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/DisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java similarity index 93% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/DisabledJobE2ETest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java index 7c37ed9e7a..9c845190cf 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/DisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.disable; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; @@ -24,8 +24,8 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.test.e2e.BaseE2ETest; -import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.BaseE2ETest; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.hamcrest.core.IsNull; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/OneOffDisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/OneOffDisabledJobE2ETest.java similarity index 95% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/OneOffDisabledJobE2ETest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/OneOffDisabledJobE2ETest.java index 634962e1b6..8df2bcf135 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/OneOffDisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/OneOffDisabledJobE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.disable; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.junit.jupiter.api.Test; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/ScheduleDisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/ScheduleDisabledJobE2ETest.java similarity index 94% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/ScheduleDisabledJobE2ETest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/ScheduleDisabledJobE2ETest.java index 0b2ded9da3..f397a43e4a 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/disable/ScheduleDisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/ScheduleDisabledJobE2ETest.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.disable; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; -import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/EnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java similarity index 96% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/EnabledJobE2ETest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java index c4bac7be9f..9bab16b489 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/EnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.enable; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.enable; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; -import org.apache.shardingsphere.elasticjob.test.e2e.BaseE2ETest; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.BaseE2ETest; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.junit.jupiter.api.BeforeEach; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/OneOffEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/OneOffEnabledJobE2ETest.java similarity index 92% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/OneOffEnabledJobE2ETest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/OneOffEnabledJobE2ETest.java index 35a8634b95..6c117b347b 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/OneOffEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/OneOffEnabledJobE2ETest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.enable; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/ScheduleEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/ScheduleEnabledJobE2ETest.java similarity index 92% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/ScheduleEnabledJobE2ETest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/ScheduleEnabledJobE2ETest.java index c2630598e7..d211e4fc02 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/enable/ScheduleEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/ScheduleEnabledJobE2ETest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.enable; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.enable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJobImpl; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJobImpl; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/executor/E2EFixtureJobExecutor.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java similarity index 90% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/executor/E2EFixtureJobExecutor.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java index 56023790a5..5b6319a4e6 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/executor/E2EFixtureJobExecutor.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.fixture.executor; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.test.e2e.fixture.job.E2EFixtureJob; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJob; public final class E2EFixtureJobExecutor implements ClassedJobItemExecutor { diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java similarity index 94% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJob.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java index 56824f0aa7..7be1ba4e40 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.fixture.job; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJobImpl.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java similarity index 95% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJobImpl.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java index 9dc6bb6211..d86b84b304 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/job/E2EFixtureJobImpl.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.fixture.job; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job; import lombok.Getter; import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/DistributeOnceE2EFixtureJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java similarity index 95% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/DistributeOnceE2EFixtureJobListener.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java index b1580c55c0..24fa928f9e 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/DistributeOnceE2EFixtureJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/E2EFixtureJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java similarity index 94% rename from test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/E2EFixtureJobListener.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java index 6f92f7fa20..efa4bfa82a 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/fixture/listener/E2EFixtureJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener; +package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener; import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java similarity index 91% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java index 023a62c148..d3a852df2f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/BaseSnapshotServiceTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; +package org.apache.shardingsphere.elasticjob.test.e2e.snapshot; import lombok.AccessLevel; import lombok.Getter; @@ -23,6 +23,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; @@ -32,7 +33,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -public abstract class BaseSnapshotServiceTest { +public abstract class BaseSnapshotServiceE2ETest { static final int DUMP_PORT = 9000; @@ -51,7 +52,7 @@ public abstract class BaseSnapshotServiceTest { @Getter(value = AccessLevel.PROTECTED) private final String jobName = System.nanoTime() + "_test_job"; - public BaseSnapshotServiceTest(final ElasticJob elasticJob) { + public BaseSnapshotServiceE2ETest(final ElasticJob elasticJob) { bootstrap = new ScheduleJobBootstrap(REG_CENTER, elasticJob, JobConfiguration.newBuilder(jobName, 3).cron("0/1 * * * * ?").overwrite(true).build()); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java similarity index 82% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java index 1024fa4bd4..a060052542 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceDisableTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; +package org.apache.shardingsphere.elasticjob.test.e2e.snapshot; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJobImpl; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; @@ -27,10 +28,10 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows; -class SnapshotServiceDisableTest extends BaseSnapshotServiceTest { +class SnapshotServiceDisableE2ETest extends BaseSnapshotServiceE2ETest { - SnapshotServiceDisableTest() { - super(new DetailedFooJob()); + SnapshotServiceDisableE2ETest() { + super(new E2EFixtureJobImpl()); } @Test diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceEnableTest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceEnableE2ETest.java similarity index 82% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceEnableTest.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceEnableE2ETest.java index 3c40dcaa52..fb335aaf66 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotServiceEnableTest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceEnableE2ETest.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; +package org.apache.shardingsphere.elasticjob.test.e2e.snapshot; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; +import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; +import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJobImpl; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -27,10 +28,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -class SnapshotServiceEnableTest extends BaseSnapshotServiceTest { +class SnapshotServiceEnableE2ETest extends BaseSnapshotServiceE2ETest { - SnapshotServiceEnableTest() { - super(new DetailedFooJob()); + SnapshotServiceEnableE2ETest() { + super(new E2EFixtureJobImpl()); } @BeforeEach diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SocketUtils.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SocketUtils.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SocketUtils.java rename to test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SocketUtils.java index 130c10288a..6a79307ce4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SocketUtils.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SocketUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.snapshot; +package org.apache.shardingsphere.elasticjob.test.e2e.snapshot; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener index 9c94b1d7d5..c68f7881f7 100644 --- a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener +++ b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener.DistributeOnceE2EFixtureJobListener -org.apache.shardingsphere.elasticjob.test.e2e.fixture.listener.E2EFixtureJobListener +org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener.DistributeOnceE2EFixtureJobListener +org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener.E2EFixtureJobListener diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor index f3a27ae285..1956aaedcb 100644 --- a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor +++ b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.test.e2e.fixture.executor.E2EFixtureJobExecutor +org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.executor.E2EFixtureJobExecutor From 910033bd26921558af16fd023e3e63cb81daa8ff Mon Sep 17 00:00:00 2001 From: zhangliang Date: Mon, 30 Oct 2023 16:30:26 +0800 Subject: [PATCH 126/178] Add eslaticjob bootstrap module --- bootstrap/pom.xml | 48 +++++++++++++++++++ .../elasticjob}/bootstrap/JobBootstrap.java | 2 +- .../bootstrap/impl/OneOffJobBootstrap.java | 4 +- .../bootstrap/impl/ScheduleJobBootstrap.java | 4 +- .../impl/OneOffJobBootstrapTest.java | 2 +- bootstrap/src/test/resources/logback-test.xml | 48 +++++++++++++++++++ distribution/bin/pom.xml | 2 +- docs/content/quick-start/_index.cn.md | 2 +- docs/content/quick-start/_index.en.md | 2 +- .../api/src/test/resources/logback-test.xml | 2 +- .../rdb/src/test/resources/logback-test.xml | 2 +- examples/elasticjob-example-java/pom.xml | 2 +- .../elasticjob/example/JavaMain.java | 4 +- examples/elasticjob-example-jobs/pom.xml | 2 +- .../controller/OneOffJobController.java | 2 +- examples/pom.xml | 2 +- infra/src/test/resources/logback-test.xml | 2 +- kernel/src/test/resources/logback-test.xml | 2 +- lifecycle/pom.xml | 2 +- pom.xml | 1 + .../src/test/resources/logback-test.xml | 2 +- .../job/ElasticJobBootstrapConfiguration.java | 4 +- .../ScheduleJobBootstrapStartupRunner.java | 2 +- .../job/ElasticJobSpringBootScannerTest.java | 2 +- .../boot/job/ElasticJobSpringBootTest.java | 6 +-- spring/core/pom.xml | 2 +- .../core/scanner/ClassPathJobScanner.java | 2 +- .../job/parser/JobBeanDefinitionParser.java | 4 +- .../AbstractOneOffJobSpringIntegrateTest.java | 2 +- .../OneOffJobSpringNamespaceWithRefTest.java | 2 +- .../OneOffJobSpringNamespaceWithTypeTest.java | 2 +- test/e2e/pom.xml | 2 +- .../e2e/annotation/BaseAnnotationE2ETest.java | 6 +-- .../elasticjob/test/e2e/raw/BaseE2ETest.java | 6 +-- .../e2e/raw/disable/DisabledJobE2ETest.java | 2 +- .../e2e/raw/enable/EnabledJobE2ETest.java | 2 +- .../snapshot/BaseSnapshotServiceE2ETest.java | 2 +- test/e2e/src/test/resources/logback-test.xml | 2 +- 38 files changed, 143 insertions(+), 46 deletions(-) create mode 100644 bootstrap/pom.xml rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api => bootstrap/src/main/java/org/apache/shardingsphere/elasticjob}/bootstrap/JobBootstrap.java (93%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api => bootstrap/src/main/java/org/apache/shardingsphere/elasticjob}/bootstrap/impl/OneOffJobBootstrap.java (95%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api => bootstrap/src/main/java/org/apache/shardingsphere/elasticjob}/bootstrap/impl/ScheduleJobBootstrap.java (94%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api => bootstrap/src/test/java/org/apache/shardingsphere/elasticjob}/bootstrap/impl/OneOffJobBootstrapTest.java (98%) create mode 100644 bootstrap/src/test/resources/logback-test.xml diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml new file mode 100644 index 0000000000..10f375e3b7 --- /dev/null +++ b/bootstrap/pom.xml @@ -0,0 +1,48 @@ + + + + + 4.0.0 + + org.apache.shardingsphere.elasticjob + elasticjob + 3.1.0-SNAPSHOT + + elasticjob-bootstrap + ${project.artifactId} + + + + org.apache.shardingsphere.elasticjob + elasticjob-kernel + ${project.parent.version} + + + + org.apache.shardingsphere.elasticjob + elasticjob-test-util + ${project.parent.version} + test + + + + org.awaitility + awaitility + + + diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/JobBootstrap.java b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/JobBootstrap.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/JobBootstrap.java rename to bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/JobBootstrap.java index b898b877d7..e2ebe3eeee 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/JobBootstrap.java +++ b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/JobBootstrap.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap; +package org.apache.shardingsphere.elasticjob.bootstrap; /** * Job bootstrap. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrap.java b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrap.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrap.java rename to bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrap.java index 1119e57577..d92da5d8cb 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrap.java +++ b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrap.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.bootstrap.impl; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/ScheduleJobBootstrap.java b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/ScheduleJobBootstrap.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/ScheduleJobBootstrap.java rename to bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/ScheduleJobBootstrap.java index 2632fa4926..5478bedf0b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/ScheduleJobBootstrap.java +++ b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/ScheduleJobBootstrap.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.bootstrap.impl; import com.google.common.base.Preconditions; import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrapTest.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java rename to bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrapTest.java index 0d8fa2df2a..69255c2b34 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrapTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.bootstrap.impl; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; diff --git a/bootstrap/src/test/resources/logback-test.xml b/bootstrap/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..0cf45471ae --- /dev/null +++ b/bootstrap/src/test/resources/logback-test.xml @@ -0,0 +1,48 @@ + + + + + + + + + ${log.context.name} + + + + + + ERROR + + + ${log.pattern} + + + + + + + + + + + + + + + diff --git a/distribution/bin/pom.xml b/distribution/bin/pom.xml index ff1e411467..ae3d9f7573 100644 --- a/distribution/bin/pom.xml +++ b/distribution/bin/pom.xml @@ -30,7 +30,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap ${project.version} diff --git a/docs/content/quick-start/_index.cn.md b/docs/content/quick-start/_index.cn.md index 6fde4e1571..a16f6a3e11 100644 --- a/docs/content/quick-start/_index.cn.md +++ b/docs/content/quick-start/_index.cn.md @@ -10,7 +10,7 @@ chapter = true ```xml org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap ${latest.release.version} ``` diff --git a/docs/content/quick-start/_index.en.md b/docs/content/quick-start/_index.en.md index 356124da83..24aa07bab8 100644 --- a/docs/content/quick-start/_index.en.md +++ b/docs/content/quick-start/_index.en.md @@ -10,7 +10,7 @@ chapter = true ```xml org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap ${latest.release.version} ``` diff --git a/ecosystem/tracing/api/src/test/resources/logback-test.xml b/ecosystem/tracing/api/src/test/resources/logback-test.xml index 3e655a24db..dbd01b8d51 100644 --- a/ecosystem/tracing/api/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/api/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml index 01eb3fb3ac..74a43319c7 100644 --- a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/examples/elasticjob-example-java/pom.xml b/examples/elasticjob-example-java/pom.xml index 8a5186c8a3..3db6224cbd 100644 --- a/examples/elasticjob-example-java/pom.xml +++ b/examples/elasticjob-example-java/pom.xml @@ -57,7 +57,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap diff --git a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index c7f6d49354..975ecadd04 100644 --- a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java +++ b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -25,8 +25,8 @@ import org.apache.shardingsphere.elasticjob.error.handler.wechat.WechatPropertiesConstants; import org.apache.shardingsphere.elasticjob.example.job.dataflow.JavaDataflowJob; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.example.job.simple.JavaOccurErrorJob; import org.apache.shardingsphere.elasticjob.example.job.simple.JavaSimpleJob; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/examples/elasticjob-example-jobs/pom.xml b/examples/elasticjob-example-jobs/pom.xml index 5d1cedb9c9..3578a0274f 100644 --- a/examples/elasticjob-example-jobs/pom.xml +++ b/examples/elasticjob-example-jobs/pom.xml @@ -31,7 +31,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java index 23a4ac01ce..c3eea81415 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.controller; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.GetMapping; diff --git a/examples/pom.xml b/examples/pom.xml index 329a324c37..b78cec61f1 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -53,7 +53,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap ${revision} diff --git a/infra/src/test/resources/logback-test.xml b/infra/src/test/resources/logback-test.xml index 57283bfcaa..060ba6530c 100644 --- a/infra/src/test/resources/logback-test.xml +++ b/infra/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index ae5d682429..0cf45471ae 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/lifecycle/pom.xml b/lifecycle/pom.xml index 6432c4edf0..34ec6bab3b 100644 --- a/lifecycle/pom.xml +++ b/lifecycle/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap ${project.parent.version} diff --git a/pom.xml b/pom.xml index 16392a4cd1..3325080949 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,7 @@ api registry-center + bootstrap infra kernel lifecycle diff --git a/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml b/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml index 85f1d61dd0..f50446f979 100644 --- a/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml +++ b/registry-center/provider/zookeeper-curator/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index d2207be510..fb848b9d42 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -23,8 +23,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java index 9896f3e389..d9fb52b383 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java @@ -19,7 +19,7 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.springframework.boot.CommandLineRunner; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java index c95e430916..d08d22102f 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.AnnotationCustomJob; import org.apache.shardingsphere.elasticjob.spring.core.scanner.ElasticJobScan; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 1937eacd02..867b6feef1 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -19,9 +19,9 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob; diff --git a/spring/core/pom.xml b/spring/core/pom.xml index c5dfa1a581..1d59320696 100644 --- a/spring/core/pom.xml +++ b/spring/core/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap ${project.parent.version} diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java index a811f4b843..9d7912a078 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java @@ -19,7 +19,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.RuntimeBeanReference; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java index 1a4172efa2..ae09da59d4 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java @@ -19,8 +19,8 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.namespace.job.tag.JobBeanDefinitionTag; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index 3682c0b2a2..28d536c13c 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index 9d6003fd3a..ce8b09e0a9 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index 6bffa1ae08..3a795ca0f1 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; diff --git a/test/e2e/pom.xml b/test/e2e/pom.xml index 28a202ca25..5104bd26b0 100644 --- a/test/e2e/pom.xml +++ b/test/e2e/pom.xml @@ -33,7 +33,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-kernel + elasticjob-bootstrap ${project.parent.version} diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java index 2ac0008128..6656ce7b86 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java @@ -21,9 +21,9 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java index c3ff41536f..ae3993e91c 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java @@ -21,9 +21,9 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java index 9c845190cf..32feed6ac0 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java index 9bab16b489..6544c390f6 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.test.e2e.raw.BaseE2ETest; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java index d3a852df2f..341ff8c87d 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java @@ -21,7 +21,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.api.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/test/e2e/src/test/resources/logback-test.xml b/test/e2e/src/test/resources/logback-test.xml index ae5d682429..0cf45471ae 100644 --- a/test/e2e/src/test/resources/logback-test.xml +++ b/test/e2e/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + From 2edfdb60706fe1b755b8bde89fe548bb35618966 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Mon, 30 Oct 2023 16:47:49 +0800 Subject: [PATCH 127/178] Move ecosystem dependencies into bootstrap module --- bootstrap/pom.xml | 25 +++++++++++++++++++ kernel/pom.xml | 23 +---------------- .../annotation/JobAnnotationBuilderTest.java | 2 +- .../fixture/AnnotationJobFixture.java | 16 +++--------- 4 files changed, 30 insertions(+), 36 deletions(-) diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml index 10f375e3b7..9a6c1ef4e0 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -32,6 +32,31 @@ elasticjob-kernel ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-simple-executor + ${project.parent.version} + + + org.apache.shardingsphere.elasticjob + elasticjob-dataflow-executor + ${project.parent.version} + + + org.apache.shardingsphere.elasticjob + elasticjob-script-executor + ${project.parent.version} + + + org.apache.shardingsphere.elasticjob + elasticjob-http-executor + ${project.parent.version} + + + org.apache.shardingsphere.elasticjob + elasticjob-tracing-rdb + ${project.parent.version} + org.apache.shardingsphere.elasticjob diff --git a/kernel/pom.xml b/kernel/pom.xml index 6a0c2c1b6f..b126a12b1c 100644 --- a/kernel/pom.xml +++ b/kernel/pom.xml @@ -42,7 +42,6 @@ elasticjob-error-handler-spi ${project.parent.version} - org.apache.shardingsphere.elasticjob elasticjob-registry-center-zookeeper-curator @@ -50,27 +49,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-simple-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-dataflow-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-script-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-http-executor - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-tracing-rdb + elasticjob-tracing-api ${project.parent.version} diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java index 486e829fca..a388af9379 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilderTest.java @@ -32,7 +32,7 @@ class JobAnnotationBuilderTest { @Test void assertGenerateJobConfiguration() { JobConfiguration jobConfig = JobAnnotationBuilder.generateJobConfiguration(AnnotationJobFixture.class); - assertThat(jobConfig.getJobName(), is("AnnotationSimpleJob")); + assertThat(jobConfig.getJobName(), is("AnnotationJobFixture")); assertThat(jobConfig.getShardingTotalCount(), is(3)); assertThat(jobConfig.getShardingItemParameters(), is("0=a,1=b,2=c")); assertThat(jobConfig.getCron(), is("*/10 * * * * ?")); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java index 343320bf16..bc43eaa63f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/fixture/AnnotationJobFixture.java @@ -17,14 +17,12 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.annotation.fixture; -import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.api.ElasticJob; @ElasticJobConfiguration( - jobName = "AnnotationSimpleJob", + jobName = "AnnotationJobFixture", description = "desc", shardingTotalCount = 3, shardingItemParameters = "0=a,1=b,2=c", @@ -33,13 +31,5 @@ @ElasticJobProp(key = "print.title", value = "test title"), @ElasticJobProp(key = "print.content", value = "test content") }) -@Getter -public class AnnotationJobFixture implements SimpleJob { - - private volatile boolean completed; - - @Override - public void execute(final ShardingContext shardingContext) { - completed = true; - } +public class AnnotationJobFixture implements ElasticJob { } From b63f30819949b278e775e3c49f602d5ac83850e6 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Mon, 30 Oct 2023 16:57:11 +0800 Subject: [PATCH 128/178] Move ecosystem dependencies into bootstrap module --- ecosystem/executor/dataflow/pom.xml | 2 +- ecosystem/executor/http/pom.xml | 2 +- ecosystem/executor/script/pom.xml | 2 +- ecosystem/executor/simple/pom.xml | 2 +- restful/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ecosystem/executor/dataflow/pom.xml b/ecosystem/executor/dataflow/pom.xml index 582eab26e1..bdb1864ecd 100644 --- a/ecosystem/executor/dataflow/pom.xml +++ b/ecosystem/executor/dataflow/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra + elasticjob-kernel ${project.parent.version} diff --git a/ecosystem/executor/http/pom.xml b/ecosystem/executor/http/pom.xml index 7a27436cec..d3d7015c2d 100644 --- a/ecosystem/executor/http/pom.xml +++ b/ecosystem/executor/http/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra + elasticjob-kernel ${project.parent.version} diff --git a/ecosystem/executor/script/pom.xml b/ecosystem/executor/script/pom.xml index 977417bfb5..10ebb3dafa 100644 --- a/ecosystem/executor/script/pom.xml +++ b/ecosystem/executor/script/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra + elasticjob-kernel ${project.parent.version} diff --git a/ecosystem/executor/simple/pom.xml b/ecosystem/executor/simple/pom.xml index 372e7aa8f0..bc4650f804 100644 --- a/ecosystem/executor/simple/pom.xml +++ b/ecosystem/executor/simple/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra + elasticjob-kernel ${project.parent.version} diff --git a/restful/pom.xml b/restful/pom.xml index 8d7e85f378..9b3c8339a0 100644 --- a/restful/pom.xml +++ b/restful/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-infra + elasticjob-kernel ${project.parent.version} From e7f1a7fe133bb31c5de4935bc93e42143858c4c0 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Mon, 30 Oct 2023 17:08:12 +0800 Subject: [PATCH 129/178] Move job-error-handler-spi to kernel module --- ecosystem/error-handler/pom.xml | 1 - ecosystem/error-handler/spi/pom.xml | 35 ------------------- ecosystem/error-handler/type/dingtalk/pom.xml | 2 +- ...e.elasticjob.error.handler.JobErrorHandler | 18 ---------- ecosystem/error-handler/type/email/pom.xml | 2 +- ecosystem/error-handler/type/wechat/pom.xml | 2 +- ...e.elasticjob.error.handler.JobErrorHandler | 18 ---------- .../internal/executor/ElasticJobExecutor.java | 2 +- .../error/handler/JobErrorHandler.java | 2 +- .../JobErrorHandlerPropertiesValidator.java | 2 +- .../handler/JobErrorHandlerReloader.java | 1 - .../general/IgnoreJobErrorHandler.java | 2 +- .../handler/general/LogJobErrorHandler.java | 2 +- .../handler/general/ThrowJobErrorHandler.java | 2 +- .../internal/schedule/JobScheduler.java | 2 +- ...al.executor.error.handler.JobErrorHandler} | 0 .../handler/JobErrorHandlerReloaderTest.java | 1 - .../general/IgnoreJobErrorHandlerTest.java | 2 +- .../general/LogJobErrorHandlerTest.java | 2 +- .../general/ThrowJobErrorHandlerTest.java | 2 +- 20 files changed, 13 insertions(+), 87 deletions(-) delete mode 100644 ecosystem/error-handler/spi/pom.xml delete mode 100644 ecosystem/error-handler/type/dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler delete mode 100644 ecosystem/error-handler/type/wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename {ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/JobErrorHandler.java (93%) rename {ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor}/error/handler/JobErrorHandlerPropertiesValidator.java (93%) rename kernel/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler} (100%) diff --git a/ecosystem/error-handler/pom.xml b/ecosystem/error-handler/pom.xml index a4d7425eb9..68eacea4e6 100644 --- a/ecosystem/error-handler/pom.xml +++ b/ecosystem/error-handler/pom.xml @@ -27,7 +27,6 @@ pom - spi type diff --git a/ecosystem/error-handler/spi/pom.xml b/ecosystem/error-handler/spi/pom.xml deleted file mode 100644 index 62c701735b..0000000000 --- a/ecosystem/error-handler/spi/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler - 3.1.0-SNAPSHOT - - elasticjob-error-handler-spi - - - - org.apache.shardingsphere.elasticjob - elasticjob-infra - ${project.parent.version} - - - diff --git a/ecosystem/error-handler/type/dingtalk/pom.xml b/ecosystem/error-handler/type/dingtalk/pom.xml index 814ddcdfbe..6c4e413f6e 100644 --- a/ecosystem/error-handler/type/dingtalk/pom.xml +++ b/ecosystem/error-handler/type/dingtalk/pom.xml @@ -28,7 +28,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-error-handler-spi + elasticjob-kernel ${project.parent.version} diff --git a/ecosystem/error-handler/type/dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler deleted file mode 100644 index cd9894e199..0000000000 --- a/ecosystem/error-handler/type/dingtalk/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.error.handler.dingtalk.DingtalkJobErrorHandler diff --git a/ecosystem/error-handler/type/email/pom.xml b/ecosystem/error-handler/type/email/pom.xml index 78853f3cae..868098c5cd 100644 --- a/ecosystem/error-handler/type/email/pom.xml +++ b/ecosystem/error-handler/type/email/pom.xml @@ -28,7 +28,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-error-handler-spi + elasticjob-kernel ${project.parent.version} diff --git a/ecosystem/error-handler/type/wechat/pom.xml b/ecosystem/error-handler/type/wechat/pom.xml index 6e4d6848cf..83fb1ac821 100644 --- a/ecosystem/error-handler/type/wechat/pom.xml +++ b/ecosystem/error-handler/type/wechat/pom.xml @@ -28,7 +28,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-error-handler-spi + elasticjob-kernel ${project.parent.version} diff --git a/ecosystem/error-handler/type/wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler deleted file mode 100644 index b0a5d66407..0000000000 --- a/ecosystem/error-handler/type/wechat/src/test/resources/META-INF.services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler +++ /dev/null @@ -1,18 +0,0 @@ -# -# 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. -# - -org.apache.shardingsphere.elasticjob.error.handler.wechat.WechatJobErrorHandler diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java index 9518529861..6cc6b781a1 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java @@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerReloader; import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.item.JobItemExecutorFactory; diff --git a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandler.java similarity index 93% rename from ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandler.java index 868621306a..ef6cfe6e79 100644 --- a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerPropertiesValidator.java similarity index 93% rename from ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerPropertiesValidator.java index d668554e07..e1ac31b0df 100644 --- a/ecosystem/error-handler/spi/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/JobErrorHandlerPropertiesValidator.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerPropertiesValidator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java index 39881ca5ae..9f1954335d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java @@ -19,7 +19,6 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.io.Closeable; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java index 84a9990bb4..f36632b7d3 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; /** * Job error handler for ignore exception. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java index 0ab9bc3643..5f07bb8eb7 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; /** * Job error handler for log error message. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java index 9e24463ee6..22afad06e1 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 5030f0ae85..245a64bb26 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -22,7 +22,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ElasticJobExecutor; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.JobFacade; diff --git a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 100% rename from kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java index cbf0899268..c9a4c9a397 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java @@ -18,7 +18,6 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.IgnoreJobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.LogJobErrorHandler; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java index 9bb99f4a50..18b8dd6e93 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java index e658c41dab..ebe37f6caa 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java @@ -20,7 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java index 9c401430f5..4864a8a8c9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; From 1cfc7c278ce18d458f57d4fd09533ec33e002b56 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Mon, 30 Oct 2023 19:05:23 +0800 Subject: [PATCH 130/178] Merge kernel and infra module --- .../dingtalk/DingtalkJobErrorHandler.java | 6 +- ...alkJobErrorHandlerPropertiesValidator.java | 6 +- .../dingtalk/DingtalkPropertiesConstants.java | 2 +- ...al.executor.error.handler.JobErrorHandler} | 0 ...andler.JobErrorHandlerPropertiesValidator} | 0 ...obErrorHandlerPropertiesValidatorTest.java | 2 +- .../dingtalk/DingtalkJobErrorHandlerTest.java | 2 +- .../fixture/DingtalkInternalController.java | 2 +- .../handler/email/EmailJobErrorHandler.java | 2 +- ...ailJobErrorHandlerPropertiesValidator.java | 4 +- ...al.executor.error.handler.JobErrorHandler} | 0 ...andler.JobErrorHandlerPropertiesValidator} | 0 ...obErrorHandlerPropertiesValidatorTest.java | 2 +- .../email/EmailJobErrorHandlerTest.java | 2 +- .../handler/wechat/WechatJobErrorHandler.java | 4 +- ...hatJobErrorHandlerPropertiesValidator.java | 4 +- ...al.executor.error.handler.JobErrorHandler} | 0 ...andler.JobErrorHandlerPropertiesValidator} | 0 ...obErrorHandlerPropertiesValidatorTest.java | 2 +- .../wechat/WechatJobErrorHandlerTest.java | 2 +- .../fixture/WechatInternalController.java | 2 +- .../http/executor/HttpJobExecutor.java | 6 +- .../http/executor/HttpJobExecutorTest.java | 4 +- .../script/executor/ScriptJobExecutor.java | 6 +- .../script/ScriptJobExecutorTest.java | 4 +- ecosystem/tracing/api/pom.xml | 58 ------------------ .../api/src/test/resources/logback-test.xml | 43 ------------- ecosystem/tracing/pom.xml | 1 - ecosystem/tracing/rdb/pom.xml | 2 +- .../datasource/DataSourceConfiguration.java | 2 +- .../rdb/datasource/DataSourceRegistry.java | 3 +- .../DataSourceTracingStorageConverter.java | 6 +- .../rdb/listener/RDBTracingListener.java | 6 +- .../RDBTracingListenerConfiguration.java | 6 +- .../rdb/storage/RDBJobEventStorage.java | 22 +++---- .../rdb/yaml/YamlDataSourceConfiguration.java | 6 +- .../YamlDataSourceConfigurationConverter.java | 6 +- ...ra.yaml.config.YamlConfigurationConverter} | 0 ...ing.listener.TracingListenerConfiguration} | 0 ...l.tracing.storage.TracingStorageConverter} | 0 ...DataSourceTracingStorageConverterTest.java | 6 +- .../RDBTracingListenerConfigurationTest.java | 2 +- .../rdb/listener/RDBTracingListenerTest.java | 12 ++-- .../rdb/storage/RDBJobEventStorageTest.java | 8 +-- ...lDataSourceConfigurationConverterTest.java | 2 +- .../elasticjob/example/JavaMain.java | 2 +- infra/pom.xml | 61 ------------------- infra/src/test/resources/logback-test.xml | 42 ------------- kernel/pom.xml | 5 -- ...tractDistributeOnceElasticJobListener.java | 6 +- .../kernel}/infra/constant/ExecutionType.java | 2 +- .../kernel}/infra/env/HostException.java | 2 +- .../elasticjob/kernel}/infra/env/IpUtils.java | 2 +- .../infra/exception/ExceptionUtils.java | 2 +- .../exception/JobConfigurationException.java | 2 +- .../JobExecutionEnvironmentException.java | 2 +- .../exception/JobExecutionException.java | 2 +- .../infra/exception/JobSystemException.java | 2 +- .../exception/PropertiesPreconditions.java | 2 +- .../kernel}/infra/json/GsonFactory.java | 2 +- .../infra/listener/ElasticJobListener.java | 2 +- .../infra/listener/ShardingContexts.java | 2 +- .../kernel}/infra/yaml/YamlEngine.java | 4 +- .../infra/yaml/config/YamlConfiguration.java | 2 +- .../config/YamlConfigurationConverter.java | 2 +- .../DefaultYamlTupleProcessor.java | 2 +- .../ElasticJobYamlRepresenter.java | 2 +- .../annotation/JobAnnotationBuilder.java | 2 +- .../internal/config/ConfigurationService.java | 6 +- .../internal/config/JobConfigurationPOJO.java | 4 +- .../config/RescheduleListenerManager.java | 2 +- .../kernel/internal/context/TaskContext.java | 2 +- .../internal/executor/ElasticJobExecutor.java | 14 ++--- .../kernel/internal/executor/JobFacade.java | 16 ++--- .../handler/general/ThrowJobErrorHandler.java | 2 +- .../executor/item/JobItemExecutorFactory.java | 2 +- .../failover/FailoverListenerManager.java | 2 +- .../guarantee/GuaranteeListenerManager.java | 2 +- .../internal/guarantee/GuaranteeService.java | 2 +- .../internal/instance/InstanceNode.java | 2 +- .../internal/instance/InstanceService.java | 2 +- .../internal/listener/ListenerManager.java | 2 +- .../schedule/JobScheduleController.java | 2 +- .../internal/schedule/JobScheduler.java | 6 +- .../kernel/internal/server/ServerNode.java | 2 +- .../kernel/internal/setup/SetUpFacade.java | 2 +- .../sharding/ExecutionContextService.java | 2 +- .../internal/sharding/ExecutionService.java | 2 +- .../kernel/internal/sharding/JobInstance.java | 2 +- .../MonitorExecutionListenerManager.java | 2 +- .../sharding/ShardingItemParameters.java | 2 +- .../sharding/ShardingListenerManager.java | 2 +- .../internal/sharding/ShardingService.java | 2 +- .../internal}/tracing/JobTracingEventBus.java | 10 +-- .../tracing/api/TracingConfiguration.java | 6 +- .../api/TracingStorageConfiguration.java | 2 +- .../internal}/tracing/event/JobEvent.java | 2 +- .../tracing/event/JobExecutionEvent.java | 4 +- .../tracing/event/JobStatusTraceEvent.java | 4 +- .../TracingConfigurationException.java | 2 +- ...cingStorageConverterNotFoundException.java | 4 +- .../TracingStorageUnavailableException.java | 2 +- .../tracing/exception/WrapException.java | 2 +- .../tracing/listener/TracingListener.java | 6 +- .../TracingListenerConfiguration.java | 4 +- .../storage/TracingStorageConverter.java | 4 +- .../TracingStorageConverterFactory.java | 2 +- .../yaml/YamlTracingConfiguration.java | 8 +-- .../YamlTracingConfigurationConverter.java | 8 +-- .../yaml/YamlTracingStorageConfiguration.java | 8 +-- .../internal/util/SensitiveInfoUtils.java | 2 +- ...fra.yaml.config.YamlConfigurationConverter | 2 +- .../DistributeOnceElasticJobListenerTest.java | 4 +- .../TestDistributeOnceElasticJobListener.java | 2 +- .../fixture/TestElasticJobListener.java | 4 +- .../kernel}/infra/env/HostExceptionTest.java | 2 +- .../kernel}/infra/env/IpUtilsTest.java | 2 +- .../infra/exception/ExceptionUtilsTest.java | 2 +- .../JobConfigurationExceptionTest.java | 2 +- .../JobExecutionEnvironmentExceptionTest.java | 2 +- .../exception/JobSystemExceptionTest.java | 2 +- .../PropertiesPreconditionsTest.java | 2 +- .../kernel}/infra/json/GsonFactoryTest.java | 2 +- .../infra/listener/ShardingContextsTest.java | 2 +- .../kernel}/infra/yaml/YamlEngineTest.java | 8 +-- .../yaml/fixture/FooYamlConfiguration.java | 2 +- .../config/ConfigurationServiceTest.java | 6 +- .../config/JobConfigurationPOJOTest.java | 2 +- .../internal/context/TaskContextTest.java | 2 +- .../internal/context/fixture/TaskNode.java | 2 +- .../executor/ElasticJobExecutorTest.java | 8 +-- .../internal/executor/JobFacadeTest.java | 6 +- .../general/ThrowJobErrorHandlerTest.java | 2 +- .../item/JobItemExecutorFactoryTest.java | 2 +- .../GuaranteeListenerManagerTest.java | 2 +- .../guarantee/GuaranteeServiceTest.java | 2 +- .../schedule/JobScheduleControllerTest.java | 2 +- .../sharding/ExecutionContextServiceTest.java | 2 +- .../sharding/ExecutionServiceTest.java | 2 +- .../internal/sharding/JobInstanceTest.java | 4 +- .../sharding/ShardingItemParametersTest.java | 2 +- .../tracing/JobTracingEventBusTest.java | 12 ++-- .../tracing/event/JobExecutionEventTest.java | 2 +- .../tracing/fixture/JobEventCaller.java | 2 +- .../fixture/JobEventCallerConfiguration.java | 4 +- .../fixture/JobEventCallerConverter.java | 6 +- .../TestTracingFailureConfiguration.java | 8 +-- .../tracing/fixture/TestTracingListener.java | 8 +-- .../TestTracingListenerConfiguration.java | 6 +- .../TracingStorageConverterFactoryTest.java | 4 +- .../yaml/YamlJobEventCallerConfiguration.java | 8 +-- ...lJobEventCallerConfigurationConverter.java | 10 +-- ...YamlTracingConfigurationConverterTest.java | 6 +- ....kernel.infra.listener.ElasticJobListener} | 0 ...fra.yaml.config.YamlConfigurationConverter | 2 +- ...cing.listener.TracingListenerConfiguration | 4 +- ...al.tracing.storage.TracingStorageConverter | 2 +- .../internal/operate/JobOperateAPIImpl.java | 2 +- .../settings/JobConfigurationAPIImpl.java | 2 +- .../statistics/JobStatisticsAPIImpl.java | 2 +- .../statistics/ServerStatisticsAPIImpl.java | 2 +- .../statistics/ShardingStatisticsAPIImpl.java | 2 +- pom.xml | 1 - .../job/ElasticJobBootstrapConfiguration.java | 2 +- .../ElasticJobTracingConfiguration.java | 2 +- .../boot/job/ElasticJobSpringBootTest.java | 2 +- .../listener/LogElasticJobListener.java | 4 +- .../listener/NoopElasticJobListener.java | 4 +- .../tracing/TracingConfigurationTest.java | 2 +- ....kernel.infra.listener.ElasticJobListener} | 0 .../spring/core/util/AopTargetUtils.java | 2 +- .../parser/TracingBeanDefinitionParser.java | 2 +- .../fixture/listener/SimpleCglibListener.java | 4 +- .../SimpleJdkDynamicProxyListener.java | 4 +- .../fixture/listener/SimpleListener.java | 4 +- .../fixture/listener/SimpleOnceListener.java | 2 +- ....kernel.infra.listener.ElasticJobListener} | 0 .../annotation/OneOffEnabledJobE2ETest.java | 4 +- .../annotation/ScheduleEnabledJobE2ETest.java | 4 +- .../e2e/raw/disable/DisabledJobE2ETest.java | 4 +- .../e2e/raw/enable/EnabledJobE2ETest.java | 4 +- .../DistributeOnceE2EFixtureJobListener.java | 2 +- .../listener/E2EFixtureJobListener.java | 4 +- ....kernel.infra.listener.ElasticJobListener} | 0 184 files changed, 298 insertions(+), 514 deletions(-) rename ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/error-handler/type/email/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/type/email/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) delete mode 100644 ecosystem/tracing/api/pom.xml delete mode 100644 ecosystem/tracing/api/src/test/resources/logback-test.xml rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter => org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter} (100%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration => org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration} (100%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter => org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter} (100%) delete mode 100644 infra/pom.xml delete mode 100644 infra/src/test/resources/logback-test.xml rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/constant/ExecutionType.java (93%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/env/HostException.java (94%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/env/IpUtils.java (99%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/ExceptionUtils.java (95%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/JobConfigurationException.java (94%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/JobExecutionEnvironmentException.java (94%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/JobExecutionException.java (93%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/JobSystemException.java (95%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/PropertiesPreconditions.java (96%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/json/GsonFactory.java (95%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/listener/ElasticJobListener.java (95%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/listener/ShardingContexts.java (97%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/yaml/YamlEngine.java (92%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/yaml/config/YamlConfiguration.java (93%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/yaml/config/YamlConfigurationConverter.java (95%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/yaml/representer/DefaultYamlTupleProcessor.java (96%) rename {infra/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel}/infra/yaml/representer/ElasticJobYamlRepresenter.java (95%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/JobTracingEventBus.java (88%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/api/TracingConfiguration.java (84%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/api/TracingStorageConfiguration.java (93%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/event/JobEvent.java (92%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/event/JobExecutionEvent.java (97%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/event/JobStatusTraceEvent.java (91%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/exception/TracingConfigurationException.java (93%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/exception/TracingStorageConverterNotFoundException.java (87%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/exception/TracingStorageUnavailableException.java (93%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/exception/WrapException.java (92%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/listener/TracingListener.java (84%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/listener/TracingListenerConfiguration.java (88%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/storage/TracingStorageConverter.java (88%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/storage/TracingStorageConverterFactory.java (95%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/yaml/YamlTracingConfiguration.java (82%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/yaml/YamlTracingConfigurationConverter.java (84%) rename {ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob => kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/yaml/YamlTracingStorageConfiguration.java (75%) rename ecosystem/tracing/api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter => kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter (88%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/env/HostExceptionTest.java (94%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/env/IpUtilsTest.java (98%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/ExceptionUtilsTest.java (95%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/JobConfigurationExceptionTest.java (95%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/JobExecutionEnvironmentExceptionTest.java (94%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/JobSystemExceptionTest.java (96%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/exception/PropertiesPreconditionsTest.java (97%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/json/GsonFactoryTest.java (94%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/listener/ShardingContextsTest.java (96%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/yaml/YamlEngineTest.java (90%) rename {infra/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel}/infra/yaml/fixture/FooYamlConfiguration.java (93%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/JobTracingEventBusTest.java (84%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/event/JobExecutionEventTest.java (97%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/fixture/JobEventCaller.java (92%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/fixture/JobEventCallerConfiguration.java (87%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/fixture/JobEventCallerConverter.java (82%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/fixture/TestTracingFailureConfiguration.java (75%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/fixture/TestTracingListener.java (80%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/fixture/TestTracingListenerConfiguration.java (80%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/storage/TracingStorageConverterFactoryTest.java (89%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/yaml/YamlJobEventCallerConfiguration.java (77%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/yaml/YamlJobEventCallerConfigurationConverter.java (76%) rename {ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob => kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal}/tracing/yaml/YamlTracingConfigurationConverterTest.java (88%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener} (100%) rename ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter => kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter (88%) rename ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration => kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration (79%) rename ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter => kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter (89%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener} (100%) rename spring/namespace/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener} (100%) rename test/e2e/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener} (100%) diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java index 7fd77b094a..317b7a8be3 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java @@ -29,8 +29,8 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; @@ -48,7 +48,7 @@ import java.util.Properties; /** - * Job error handler for send error message via dingtalk. + * Job error handler for send error message via Dingtalk. */ @Slf4j public final class DingtalkJobErrorHandler implements JobErrorHandler { diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java index de97f1bb88..7d29b7266b 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java @@ -17,13 +17,13 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.exception.PropertiesPreconditions; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; /** - * Job error handler properties validator for dingtalk. + * Job error handler properties validator for Dingtalk. */ public final class DingtalkJobErrorHandlerPropertiesValidator implements JobErrorHandlerPropertiesValidator { diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java index bc0557e8c2..75eeea4c07 100644 --- a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java +++ b/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; /** - * Job error handler properties constants for send error message via dingtalk. + * Job error handler properties constants for send error message via Dingtalk. */ public final class DingtalkPropertiesConstants { diff --git a/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index 55ddddf94a..518439f457 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index c8d9aa7445..c408d07894 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -20,8 +20,8 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.error.handler.dingtalk.fixture.DingtalkInternalController; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java index 1c2c6c7d5a..a53025da4b 100644 --- a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java +++ b/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java @@ -21,7 +21,7 @@ import com.google.common.base.Strings; import com.google.common.collect.ImmutableMap; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.restful.Http; import org.apache.shardingsphere.elasticjob.restful.RestfulController; import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java index 5d48b4b6f8..5c6a478ba9 100644 --- a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java +++ b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java @@ -20,7 +20,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import javax.mail.Authenticator; import javax.mail.BodyPart; diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java index a48e20c50f..6260372047 100644 --- a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.exception.PropertiesPreconditions; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index 34e7dd76ab..6e99f5b82d 100644 --- a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index 3c216f262d..db91092ec6 100644 --- a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -20,7 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java index 496e28d038..a62647fca1 100644 --- a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java +++ b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java @@ -28,8 +28,8 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import java.io.IOException; import java.io.PrintWriter; diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java index c2a6947c60..3552dabaa3 100644 --- a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.infra.exception.PropertiesPreconditions; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler b/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler rename to ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index 254e2a0125..778e6ff637 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index b39cda94d0..4df5094ad0 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -20,8 +20,8 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture.WechatInternalController; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java index 90d572abe8..b11169ffcd 100644 --- a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java +++ b/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture; import com.google.common.collect.ImmutableMap; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.restful.Http; import org.apache.shardingsphere.elasticjob.restful.RestfulController; import org.apache.shardingsphere.elasticjob.restful.annotation.Mapping; diff --git a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java index 75043c96cd..94aaa551b9 100644 --- a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java +++ b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java @@ -26,9 +26,9 @@ import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.http.pojo.HttpParam; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionException; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionException; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; import java.io.BufferedReader; import java.io.IOException; diff --git a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 23125c0226..1d52619961 100644 --- a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -23,8 +23,8 @@ import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.http.executor.fixture.InternalController; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionException; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; diff --git a/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java index 3cb9ada910..ded2ddefcf 100644 --- a/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java +++ b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java @@ -25,9 +25,9 @@ import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; import java.io.IOException; diff --git a/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index 5568bb0667..033a84b277 100644 --- a/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -22,8 +22,8 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/tracing/api/pom.xml b/ecosystem/tracing/api/pom.xml deleted file mode 100644 index 78dabbd173..0000000000 --- a/ecosystem/tracing/api/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-tracing - 3.1.0-SNAPSHOT - - elasticjob-tracing-api - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-api - ${project.parent.version} - - - org.apache.shardingsphere.elasticjob - elasticjob-infra - ${project.parent.version} - - - - org.apache.shardingsphere.elasticjob - elasticjob-test-util - ${project.parent.version} - test - - - - org.apache.commons - commons-lang3 - - - - org.awaitility - awaitility - - - diff --git a/ecosystem/tracing/api/src/test/resources/logback-test.xml b/ecosystem/tracing/api/src/test/resources/logback-test.xml deleted file mode 100644 index dbd01b8d51..0000000000 --- a/ecosystem/tracing/api/src/test/resources/logback-test.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - ${log.context.name} - - - - - - ERROR - - - ${log.pattern} - - - - - - - - - - diff --git a/ecosystem/tracing/pom.xml b/ecosystem/tracing/pom.xml index c158d86e54..0e7c871578 100644 --- a/ecosystem/tracing/pom.xml +++ b/ecosystem/tracing/pom.xml @@ -28,7 +28,6 @@ ${project.artifactId} - api rdb diff --git a/ecosystem/tracing/rdb/pom.xml b/ecosystem/tracing/rdb/pom.xml index 8156d0e1d4..1bf77c6f3a 100644 --- a/ecosystem/tracing/rdb/pom.xml +++ b/ecosystem/tracing/rdb/pom.xml @@ -29,7 +29,7 @@ org.apache.shardingsphere.elasticjob - elasticjob-tracing-api + elasticjob-kernel ${project.parent.version} diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java index 63434bf611..b4144aa5e3 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java @@ -24,7 +24,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java index f42152c514..518954e388 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java @@ -19,14 +19,13 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; import javax.sql.DataSource; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** - * Mapping {@link TracingStorageConfiguration} to {@link DataSource}. + * Mapping tracing storage configuration} to data source. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class DataSourceRegistry { diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java index 40475c1677..e4a809b477 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingStorageUnavailableException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingStorageUnavailableException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; import javax.sql.DataSource; import java.sql.Connection; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java index 87b4a907bd..cc67e3318d 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java index 397f78c338..cb47480ec1 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; import javax.sql.DataSource; import java.sql.SQLException; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 37e93759bd..0d4873e6bb 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -19,11 +19,11 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; -import org.apache.shardingsphere.elasticjob.tracing.exception.WrapException; +import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.WrapException; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DefaultDatabaseType; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; @@ -82,8 +82,8 @@ public static RDBJobEventStorage getInstance(final DataSource dataSource) throws return wrapException(() -> STORAGE_MAP.computeIfAbsent(dataSource, ds -> { try { return new RDBJobEventStorage(ds); - } catch (SQLException e) { - throw new WrapException(e); + } catch (final SQLException ex) { + throw new WrapException(ex); } })); } @@ -98,11 +98,11 @@ public static RDBJobEventStorage getInstance(final DataSource dataSource) throws public static RDBJobEventStorage wrapException(final Supplier supplier) throws SQLException { try { return supplier.get(); - } catch (WrapException e) { - if (e.getCause() instanceof SQLException) { - throw new SQLException(e.getCause()); + } catch (final WrapException ex) { + if (ex.getCause() instanceof SQLException) { + throw new SQLException(ex.getCause()); } - throw e; + throw ex; } } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java index 253d954efd..56447cb57a 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java @@ -19,9 +19,9 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.yaml.YamlTracingStorageConfiguration; import javax.sql.DataSource; import java.util.LinkedHashMap; @@ -30,8 +30,8 @@ /** * YAML Data source configuration. */ -@Setter @Getter +@Setter public final class YamlDataSourceConfiguration implements YamlTracingStorageConfiguration { private static final long serialVersionUID = -8013707594458676772L; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java index 28ec2d65af..66dca491f0 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java @@ -17,10 +17,10 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.yaml; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.yaml.YamlTracingStorageConfiguration; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter similarity index 100% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration similarity index 100% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter similarity index 100% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java index aadde04a23..dcc49e0951 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; import com.zaxxer.hikari.HikariDataSource; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingStorageUnavailableException; -import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter; -import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverterFactory; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingStorageUnavailableException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverterFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java index 781b3652fe..eae9b3e7bb 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 738fe3f344..742a935f18 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -18,13 +18,13 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index b79ebd3cd9..937b507a2c 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -18,10 +18,10 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java index 06ccb4aa55..2df52bccec 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.yaml; import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.yaml.YamlTracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingStorageConfiguration; import org.junit.jupiter.api.Test; import javax.sql.DataSource; diff --git a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index 975ecadd04..ae3b30aae7 100644 --- a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java +++ b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -33,7 +33,7 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import javax.sql.DataSource; import java.io.IOException; diff --git a/infra/pom.xml b/infra/pom.xml deleted file mode 100644 index 1a0a2aa4fa..0000000000 --- a/infra/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob - 3.1.0-SNAPSHOT - - elasticjob-infra - ${project.artifactId} - - - - org.apache.shardingsphere.elasticjob - elasticjob-api - ${project.parent.version} - - - - org.apache.shardingsphere.elasticjob - elasticjob-test-util - ${project.parent.version} - test - - - - org.apache.commons - commons-lang3 - - - org.yaml - snakeyaml - - - com.google.code.gson - gson - - - - org.awaitility - awaitility - - - diff --git a/infra/src/test/resources/logback-test.xml b/infra/src/test/resources/logback-test.xml deleted file mode 100644 index 060ba6530c..0000000000 --- a/infra/src/test/resources/logback-test.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - ${log.context.name} - - - - - - ERROR - - - ${log.pattern} - - - - - - - - - diff --git a/kernel/pom.xml b/kernel/pom.xml index b126a12b1c..ae63a8371e 100644 --- a/kernel/pom.xml +++ b/kernel/pom.xml @@ -32,11 +32,6 @@ elasticjob-api ${project.parent.version} - - org.apache.shardingsphere.elasticjob - elasticjob-infra - ${project.parent.version} - org.apache.shardingsphere.elasticjob elasticjob-error-handler-spi diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java index ce628253b2..023f12fef2 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java @@ -20,9 +20,9 @@ import lombok.Setter; import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; import java.util.Set; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/constant/ExecutionType.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/constant/ExecutionType.java similarity index 93% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/constant/ExecutionType.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/constant/ExecutionType.java index 538f68ab13..5149b9786a 100755 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/constant/ExecutionType.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/constant/ExecutionType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.constant; +package org.apache.shardingsphere.elasticjob.kernel.infra.constant; /** * Execution type. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/HostException.java similarity index 94% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/HostException.java index 56e1423199..5a51219058 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/HostException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/HostException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.env; +package org.apache.shardingsphere.elasticjob.kernel.infra.env; import java.io.IOException; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/IpUtils.java similarity index 99% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/IpUtils.java index c5ddbefe5a..9d803e96d6 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtils.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/IpUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.env; +package org.apache.shardingsphere.elasticjob.kernel.infra.env; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/ExceptionUtils.java similarity index 95% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/ExceptionUtils.java index 7a127b60d5..825dee4dd6 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtils.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/ExceptionUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobConfigurationException.java similarity index 94% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobConfigurationException.java index dc8bcee988..5860775304 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobConfigurationException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; /** * Job configuration exception. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionEnvironmentException.java similarity index 94% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionEnvironmentException.java index 95245b9f72..71a9b8477b 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionEnvironmentException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; /** * Job execution environment exception. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionException.java similarity index 93% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionException.java index e5265a55aa..8a5579cc64 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; /** * Job execution exception. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobSystemException.java similarity index 95% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobSystemException.java index 914540e30b..18c5fa8521 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobSystemException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; /** * Job system exception. diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditions.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/PropertiesPreconditions.java similarity index 96% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditions.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/PropertiesPreconditions.java index 60aaecde66..90b1d17363 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditions.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/PropertiesPreconditions.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; import com.google.common.base.Preconditions; import lombok.AccessLevel; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/json/GsonFactory.java similarity index 95% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/json/GsonFactory.java index 23bddddfdc..9f867ece27 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/json/GsonFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.json; +package org.apache.shardingsphere.elasticjob.kernel.infra.json; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ElasticJobListener.java similarity index 95% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ElasticJobListener.java index 87eabd3f13..e92d72e2d9 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.listener; +package org.apache.shardingsphere.elasticjob.kernel.infra.listener; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContexts.java similarity index 97% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContexts.java index e1db270f87..aef13ca19d 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContexts.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContexts.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.listener; +package org.apache.shardingsphere.elasticjob.kernel.infra.listener; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/YamlEngine.java similarity index 92% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/YamlEngine.java index f5760d8c22..1e75393584 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngine.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/YamlEngine.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.yaml; +package org.apache.shardingsphere.elasticjob.kernel.infra.yaml; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.yaml.representer.ElasticJobYamlRepresenter; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.representer.ElasticJobYamlRepresenter; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.Yaml; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfiguration.java similarity index 93% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfiguration.java index 0b2d8bf0cb..0dc414979d 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.yaml.config; +package org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config; import java.io.Serializable; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfigurationConverter.java similarity index 95% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfigurationConverter.java index 29ad03bb71..1e38b4028c 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/config/YamlConfigurationConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfigurationConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.yaml.config; +package org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/representer/DefaultYamlTupleProcessor.java similarity index 96% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/representer/DefaultYamlTupleProcessor.java index 480b5d8dfc..2fa2272755 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/DefaultYamlTupleProcessor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/representer/DefaultYamlTupleProcessor.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.yaml.representer; +package org.apache.shardingsphere.elasticjob.kernel.infra.yaml.representer; import org.yaml.snakeyaml.nodes.CollectionNode; import org.yaml.snakeyaml.nodes.MappingNode; diff --git a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/representer/ElasticJobYamlRepresenter.java similarity index 95% rename from infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/representer/ElasticJobYamlRepresenter.java index aa13ff780a..c448779f17 100644 --- a/infra/src/main/java/org/apache/shardingsphere/elasticjob/infra/yaml/representer/ElasticJobYamlRepresenter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/representer/ElasticJobYamlRepresenter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.yaml.representer; +package org.apache.shardingsphere.elasticjob.kernel.infra.yaml.representer; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.introspector.Property; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java index 93d5b64464..ac284830af 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/annotation/JobAnnotationBuilder.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; import org.apache.shardingsphere.elasticjob.api.JobExtraConfigurationFactory; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import java.util.Optional; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java index 10fe3842ba..971f6ad8cd 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java @@ -19,12 +19,12 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; /** * Configuration service. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java index 6419da3072..1d9a912412 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java @@ -21,8 +21,8 @@ import lombok.Setter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.ArrayList; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java index fe492a14a6..304d269d5f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/RescheduleListenerManager.java @@ -19,7 +19,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java index f8cdabbd8a..2a4f8ad652 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java @@ -24,7 +24,7 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; import java.util.Collections; import java.util.List; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java index 6cc6b781a1..121080acd5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java @@ -26,13 +26,13 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.executor.item.JobItemExecutorFactory; import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.ExecutorServiceReloader; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.exception.ExceptionUtils; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent.ExecutionSource; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.ExceptionUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent.ExecutionSource; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Collection; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java index 49c3ed6092..3f30a58c0d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java @@ -20,9 +20,9 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; @@ -31,11 +31,11 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; import java.util.Collection; import java.util.Comparator; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java index 22afad06e1..008604f82b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; /** * Job error handler for throw exception. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java index f2a9848f84..9f362441f8 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java index 4c727a4d0d..f64279ccbe 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/failover/FailoverListenerManager.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java index d0c8937da4..7c257f79a9 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java index a1df049f67..33fb5d335e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNode.java index be0aed258f..97bde398f5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceNode.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java index 5d3e03e687..5cb59ebaad 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/instance/InstanceService.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.instance; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.kernel.internal.trigger.TriggerNode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java index 23e09bebd5..719cf499cd 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.RescheduleListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.election.ElectionListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleController.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleController.java index 00ad6a137f..e8daa73cbb 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleController.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleController.java @@ -20,7 +20,7 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.quartz.CronScheduleBuilder; import org.quartz.CronTrigger; import org.quartz.JobDetail; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 245a64bb26..4c2865afe9 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -24,17 +24,17 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ElasticJobExecutor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.JobFacade; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; import org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory; import org.apache.shardingsphere.elasticjob.kernel.internal.setup.SetUpFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.quartz.JobBuilder; import org.quartz.JobDetail; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java index 45cbdd0d88..6e663d5327 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerNode.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import java.util.Objects; import java.util.regex.Pattern; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java index d0c1e7be12..d1d8843975 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.setup; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerManager; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java index 1aa21f9bd6..18075c0625 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java index b918e4edfa..1cb8799dc3 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstance.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstance.java index 02ce1e2f3e..2f7bbfdcaa 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstance.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstance.java @@ -21,7 +21,7 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import java.lang.management.ManagementFactory; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java index 21e71013ca..a75f5fc376 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/MonitorExecutionListenerManager.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParameters.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParameters.java index e2fc8bca8c..91560ab971 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParameters.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParameters.java @@ -20,7 +20,7 @@ import com.google.common.base.Strings; import lombok.AllArgsConstructor; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import java.util.Collections; import java.util.HashMap; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java index 9b4d2e4489..909d66ce2f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingListenerManager.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationNode; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java index c4e2f1e98c..0ef230969e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBus.java similarity index 88% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBus.java index 003e03837c..1f8d43d10e 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBus.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBus.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing; import com.google.common.eventbus.AsyncEventBus; import com.google.common.eventbus.EventBus; import com.google.common.util.concurrent.MoreExecutors; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.event.JobEvent; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.concurrent.ExecutorService; diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingConfiguration.java similarity index 84% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingConfiguration.java index 7bd2343d69..6163ebdfe3 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingConfiguration.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.api; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingStorageConverterNotFoundException; -import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverterFactory; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingStorageConverterNotFoundException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverterFactory; /** * Tracing configuration. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingStorageConfiguration.java similarity index 93% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingStorageConfiguration.java index c051dd54e4..6318349020 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingStorageConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingStorageConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.api; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api; /** * Tracing storage configuration. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobEvent.java similarity index 92% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobEvent.java index 68f2241670..ac52eb0a41 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobEvent.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; /** * Job event. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEvent.java similarity index 97% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEvent.java index 183c34aff1..71bad519d0 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEvent.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; @@ -28,8 +28,8 @@ /** * Job execution event. */ -@RequiredArgsConstructor @AllArgsConstructor +@RequiredArgsConstructor @Getter public final class JobExecutionEvent implements JobEvent { diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java similarity index 91% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java index 7a95a30c74..0447deadae 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; import java.util.Date; import java.util.UUID; diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingConfigurationException.java similarity index 93% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingConfigurationException.java index 067e82cd1a..1776783f60 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingConfigurationException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; /** * Tracing configuration exception. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageConverterNotFoundException.java similarity index 87% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageConverterNotFoundException.java index cecc6176c1..9190c3bef0 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageConverterNotFoundException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageConverterNotFoundException.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; -import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; /** * {@link TracingStorageConverter} not found exception. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageUnavailableException.java similarity index 93% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageUnavailableException.java index f3fac7f2a7..cb9bdcb7bf 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingStorageUnavailableException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageUnavailableException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; /** * Tracing storage unavailable exception. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/WrapException.java similarity index 92% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/WrapException.java index 8e776a8d76..693ea2bcf2 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/WrapException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/WrapException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; /** * Use to wrap Exception. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListener.java similarity index 84% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListener.java index b9ac000265..7aac02be30 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListener.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener; import com.google.common.eventbus.AllowConcurrentEvents; import com.google.common.eventbus.Subscribe; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; /** * Tracing listener. diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListenerConfiguration.java similarity index 88% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListenerConfiguration.java index 190dce213a..5bb0345af5 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListenerConfiguration.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.listener; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverter.java similarity index 88% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverter.java index 559821e4e9..9371997f13 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverter.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.storage; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactory.java similarity index 95% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactory.java index b326c1ee39..d1bf19840b 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.storage; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfiguration.java similarity index 82% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfiguration.java index 8069c4416e..9181fb097a 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfiguration.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; /** - * YAML configuration for {@link org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration}. + * YAML configuration for {@link org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration}. * * @param type of storage */ diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverter.java similarity index 84% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverter.java index d605fcce51..60d97f5501 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverter.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; /** diff --git a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingStorageConfiguration.java similarity index 75% rename from ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingStorageConfiguration.java index 1e50d9ee33..3ed9605380 100644 --- a/ecosystem/tracing/api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingStorageConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingStorageConfiguration.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; /** - * YAML configuration for {@link org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration}. + * YAML configuration for {@link org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration}. * * @param type of storage */ diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java index ae23f403f3..e48b56938f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java @@ -19,7 +19,7 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import java.util.HashMap; import java.util.List; diff --git a/ecosystem/tracing/api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter similarity index 88% rename from ecosystem/tracing/api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter rename to kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter index e353bc066f..3582dc2b6c 100644 --- a/ecosystem/tracing/api/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter +++ b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.yaml.YamlTracingConfigurationConverter +org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingConfigurationConverter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java index 8b4b57f30b..5763e0a097 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java @@ -19,8 +19,8 @@ import com.google.common.collect.Sets; import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java index abdd4f049c..f358d01b19 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; public final class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java index c21bb39f05..07a07b03ec 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; @RequiredArgsConstructor public final class TestElasticJobListener implements ElasticJobListener { diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/HostExceptionTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/HostExceptionTest.java index db2d8b26a6..c853915d79 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/HostExceptionTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/HostExceptionTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.env; +package org.apache.shardingsphere.elasticjob.kernel.infra.env; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/IpUtilsTest.java similarity index 98% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/IpUtilsTest.java index eb3bf70137..6e9ca993a8 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/env/IpUtilsTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/env/IpUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.env; +package org.apache.shardingsphere.elasticjob.kernel.infra.env; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/ExceptionUtilsTest.java similarity index 95% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/ExceptionUtilsTest.java index 2739b42350..1822916cd2 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/ExceptionUtilsTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/ExceptionUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobConfigurationExceptionTest.java similarity index 95% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobConfigurationExceptionTest.java index 4605f68929..4a2e1e0ad5 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobConfigurationExceptionTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobConfigurationExceptionTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionEnvironmentExceptionTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionEnvironmentExceptionTest.java index fbbaf78cf6..32b03a6d23 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobExecutionEnvironmentExceptionTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobExecutionEnvironmentExceptionTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobSystemExceptionTest.java similarity index 96% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobSystemExceptionTest.java index 89c2c78a10..9b95a2f136 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/JobSystemExceptionTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/JobSystemExceptionTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditionsTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/PropertiesPreconditionsTest.java similarity index 97% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditionsTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/PropertiesPreconditionsTest.java index 7500c99b92..66acf47a51 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/exception/PropertiesPreconditionsTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/exception/PropertiesPreconditionsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.exception; +package org.apache.shardingsphere.elasticjob.kernel.infra.exception; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/json/GsonFactoryTest.java similarity index 94% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/json/GsonFactoryTest.java index e74291385b..d35e63092a 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/json/GsonFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/json/GsonFactoryTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.json; +package org.apache.shardingsphere.elasticjob.kernel.infra.json; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContextsTest.java similarity index 96% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContextsTest.java index 51845f3f2e..b906c08f18 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/listener/ShardingContextsTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContextsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.listener; +package org.apache.shardingsphere.elasticjob.kernel.infra.listener; import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; import org.junit.jupiter.api.Test; diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/YamlEngineTest.java similarity index 90% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/YamlEngineTest.java index 1e830b65ad..7199a04d88 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/YamlEngineTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/YamlEngineTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.yaml; +package org.apache.shardingsphere.elasticjob.kernel.infra.yaml; -import org.apache.shardingsphere.elasticjob.infra.yaml.fixture.FooYamlConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.fixture.FooYamlConfiguration; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -34,10 +34,6 @@ class YamlEngineTest { private static final String YAML_WITH_NULL = "foo: foo\n"; - private static final String PREFIX = "nest"; - - private static final String PREFIX2 = "nest.bar"; - @Test void assertMarshal() { FooYamlConfiguration actual = new FooYamlConfiguration(); diff --git a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/fixture/FooYamlConfiguration.java similarity index 93% rename from infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/fixture/FooYamlConfiguration.java index b158498558..49be0f3517 100644 --- a/infra/src/test/java/org/apache/shardingsphere/elasticjob/infra/yaml/fixture/FooYamlConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/fixture/FooYamlConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.infra.yaml.fixture; +package org.apache.shardingsphere.elasticjob.kernel.infra.yaml.fixture; import lombok.Getter; import lombok.Setter; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java index 62d8c8e150..8597fa7fb9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationServiceTest.java @@ -19,9 +19,9 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.fixture.YamlConstants; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJOTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJOTest.java index 6bcd353293..b7605b3826 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJOTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJOTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.config; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.junit.jupiter.api.Test; import java.util.Collections; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java index 4b997dbbab..2f94916b00 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context; -import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode; import org.hamcrest.CoreMatchers; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java index 295d11302d..44e8fc50de 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture; import lombok.Builder; -import org.apache.shardingsphere.elasticjob.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; @Builder public final class TaskNode { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java index fba118dce3..00ad0cc887 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java @@ -18,14 +18,14 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java index b84c0191d2..857df35c59 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java @@ -19,8 +19,8 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; @@ -29,7 +29,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.tracing.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java index 4864a8a8c9..3b7636a1eb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java index b84d952c60..6c5fccc8de 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.item; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java index 8de42c1832..f8d0ac368d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java index 0db9a27296..8f1a6d6426 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java index b85551f921..6a786c9ada 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduleControllerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java index 04f2c930a2..d0571998e0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java index e66d54fdcc..f7eb3d7274 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstanceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstanceTest.java index 64f7131bda..2894c10cf2 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstanceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/JobInstanceTest.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParametersTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParametersTest.java index 661db7c863..a487fde7c2 100755 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParametersTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingItemParametersTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; -import org.apache.shardingsphere.elasticjob.infra.exception.JobConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.junit.jupiter.api.Test; import java.util.Collections; diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBusTest.java similarity index 84% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBusTest.java index 8b5d50161c..3de513c0b6 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobTracingEventBusTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBusTest.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing; import com.google.common.eventbus.EventBus; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.TestTracingListener; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.event.JobEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListener; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEventTest.java similarity index 97% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEventTest.java index e83d4b886e..fd37cc6665 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEventTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; import org.junit.jupiter.api.Test; diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCaller.java similarity index 92% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCaller.java index 1d454862bb..a6459bef75 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCaller.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; public interface JobEventCaller { diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConfiguration.java similarity index 87% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConfiguration.java index 1a9d01cf56..d2f0deaeb9 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConfiguration.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; /** * {@link TracingStorageConfiguration} for {@link JobEventCaller}. diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConverter.java similarity index 82% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConverter.java index d46ed55ab0..99ebded974 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCallerConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConverter.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; /** * {@link TracingStorageConverter} for {@link JobEventCaller}. diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingFailureConfiguration.java similarity index 75% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingFailureConfiguration.java index 7f6cfdf40c..9f59e4bda3 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingFailureConfiguration.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; public final class TestTracingFailureConfiguration implements TracingListenerConfiguration { diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListener.java similarity index 80% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListener.java index d29b840f2a..5262686da5 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListener.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; import lombok.Getter; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; @RequiredArgsConstructor public final class TestTracingListener implements TracingListener { diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListenerConfiguration.java similarity index 80% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListenerConfiguration.java index d87fb5e432..fe0d6b262f 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListenerConfiguration.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; public final class TestTracingListenerConfiguration implements TracingListenerConfiguration { diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactoryTest.java similarity index 89% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactoryTest.java index 760fc956a0..c142e22fd8 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactoryTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.storage; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfiguration.java similarity index 77% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfiguration.java index d1a0fda903..938c93989b 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfiguration.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCallerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCallerConfiguration; /** * YAML JobEventCaller configuration. diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfigurationConverter.java similarity index 76% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfigurationConverter.java index b25b87ebfa..c6b780f95b 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlJobEventCallerConfigurationConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfigurationConverter.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; -import org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCallerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCallerConfiguration; /** * YAML JobEventCaller configuration converter. diff --git a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverterTest.java similarity index 88% rename from ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverterTest.java index afb26ba851..d33ff13e8e 100644 --- a/ecosystem/tracing/api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener diff --git a/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter similarity index 88% rename from ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter index 19d25e62c0..228b68f8e7 100644 --- a/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.yaml.config.YamlConfigurationConverter +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.yaml.YamlJobEventCallerConfigurationConverter +org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlJobEventCallerConfigurationConverter diff --git a/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration similarity index 79% rename from ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration index 6abb615a86..1773d05041 100644 --- a/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListenerConfiguration -org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingFailureConfiguration +org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.TestTracingListenerConfiguration +org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.TestTracingFailureConfiguration diff --git a/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter similarity index 89% rename from ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter index 73f32b36b2..98c255109d 100644 --- a/ecosystem/tracing/api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.storage.TracingStorageConverter +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.fixture.JobEventCallerConverter +org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCallerConverter diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java index 989ddf5811..87f7503776 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImpl.java @@ -19,7 +19,7 @@ import com.google.common.base.Preconditions; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java index 14a6cea1b6..ed84d4bcf2 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/settings/JobConfigurationAPIImpl.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; /** * Job Configuration API implementation class. diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java index 246d678c36..28a33ed233 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/JobStatisticsAPIImpl.java @@ -25,7 +25,7 @@ import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; import org.apache.shardingsphere.elasticjob.lifecycle.domain.JobBriefInfo; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import java.util.ArrayList; import java.util.Collection; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java index 5ddf90e87f..954664eabb 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ServerStatisticsAPIImpl.java @@ -19,7 +19,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI; import org.apache.shardingsphere.elasticjob.lifecycle.domain.ServerBriefInfo; diff --git a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java index 69294e87fb..678343b3f6 100644 --- a/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java +++ b/lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/statistics/ShardingStatisticsAPIImpl.java @@ -19,7 +19,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodePath; import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI; import org.apache.shardingsphere.elasticjob.lifecycle.domain.ShardingInfo; diff --git a/pom.xml b/pom.xml index 3325080949..df518fb764 100644 --- a/pom.xml +++ b/pom.xml @@ -34,7 +34,6 @@ api registry-center bootstrap - infra kernel lifecycle restful diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index fb848b9d42..c1d53bffae 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.SmartInitializingSingleton; import org.springframework.beans.factory.config.SingletonBeanRegistry; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java index 86233220c1..2b285ce337 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import com.zaxxer.hikari.HikariDataSource; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.springframework.beans.BeanUtils; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 867b6feef1..32309c4462 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -29,7 +29,7 @@ import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java index b55e1c8d91..13c318edb6 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; /** * Log elastic job listener. diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java index cf1940c2eb..665f92614f 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; /** * No operation elastic job listener. diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java index c88e187d7f..d9b7d9ced6 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtils.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtils.java index 6410b752a8..0df6f6ea48 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtils.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/util/AopTargetUtils.java @@ -20,7 +20,7 @@ import java.lang.reflect.Field; import lombok.AccessLevel; import lombok.NoArgsConstructor; -import org.apache.shardingsphere.elasticjob.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.springframework.aop.framework.AdvisedSupport; import org.springframework.aop.support.AopUtils; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java index 1111f03d12..d75b455f18 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.tracing.parser; import org.apache.shardingsphere.elasticjob.spring.namespace.tracing.tag.TracingBeanDefinitionTag; -import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java index 2ff8f3a8ae..33ba3e5e77 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java index 91be80eee8..93cd094514 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java index 52bf6ff235..fc083672bd 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java index 8336f7ecda..a971943670 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener similarity index 100% rename from spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java index 63328bd417..e23072f521 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.test.e2e.annotation; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java index cd1f8bce56..d8162f688f 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.test.e2e.annotation; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java index 32feed6ac0..6ca929fb4b 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.disable; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java index 6544c390f6..8dac7cda36 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java @@ -19,9 +19,9 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.infra.env.IpUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; -import org.apache.shardingsphere.elasticjob.infra.yaml.YamlEngine; +import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.test.e2e.raw.BaseE2ETest; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java index 24fa928f9e..19181cbf65 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; public class DistributeOnceE2EFixtureJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java index efa4bfa82a..0ded3ad091 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener; -import org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; public class E2EFixtureJobListener implements ElasticJobListener { diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener similarity index 100% rename from test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.infra.listener.ElasticJobListener rename to test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener From 34848ce60f316e18fde8a3853bd1efe539c7d850 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 30 Oct 2023 19:39:00 +0800 Subject: [PATCH 131/178] Rename ScheduleJobBootstrap and OneOffJobBootstrap package name from elasticjob.bootstrap.impl to elasticjob.bootstrap.type (#2341) --- .../bootstrap/{impl => type}/OneOffJobBootstrap.java | 2 +- .../bootstrap/{impl => type}/ScheduleJobBootstrap.java | 2 +- .../bootstrap/{impl => type}/OneOffJobBootstrapTest.java | 2 +- .../apache/shardingsphere/elasticjob/example/JavaMain.java | 4 ++-- .../elasticjob/example/controller/OneOffJobController.java | 2 +- .../spring/boot/job/ElasticJobBootstrapConfiguration.java | 4 ++-- .../spring/boot/job/ScheduleJobBootstrapStartupRunner.java | 2 +- .../spring/boot/job/ElasticJobSpringBootScannerTest.java | 2 +- .../elasticjob/spring/boot/job/ElasticJobSpringBootTest.java | 4 ++-- .../elasticjob/spring/core/scanner/ClassPathJobScanner.java | 2 +- .../spring/namespace/job/parser/JobBeanDefinitionParser.java | 4 ++-- .../namespace/job/AbstractOneOffJobSpringIntegrateTest.java | 2 +- .../namespace/job/OneOffJobSpringNamespaceWithRefTest.java | 2 +- .../namespace/job/OneOffJobSpringNamespaceWithTypeTest.java | 2 +- .../elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java | 4 ++-- .../shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java | 4 ++-- .../elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java | 2 +- .../elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java | 2 +- .../test/e2e/snapshot/BaseSnapshotServiceE2ETest.java | 2 +- 19 files changed, 25 insertions(+), 25 deletions(-) rename bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/{impl => type}/OneOffJobBootstrap.java (98%) rename bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/{impl => type}/ScheduleJobBootstrap.java (97%) rename bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/{impl => type}/OneOffJobBootstrapTest.java (98%) diff --git a/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrap.java b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java similarity index 98% rename from bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrap.java rename to bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java index d92da5d8cb..dc0599ccdd 100644 --- a/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrap.java +++ b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.bootstrap.type; import com.google.common.base.Preconditions; import com.google.common.base.Strings; diff --git a/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/ScheduleJobBootstrap.java b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/ScheduleJobBootstrap.java similarity index 97% rename from bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/ScheduleJobBootstrap.java rename to bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/ScheduleJobBootstrap.java index 5478bedf0b..2e712f9f36 100644 --- a/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/ScheduleJobBootstrap.java +++ b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/ScheduleJobBootstrap.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.bootstrap.type; import com.google.common.base.Preconditions; import com.google.common.base.Strings; diff --git a/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrapTest.java b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java similarity index 98% rename from bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrapTest.java rename to bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java index 69255c2b34..5528c28fca 100644 --- a/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/impl/OneOffJobBootstrapTest.java +++ b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.bootstrap.impl; +package org.apache.shardingsphere.elasticjob.bootstrap.type; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; diff --git a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index ae3b30aae7..211af4a8e9 100644 --- a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java +++ b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -25,8 +25,8 @@ import org.apache.shardingsphere.elasticjob.error.handler.wechat.WechatPropertiesConstants; import org.apache.shardingsphere.elasticjob.example.job.dataflow.JavaDataflowJob; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.example.job.simple.JavaOccurErrorJob; import org.apache.shardingsphere.elasticjob.example.job.simple.JavaSimpleJob; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java index c3eea81415..4e7e9c99be 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/controller/OneOffJobController.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.controller; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.GetMapping; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index c1d53bffae..1f87c0b212 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -23,8 +23,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java index d9fb52b383..db5c9f09e0 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ScheduleJobBootstrapStartupRunner.java @@ -19,7 +19,7 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.springframework.boot.CommandLineRunner; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java index d08d22102f..45a6e8ead3 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.AnnotationCustomJob; import org.apache.shardingsphere.elasticjob.spring.core.scanner.ElasticJobScan; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 32309c4462..262bafc898 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -20,8 +20,8 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl.CustomTestJob; diff --git a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java index 9d7912a078..ca98df7856 100644 --- a/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java +++ b/spring/core/src/main/java/org/apache/shardingsphere/elasticjob/spring/core/scanner/ClassPathJobScanner.java @@ -19,7 +19,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.RuntimeBeanReference; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java index ae09da59d4..38711504e7 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/parser/JobBeanDefinitionParser.java @@ -19,8 +19,8 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.namespace.job.tag.JobBeanDefinitionTag; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java index 28d536c13c..aba8cae472 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/AbstractOneOffJobSpringIntegrateTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.DataflowElasticJob; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java index ce8b09e0a9..d9e87cf135 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithRefTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job.ref.RefFooSimpleElasticJob; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java index 3a795ca0f1..1194f2b042 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/job/OneOffJobSpringNamespaceWithTypeTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.job; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java index 6656ce7b86..8dfa287dd3 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java @@ -22,8 +22,8 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.annotation.JobAnnotationBuilder; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java index ae3993e91c..ba384d29a9 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java @@ -22,8 +22,8 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.bootstrap.JobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java index 6ca929fb4b..f387b076d3 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java index 8dac7cda36..8c3cd2b605 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.test.e2e.raw.BaseE2ETest; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.server.ServerStatus; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java index 341ff8c87d..e6d75ba387 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java @@ -21,7 +21,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.bootstrap.impl.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.snapshot.SnapshotService; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; From a3740f7c1482139fe5aa849f8fcfbb80c97068c9 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 30 Oct 2023 19:45:54 +0800 Subject: [PATCH 132/178] =?UTF-8?q?Move=20AbstractDistributeOnceElasticJob?= =?UTF-8?q?Listener=E2=80=98s=20package=20(#2342)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/internal/guarantee/GuaranteeListenerManager.java | 2 +- .../elasticjob/kernel/internal/guarantee/GuaranteeService.java | 2 +- .../elasticjob/kernel/internal/schedule/JobScheduler.java | 2 +- .../listener/AbstractDistributeOnceElasticJobListener.java | 2 +- .../listener/fixture/TestDistributeOnceElasticJobListener.java | 2 +- .../kernel/internal/guarantee/GuaranteeListenerManagerTest.java | 2 +- .../kernel/internal/guarantee/GuaranteeServiceTest.java | 2 +- .../spring/namespace/fixture/listener/SimpleOnceListener.java | 2 +- .../fixture/listener/DistributeOnceE2EFixtureJobListener.java | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{api => }/listener/AbstractDistributeOnceElasticJobListener.java (98%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java index 7c257f79a9..a622328aac 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java index 33fb5d335e..97a957e4d4 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java @@ -19,7 +19,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 4c2865afe9..b552bdf184 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -28,7 +28,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.executor.JobFacade; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; import org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java index 023f12fef2..1e37302849 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.listener; +package org.apache.shardingsphere.elasticjob.kernel.listener; import lombok.Setter; import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java index f358d01b19..cc85f1d8df 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; public final class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java index f8d0ac368d..9e4eb96a65 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEvent; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java index 8f1a6d6426..f2289a5e7a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java @@ -19,7 +19,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java index a971943670..b1869d41f1 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java index 19181cbf65..0df40380b2 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener; import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.AbstractDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; public class DistributeOnceE2EFixtureJobListener extends AbstractDistributeOnceElasticJobListener { From 98e4877635db74fa7cf3fbf18fa7c670ecf5bff4 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 30 Oct 2023 23:36:15 +0800 Subject: [PATCH 133/178] Move ElasticJobListener to api module (#2343) --- .../elasticjob/spi/{ => executor}/JobItemExecutor.java | 6 +++--- .../spi/{ => executor}/param/JobRuntimeService.java | 2 +- .../spi/{ => executor}/param/ShardingContext.java | 2 +- .../spi/{ => executor}/type/ClassedJobItemExecutor.java | 4 ++-- .../spi/{ => executor}/type/TypedJobItemExecutor.java | 4 ++-- .../elasticjob/spi}/listener/ElasticJobListener.java | 3 ++- .../elasticjob/spi/listener/param}/ShardingContexts.java | 4 ++-- .../shardingsphere/elasticjob/annotation/job/CustomJob.java | 2 +- .../elasticjob/annotation/job/impl/SimpleTestJob.java | 2 +- .../spi/listener/param}/ShardingContextsTest.java | 6 +++--- .../elasticjob/dataflow/executor/DataflowJobExecutor.java | 6 +++--- .../shardingsphere/elasticjob/dataflow/job/DataflowJob.java | 2 +- ...ere.elasticjob.spi.executor.type.ClassedJobItemExecutor} | 0 .../dataflow/executor/DataflowJobExecutorTest.java | 4 ++-- .../elasticjob/http/executor/HttpJobExecutor.java | 6 +++--- ...phere.elasticjob.spi.executor.type.TypedJobItemExecutor} | 0 .../elasticjob/http/executor/HttpJobExecutorTest.java | 4 ++-- .../elasticjob/script/executor/ScriptJobExecutor.java | 6 +++--- ...phere.elasticjob.spi.executor.type.TypedJobItemExecutor} | 0 .../elasticjob/script/ScriptJobExecutorTest.java | 4 ++-- .../elasticjob/simple/executor/SimpleJobExecutor.java | 6 +++--- .../shardingsphere/elasticjob/simple/job/SimpleJob.java | 2 +- ...ere.elasticjob.spi.executor.type.ClassedJobItemExecutor} | 0 .../elasticjob/simple/executor/SimpleJobExecutorTest.java | 2 +- .../shardingsphere/elasticjob/simple/job/FooSimpleJob.java | 2 +- .../elasticjob/example/job/dataflow/JavaDataflowJob.java | 2 +- .../elasticjob/example/job/dataflow/SpringDataflowJob.java | 2 +- .../elasticjob/example/job/simple/JavaOccurErrorJob.java | 2 +- .../elasticjob/example/job/simple/JavaSimpleJob.java | 2 +- .../elasticjob/example/job/simple/SpringSimpleJob.java | 2 +- .../elasticjob/example/job/SpringBootDataflowJob.java | 2 +- .../example/job/SpringBootOccurErrorNoticeDingtalkJob.java | 2 +- .../example/job/SpringBootOccurErrorNoticeEmailJob.java | 2 +- .../example/job/SpringBootOccurErrorNoticeWechatJob.java | 2 +- .../elasticjob/example/job/SpringBootSimpleJob.java | 2 +- .../kernel/internal/executor/ElasticJobExecutor.java | 6 +++--- .../elasticjob/kernel/internal/executor/JobFacade.java | 6 +++--- .../kernel/internal/executor/JobJobRuntimeServiceImpl.java | 2 +- .../internal/executor/item/JobItemExecutorFactory.java | 4 ++-- .../kernel/internal/guarantee/GuaranteeListenerManager.java | 2 +- .../kernel/internal/guarantee/GuaranteeService.java | 2 +- .../kernel/internal/listener/ListenerManager.java | 2 +- .../elasticjob/kernel/internal/schedule/JobScheduler.java | 2 +- .../elasticjob/kernel/internal/setup/SetUpFacade.java | 2 +- .../kernel/internal/sharding/ExecutionContextService.java | 2 +- .../kernel/internal/sharding/ExecutionService.java | 2 +- .../listener/AbstractDistributeOnceElasticJobListener.java | 4 ++-- .../api/listener/DistributeOnceElasticJobListenerTest.java | 2 +- .../fixture/TestDistributeOnceElasticJobListener.java | 2 +- .../kernel/api/listener/fixture/TestElasticJobListener.java | 4 ++-- .../kernel/fixture/executor/ClassedFooJobExecutor.java | 6 +++--- .../kernel/fixture/executor/TypedFooJobExecutor.java | 6 +++--- .../elasticjob/kernel/fixture/job/DetailedFooJob.java | 2 +- .../elasticjob/kernel/fixture/job/FooJob.java | 2 +- .../kernel/internal/executor/ElasticJobExecutorTest.java | 4 ++-- .../elasticjob/kernel/internal/executor/JobFacadeTest.java | 2 +- .../internal/guarantee/GuaranteeListenerManagerTest.java | 2 +- .../kernel/internal/guarantee/GuaranteeServiceTest.java | 2 +- .../internal/sharding/ExecutionContextServiceTest.java | 2 +- .../kernel/internal/sharding/ExecutionServiceTest.java | 2 +- ...ere.elasticjob.spi.executor.type.ClassedJobItemExecutor} | 0 ...phere.elasticjob.spi.executor.type.TypedJobItemExecutor} | 0 ...ardingsphere.elasticjob.spi.listener.ElasticJobListener} | 0 .../spring/boot/job/executor/CustomClassedJobExecutor.java | 6 +++--- .../spring/boot/job/executor/PrintJobExecutor.java | 6 +++--- .../elasticjob/spring/boot/job/fixture/job/CustomJob.java | 2 +- .../boot/job/fixture/job/impl/AnnotationCustomJob.java | 2 +- .../spring/boot/job/fixture/job/impl/CustomTestJob.java | 2 +- .../boot/job/fixture/listener/LogElasticJobListener.java | 4 ++-- .../boot/job/fixture/listener/NoopElasticJobListener.java | 4 ++-- ...ere.elasticjob.spi.executor.type.ClassedJobItemExecutor} | 0 ...phere.elasticjob.spi.executor.type.TypedJobItemExecutor} | 0 ...ardingsphere.elasticjob.spi.listener.ElasticJobListener} | 0 .../elasticjob/spring/core/util/TargetJob.java | 2 +- .../spring/namespace/fixture/job/DataflowElasticJob.java | 2 +- .../spring/namespace/fixture/job/FooSimpleElasticJob.java | 2 +- .../fixture/job/annotation/AnnotationSimpleJob.java | 2 +- .../namespace/fixture/job/ref/RefFooDataflowElasticJob.java | 2 +- .../namespace/fixture/job/ref/RefFooSimpleElasticJob.java | 2 +- .../namespace/fixture/listener/SimpleCglibListener.java | 4 ++-- .../fixture/listener/SimpleJdkDynamicProxyListener.java | 4 ++-- .../spring/namespace/fixture/listener/SimpleListener.java | 4 ++-- .../namespace/fixture/listener/SimpleOnceListener.java | 2 +- ...ardingsphere.elasticjob.spi.listener.ElasticJobListener} | 0 .../test/e2e/annotation/fixture/AnnotationSimpleJob.java | 2 +- .../e2e/annotation/fixture/AnnotationUnShardingJob.java | 2 +- .../e2e/raw/fixture/executor/E2EFixtureJobExecutor.java | 6 +++--- .../elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java | 2 +- .../test/e2e/raw/fixture/job/E2EFixtureJobImpl.java | 2 +- .../listener/DistributeOnceE2EFixtureJobListener.java | 2 +- .../e2e/raw/fixture/listener/E2EFixtureJobListener.java | 4 ++-- ...ere.elasticjob.spi.executor.type.ClassedJobItemExecutor} | 0 ...ardingsphere.elasticjob.spi.listener.ElasticJobListener} | 0 93 files changed, 123 insertions(+), 122 deletions(-) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/{ => executor}/JobItemExecutor.java (86%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/{ => executor}/param/JobRuntimeService.java (93%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/{ => executor}/param/ShardingContext.java (95%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/{ => executor}/type/ClassedJobItemExecutor.java (90%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/{ => executor}/type/TypedJobItemExecutor.java (89%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/listener/ElasticJobListener.java (91%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param}/ShardingContexts.java (94%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener => api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param}/ShardingContextsTest.java (90%) rename ecosystem/executor/dataflow/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor} (100%) rename ecosystem/executor/http/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor} (100%) rename ecosystem/executor/script/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor} (100%) rename ecosystem/executor/simple/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor} (100%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor} (100%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor} (100%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener} (100%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor} (100%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor} (100%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener} (100%) rename spring/namespace/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener} (100%) rename test/e2e/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor} (100%) rename test/e2e/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener => org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener} (100%) diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/JobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/JobItemExecutor.java similarity index 86% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/JobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/JobItemExecutor.java index 5e1ead8f1a..e78c97aeb4 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/JobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/JobItemExecutor.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi; +package org.apache.shardingsphere.elasticjob.spi.executor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; /** * Job item executor. diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/JobRuntimeService.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/JobRuntimeService.java similarity index 93% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/JobRuntimeService.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/JobRuntimeService.java index a09ddd8c95..35538aae5f 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/JobRuntimeService.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/JobRuntimeService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.param; +package org.apache.shardingsphere.elasticjob.spi.executor.param; /** * Job runtime service. diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/ShardingContext.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/ShardingContext.java similarity index 95% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/ShardingContext.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/ShardingContext.java index fe89ac0161..a3f94167cd 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/param/ShardingContext.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/ShardingContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.param; +package org.apache.shardingsphere.elasticjob.spi.executor.param; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/ClassedJobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/ClassedJobItemExecutor.java similarity index 90% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/ClassedJobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/ClassedJobItemExecutor.java index 643348685b..319618ecbc 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/ClassedJobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/ClassedJobItemExecutor.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.type; +package org.apache.shardingsphere.elasticjob.spi.executor.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/TypedJobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/TypedJobItemExecutor.java similarity index 89% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/TypedJobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/TypedJobItemExecutor.java index c5c816c035..1d2c278fd1 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/type/TypedJobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/TypedJobItemExecutor.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.type; +package org.apache.shardingsphere.elasticjob.spi.executor.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ElasticJobListener.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/ElasticJobListener.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ElasticJobListener.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/ElasticJobListener.java index e92d72e2d9..6d4cec3428 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ElasticJobListener.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/ElasticJobListener.java @@ -15,8 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.infra.listener; +package org.apache.shardingsphere.elasticjob.spi.listener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContexts.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContexts.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java index aef13ca19d..aa9604868b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContexts.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.infra.listener; +package org.apache.shardingsphere.elasticjob.spi.listener.param; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import java.io.Serializable; import java.util.Map; diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java index febffd8d50..cd2f29ebd3 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.annotation.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; public interface CustomJob extends ElasticJob { diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java index 5e18ef55c1..340a0fccd6 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.annotation.SimpleTracingConfigurationFactory; import org.apache.shardingsphere.elasticjob.annotation.job.CustomJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; @ElasticJobConfiguration( cron = "0/5 * * * * ?", diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContextsTest.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java similarity index 90% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContextsTest.java rename to api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java index b906c08f18..f4d32bb326 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/listener/ShardingContextsTest.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.infra.listener; +package org.apache.shardingsphere.elasticjob.spi.listener.param; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.junit.jupiter.api.Test; import java.util.HashMap; @@ -41,7 +41,7 @@ void assertCreateShardingContext() { } private ShardingContexts createShardingContexts() { - Map map = new HashMap<>(2, 1); + Map map = new HashMap<>(2, 1F); map.put(0, "A"); map.put(1, "B"); return new ShardingContexts("fake_task_id", "test_job", 2, "", map); diff --git a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java index 96745d8b86..f3b1d3806e 100644 --- a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java +++ b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.dataflow.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; import java.util.List; diff --git a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java index e639895148..a8009ead2f 100644 --- a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java +++ b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.dataflow.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import java.util.List; diff --git a/ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor rename to ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java index a9981957b7..439efa5d91 100644 --- a/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java +++ b/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java @@ -18,10 +18,10 @@ package org.apache.shardingsphere.elasticjob.dataflow.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java index 94aaa551b9..9d913920cb 100644 --- a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java +++ b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java @@ -21,9 +21,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.http.pojo.HttpParam; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; diff --git a/ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor b/ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor rename to ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor diff --git a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 1d52619961..346cf15439 100644 --- a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -19,8 +19,8 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.http.executor.fixture.InternalController; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; diff --git a/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java index ded2ddefcf..cd6177dde6 100644 --- a/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java +++ b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java @@ -22,9 +22,9 @@ import org.apache.commons.exec.DefaultExecutor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; diff --git a/ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor b/ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor rename to ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor diff --git a/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index 033a84b277..febe4f5613 100644 --- a/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -20,8 +20,8 @@ import org.apache.commons.exec.OS; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor; diff --git a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java index 5c9b087a2c..7ff8134aa9 100644 --- a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java +++ b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.simple.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; /** diff --git a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java index 3c8ed6cd9b..de6005ca18 100644 --- a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java +++ b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; /** * Simple job. diff --git a/ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor rename to ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java index 6520ddd117..dba7f87ec0 100644 --- a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java +++ b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.simple.job.FooSimpleJob; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java index 8088292d47..e314e7dd14 100644 --- a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java +++ b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; @Getter public final class FooSimpleJob implements SimpleJob { diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java index 4eb6b7db31..08f20d1876 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.dataflow; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java index ad37185375..e6c01aa5eb 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.dataflow; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java index bb983273cd..3bc494e706 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; public final class JavaOccurErrorJob implements SimpleJob { diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java index 481c4b9e60..5310c7d6e9 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java index ef23d4dc7b..bf2ccaae80 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java index 830f0b3f27..c0eee45820 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.entity.Foo; import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java index f6b7961a29..a261595d47 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java index eeb3b25f20..f6b31f4455 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java index 33b5c65baf..f11efc9344 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java index aedb529114..13e6a8bc5a 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.example.entity.Foo; import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java index 121080acd5..26b3234794 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java @@ -22,14 +22,14 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerReloader; -import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.item.JobItemExecutorFactory; -import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.ExecutorServiceReloader; import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.ExceptionUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent.ExecutionSource; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java index 3f30a58c0d..18c0b1cfd2 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java @@ -21,8 +21,8 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; @@ -30,7 +30,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java index 47d965c37f..426e9b41cc 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; /** * Job runtime service implementation. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java index 9f362441f8..3b6fd04c5b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java @@ -20,8 +20,8 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.JobItemExecutor; -import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java index a622328aac..c1aa4ef8db 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.AbstractListenerManager; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java index 97a957e4d4..660e335172 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeService.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java index 719cf499cd..879de0894c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/listener/ListenerManager.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.RescheduleListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.election.ElectionListenerManager; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index b552bdf184..82b03f3a71 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.JobFacade; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java index d1d8843975..a7edc54a52 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/setup/SetUpFacade.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.setup; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.election.LeaderService; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerManager; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java index 18075c0625..02aa0fd01d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextService.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java index 1cb8799dc3..9d1d4eab70 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionService.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java index 1e37302849..d07d01a5c6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java @@ -21,8 +21,8 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; import java.util.Set; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java index 5763e0a097..c85acd44d4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java @@ -20,7 +20,7 @@ import com.google.common.collect.Sets; import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java index cc85f1d8df..e23e83801c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; public final class TestDistributeOnceElasticJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java index 07a07b03ec..7db6489cd5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; @RequiredArgsConstructor public final class TestElasticJobListener implements ElasticJobListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java index 507d0e1f20..fbe294734f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; public final class ClassedFooJobExecutor implements ClassedJobItemExecutor { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java index 50a69c9fe7..52fbcd893d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java @@ -19,9 +19,9 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; public final class TypedFooJobExecutor implements TypedJobItemExecutor { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java index c21446e3b9..2a94673197 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java index e2d02c3c53..f114912941 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; public interface FooJob extends ElasticJob { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java index 00ad0cc887..4959da4691 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java @@ -20,10 +20,10 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java index 857df35c59..81b6816e60 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java @@ -20,7 +20,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java index 9e4eb96a65..29aaca9e38 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeListenerManagerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java index f2289a5e7a..78787d7ded 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/guarantee/GuaranteeServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.guarantee; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java index d0571998e0..8ca057eec5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionContextServiceTest.java @@ -19,7 +19,7 @@ import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java index f7eb3d7274..74cf8fdfd3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ExecutionServiceTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.sharding; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java index 8a7032dae6..c3ea0c5445 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; public final class CustomClassedJobExecutor implements ClassedJobItemExecutor { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java index 35a0c3fe8b..43f7d249cc 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java @@ -20,9 +20,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; @Slf4j public final class PrintJobExecutor implements TypedJobItemExecutor { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java index d204129f1a..b3015cca8d 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; public interface CustomJob extends ElasticJob { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java index 1b5ac1ef44..7992abc35a 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; import org.springframework.transaction.annotation.Transactional; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java index abc8712270..ebda24390b 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; import org.apache.shardingsphere.elasticjob.spring.boot.job.repository.BarRepository; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java index 13c318edb6..efe98402bc 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/LogElasticJobListener.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; /** * Log elastic job listener. diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java index 665f92614f..71701b371f 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/listener/NoopElasticJobListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; /** * No operation elastic job listener. diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.TypedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener diff --git a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java index 32c8b0ab6e..1b100c73b0 100644 --- a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java +++ b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.core.util; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; public class TargetJob implements ElasticJob { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java index 13fdb6fddc..dd2345f313 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import java.util.Collections; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java index dd96a6920f..a2adbe1331 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; public class FooSimpleElasticJob implements SimpleJob { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java index fbcc8e0008..eb17cc2746 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java @@ -20,7 +20,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; @Getter diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java index 3456ba7eaa..2dfa998190 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java index d2f9889c22..d65ddf5770 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java index 33ba3e5e77..c5006a9245 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleCglibListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java index 93cd094514..ff098a2694 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleJdkDynamicProxyListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java index fc083672bd..c150327d07 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java index b1869d41f1..4e75613ebc 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener b/spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener similarity index 100% rename from spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener rename to spring/namespace/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java index c6bade33b0..babcc7c605 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; @ElasticJobConfiguration( jobName = "AnnotationSimpleJob", diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java index aa9d890d71..0bd7def12d 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java @@ -20,7 +20,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; @ElasticJobConfiguration(jobName = "AnnotationUnShardingJob", description = "desc", shardingTotalCount = 1) @Getter diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java index 5b6319a4e6..ef57329956 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJob; public final class E2EFixtureJobExecutor implements ClassedJobItemExecutor { diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java index 7be1ba4e40..9b2aec429c 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; public interface E2EFixtureJob extends ElasticJob { diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java index d86b84b304..8bfe65c7f8 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java index 0df40380b2..35c46c9eee 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/DistributeOnceE2EFixtureJobListener.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; public class DistributeOnceE2EFixtureJobListener extends AbstractDistributeOnceElasticJobListener { diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java index 0ded3ad091..832067cd08 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/listener/E2EFixtureJobListener.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.listener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.infra.listener.ShardingContexts; +import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; public class E2EFixtureJobListener implements ElasticJobListener { diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor similarity index 100% rename from test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.type.ClassedJobItemExecutor rename to test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener similarity index 100% rename from test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.listener.ElasticJobListener rename to test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener From 922b043869022b7e07fb61ba093e278a82615e50 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Mon, 30 Oct 2023 23:51:20 +0800 Subject: [PATCH 134/178] Move TimeService to infra package (#2344) --- .../elasticjob/kernel/{internal => infra}/time/TimeService.java | 2 +- .../elasticjob/kernel/internal/config/ConfigurationService.java | 2 +- .../listener/AbstractDistributeOnceElasticJobListener.java | 2 +- .../api/listener/DistributeOnceElasticJobListenerTest.java | 2 +- .../kernel/{internal => infra}/time/TimeServiceTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => infra}/time/TimeService.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => infra}/time/TimeServiceTest.java (94%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/time/TimeService.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/time/TimeService.java index 1d08849a6f..f7aaec7804 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/time/TimeService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.time; +package org.apache.shardingsphere.elasticjob.kernel.infra.time; /** * Time service. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java index 971f6ad8cd..5cbc03474e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/ConfigurationService.java @@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; +import org.apache.shardingsphere.elasticjob.kernel.infra.time.TimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java index d07d01a5c6..09e203093a 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java @@ -19,7 +19,7 @@ import lombok.Setter; import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; +import org.apache.shardingsphere.elasticjob.kernel.infra.time.TimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java index c85acd44d4..1ac14c6dd7 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.api.listener; import com.google.common.collect.Sets; -import org.apache.shardingsphere.elasticjob.kernel.internal.time.TimeService; +import org.apache.shardingsphere.elasticjob.kernel.infra.time.TimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/time/TimeServiceTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/time/TimeServiceTest.java index db043dbf12..147b72be3b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/time/TimeServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/time/TimeServiceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.time; +package org.apache.shardingsphere.elasticjob.kernel.infra.time; import org.junit.jupiter.api.Test; From dfaa33dd9c5f7c92a0b3ecf40773e2bb5b2b5700 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 00:02:13 +0800 Subject: [PATCH 135/178] Move ExecutionType to executor package --- .../elasticjob/tracing/rdb/storage/RDBJobEventStorage.java | 2 +- .../tracing/rdb/listener/RDBTracingListenerTest.java | 2 +- .../tracing/rdb/storage/RDBJobEventStorageTest.java | 2 +- .../elasticjob/kernel/internal/context/TaskContext.java | 2 +- .../constant => internal/executor}/ExecutionType.java | 2 +- .../kernel/internal/tracing/event/JobStatusTraceEvent.java | 2 +- .../elasticjob/kernel/internal/context/TaskContextTest.java | 2 +- .../kernel/internal/context/fixture/TaskNode.java | 2 +- .../elasticjob/kernel/internal/executor/JobFacadeTest.java | 4 ++-- .../listener/DistributeOnceElasticJobListenerTest.java | 6 +++--- .../listener/fixture/ElasticJobListenerCaller.java | 2 +- .../fixture/TestDistributeOnceElasticJobListener.java | 2 +- .../{api => }/listener/fixture/TestElasticJobListener.java | 2 +- ...hardingsphere.elasticjob.spi.listener.ElasticJobListener | 4 ++-- 14 files changed, 18 insertions(+), 18 deletions(-) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{infra/constant => internal/executor}/ExecutionType.java (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{api => }/listener/DistributeOnceElasticJobListenerTest.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{api => }/listener/fixture/ElasticJobListenerCaller.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{api => }/listener/fixture/TestDistributeOnceElasticJobListener.java (95%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{api => }/listener/fixture/TestElasticJobListener.java (96%) diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 0d4873e6bb..28f9dc573c 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 742a935f18..85696bc09a 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index 937b507a2c..b4a64aa3cd 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java index 2a4f8ad652..a0b92ecaa1 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java @@ -24,7 +24,7 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; import java.util.Collections; import java.util.List; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/constant/ExecutionType.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ExecutionType.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/constant/ExecutionType.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ExecutionType.java index 5149b9786a..26d5247891 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/constant/ExecutionType.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ExecutionType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.infra.constant; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor; /** * Execution type. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java index 0447deadae..25361bcf72 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java @@ -21,7 +21,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; import java.util.Date; import java.util.UUID; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java index 2f94916b00..7606517642 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context; -import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode; import org.hamcrest.CoreMatchers; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java index 44e8fc50de..e803b112f9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture; import lombok.Builder; -import org.apache.shardingsphere.elasticjob.kernel.infra.constant.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; @Builder public final class TaskNode { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java index 81b6816e60..b008da1168 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java @@ -21,8 +21,8 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.ElasticJobListenerCaller; +import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/DistributeOnceElasticJobListenerTest.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/DistributeOnceElasticJobListenerTest.java index 1ac14c6dd7..9b6ceee39c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/DistributeOnceElasticJobListenerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/DistributeOnceElasticJobListenerTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.listener; +package org.apache.shardingsphere.elasticjob.kernel.listener; import com.google.common.collect.Sets; import org.apache.shardingsphere.elasticjob.kernel.infra.time.TimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.ElasticJobListenerCaller; -import org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.ElasticJobListenerCaller; +import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestDistributeOnceElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.guarantee.GuaranteeService; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/ElasticJobListenerCaller.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/ElasticJobListenerCaller.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/ElasticJobListenerCaller.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/ElasticJobListenerCaller.java index 021e163b83..e5046ae92c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/ElasticJobListenerCaller.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/ElasticJobListenerCaller.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.kernel.listener.fixture; public interface ElasticJobListenerCaller { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/TestDistributeOnceElasticJobListener.java similarity index 95% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/TestDistributeOnceElasticJobListener.java index e23e83801c..b688a7c92f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestDistributeOnceElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/TestDistributeOnceElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.kernel.listener.fixture; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/TestElasticJobListener.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/TestElasticJobListener.java index 7db6489cd5..60436ff4dc 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/api/listener/fixture/TestElasticJobListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/listener/fixture/TestElasticJobListener.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture; +package org.apache.shardingsphere.elasticjob.kernel.listener.fixture; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener index ec26735634..2b0c32ce7c 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestDistributeOnceElasticJobListener -org.apache.shardingsphere.elasticjob.kernel.api.listener.fixture.TestElasticJobListener +org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestDistributeOnceElasticJobListener +org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestElasticJobListener From 3cfd9209b9eb675d33419ede98f0663375492354 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 00:28:57 +0800 Subject: [PATCH 136/178] Move util to infra package --- .../elasticjob/kernel/{internal => infra}/util/BlockUtils.java | 2 +- .../kernel/{internal => infra}/util/SensitiveInfoUtils.java | 2 +- .../elasticjob/kernel/internal/election/LeaderService.java | 2 +- .../elasticjob/kernel/internal/server/ServerService.java | 2 +- .../elasticjob/kernel/internal/sharding/ShardingService.java | 2 +- .../elasticjob/kernel/internal/snapshot/SnapshotService.java | 2 +- .../listener/AbstractDistributeOnceElasticJobListener.java | 2 +- .../kernel/{internal => infra}/util/SensitiveInfoUtilsTest.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => infra}/util/BlockUtils.java (95%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => infra}/util/SensitiveInfoUtils.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => infra}/util/SensitiveInfoUtilsTest.java (96%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/BlockUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/BlockUtils.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/BlockUtils.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/BlockUtils.java index 43c01e2090..ba5cf6f620 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/BlockUtils.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/BlockUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.util; +package org.apache.shardingsphere.elasticjob.kernel.infra.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/SensitiveInfoUtils.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/SensitiveInfoUtils.java index e48b56938f..8ba645dc34 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtils.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/SensitiveInfoUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.util; +package org.apache.shardingsphere.elasticjob.kernel.infra.util; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java index ed94156856..8c4547d55a 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/election/LeaderService.java @@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; import org.apache.shardingsphere.elasticjob.reg.base.LeaderExecutionCallback; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.util.BlockUtils; /** * Leader service. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java index 1a16d34346..3810bb5105 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/server/ServerService.java @@ -19,7 +19,7 @@ import com.google.common.base.Strings; import org.apache.commons.lang3.StringUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.util.BlockUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode; import org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobRegistry; import org.apache.shardingsphere.elasticjob.kernel.internal.storage.JobNodeStorage; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java index 0ef230969e..61f596e2ae 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/sharding/ShardingService.java @@ -19,7 +19,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.util.BlockUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java index fdfe329514..136e87e40f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/snapshot/SnapshotService.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.curator.framework.recipes.cache.ChildData; import org.apache.curator.framework.recipes.cache.CuratorCache; -import org.apache.shardingsphere.elasticjob.kernel.internal.util.SensitiveInfoUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.util.SensitiveInfoUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java index 09e203093a..7aee543ae7 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/listener/AbstractDistributeOnceElasticJobListener.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.listener; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.internal.util.BlockUtils; +import org.apache.shardingsphere.elasticjob.kernel.infra.util.BlockUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.time.TimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtilsTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/SensitiveInfoUtilsTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtilsTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/SensitiveInfoUtilsTest.java index e21dae37d9..9bf01131d4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/util/SensitiveInfoUtilsTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/infra/util/SensitiveInfoUtilsTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.util; +package org.apache.shardingsphere.elasticjob.kernel.infra.util; import org.junit.jupiter.api.Test; From dc0b75fc933078f6d292736d3c125ef9f101345a Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 00:31:40 +0800 Subject: [PATCH 137/178] Refactor error-handler --- .../error-handler/{type => }/dingtalk/pom.xml | 2 +- .../dingtalk/DingtalkJobErrorHandler.java | 0 ...alkJobErrorHandlerPropertiesValidator.java | 0 .../dingtalk/DingtalkPropertiesConstants.java | 0 ...nal.executor.error.handler.JobErrorHandler | 0 ...handler.JobErrorHandlerPropertiesValidator | 0 ...obErrorHandlerPropertiesValidatorTest.java | 0 .../dingtalk/DingtalkJobErrorHandlerTest.java | 0 .../fixture/DingtalkInternalController.java | 0 .../src/test/resources/logback-test.xml | 0 .../error-handler/{type => }/email/pom.xml | 2 +- .../handler/email/EmailJobErrorHandler.java | 0 ...ailJobErrorHandlerPropertiesValidator.java | 0 .../email/EmailPropertiesConstants.java | 0 ...nal.executor.error.handler.JobErrorHandler | 0 ...handler.JobErrorHandlerPropertiesValidator | 0 ...obErrorHandlerPropertiesValidatorTest.java | 0 .../email/EmailJobErrorHandlerTest.java | 0 .../email/src/test/resources/logback-test.xml | 0 ecosystem/error-handler/pom.xml | 4 ++- ecosystem/error-handler/type/pom.xml | 34 ------------------- .../error-handler/{type => }/wechat/pom.xml | 2 +- .../handler/wechat/WechatJobErrorHandler.java | 0 ...hatJobErrorHandlerPropertiesValidator.java | 0 .../wechat/WechatPropertiesConstants.java | 0 ...nal.executor.error.handler.JobErrorHandler | 0 ...handler.JobErrorHandlerPropertiesValidator | 0 ...obErrorHandlerPropertiesValidatorTest.java | 0 .../wechat/WechatJobErrorHandlerTest.java | 0 .../fixture/WechatInternalController.java | 0 .../src/test/resources/logback-test.xml | 0 31 files changed, 6 insertions(+), 38 deletions(-) rename ecosystem/error-handler/{type => }/dingtalk/pom.xml (97%) rename ecosystem/error-handler/{type => }/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java (100%) rename ecosystem/error-handler/{type => }/dingtalk/src/test/resources/logback-test.xml (100%) rename ecosystem/error-handler/{type => }/email/pom.xml (96%) rename ecosystem/error-handler/{type => }/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java (100%) rename ecosystem/error-handler/{type => }/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java (100%) rename ecosystem/error-handler/{type => }/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java (100%) rename ecosystem/error-handler/{type => }/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler (100%) rename ecosystem/error-handler/{type => }/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator (100%) rename ecosystem/error-handler/{type => }/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java (100%) rename ecosystem/error-handler/{type => }/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java (100%) rename ecosystem/error-handler/{type => }/email/src/test/resources/logback-test.xml (100%) delete mode 100644 ecosystem/error-handler/type/pom.xml rename ecosystem/error-handler/{type => }/wechat/pom.xml (97%) rename ecosystem/error-handler/{type => }/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java (100%) rename ecosystem/error-handler/{type => }/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java (100%) rename ecosystem/error-handler/{type => }/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java (100%) rename ecosystem/error-handler/{type => }/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler (100%) rename ecosystem/error-handler/{type => }/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator (100%) rename ecosystem/error-handler/{type => }/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java (100%) rename ecosystem/error-handler/{type => }/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java (100%) rename ecosystem/error-handler/{type => }/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java (100%) rename ecosystem/error-handler/{type => }/wechat/src/test/resources/logback-test.xml (100%) diff --git a/ecosystem/error-handler/type/dingtalk/pom.xml b/ecosystem/error-handler/dingtalk/pom.xml similarity index 97% rename from ecosystem/error-handler/type/dingtalk/pom.xml rename to ecosystem/error-handler/dingtalk/pom.xml index 6c4e413f6e..ab841db6cd 100644 --- a/ecosystem/error-handler/type/dingtalk/pom.xml +++ b/ecosystem/error-handler/dingtalk/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-error-handler-type + elasticjob-error-handler 3.1.0-SNAPSHOT elasticjob-error-handler-dingtalk diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java rename to ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java rename to ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java diff --git a/ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java rename to ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkPropertiesConstants.java diff --git a/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java rename to ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java rename to ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java diff --git a/ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java rename to ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/fixture/DingtalkInternalController.java diff --git a/ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml b/ecosystem/error-handler/dingtalk/src/test/resources/logback-test.xml similarity index 100% rename from ecosystem/error-handler/type/dingtalk/src/test/resources/logback-test.xml rename to ecosystem/error-handler/dingtalk/src/test/resources/logback-test.xml diff --git a/ecosystem/error-handler/type/email/pom.xml b/ecosystem/error-handler/email/pom.xml similarity index 96% rename from ecosystem/error-handler/type/email/pom.xml rename to ecosystem/error-handler/email/pom.xml index 868098c5cd..5a50a435b1 100644 --- a/ecosystem/error-handler/type/email/pom.xml +++ b/ecosystem/error-handler/email/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-error-handler-type + elasticjob-error-handler 3.1.0-SNAPSHOT elasticjob-error-handler-email diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java similarity index 100% rename from ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java rename to ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java similarity index 100% rename from ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java rename to ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java diff --git a/ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java similarity index 100% rename from ecosystem/error-handler/type/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java rename to ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailPropertiesConstants.java diff --git a/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/type/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java similarity index 100% rename from ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java rename to ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java diff --git a/ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java similarity index 100% rename from ecosystem/error-handler/type/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java rename to ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java diff --git a/ecosystem/error-handler/type/email/src/test/resources/logback-test.xml b/ecosystem/error-handler/email/src/test/resources/logback-test.xml similarity index 100% rename from ecosystem/error-handler/type/email/src/test/resources/logback-test.xml rename to ecosystem/error-handler/email/src/test/resources/logback-test.xml diff --git a/ecosystem/error-handler/pom.xml b/ecosystem/error-handler/pom.xml index 68eacea4e6..976670cf0c 100644 --- a/ecosystem/error-handler/pom.xml +++ b/ecosystem/error-handler/pom.xml @@ -27,6 +27,8 @@ pom - type + email + wechat + dingtalk diff --git a/ecosystem/error-handler/type/pom.xml b/ecosystem/error-handler/type/pom.xml deleted file mode 100644 index 5a66cdd343..0000000000 --- a/ecosystem/error-handler/type/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - 4.0.0 - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler - 3.1.0-SNAPSHOT - - elasticjob-error-handler-type - pom - - - email - wechat - dingtalk - - diff --git a/ecosystem/error-handler/type/wechat/pom.xml b/ecosystem/error-handler/wechat/pom.xml similarity index 97% rename from ecosystem/error-handler/type/wechat/pom.xml rename to ecosystem/error-handler/wechat/pom.xml index 83fb1ac821..3a03ad2bec 100644 --- a/ecosystem/error-handler/type/wechat/pom.xml +++ b/ecosystem/error-handler/wechat/pom.xml @@ -20,7 +20,7 @@ 4.0.0 org.apache.shardingsphere.elasticjob - elasticjob-error-handler-type + elasticjob-error-handler 3.1.0-SNAPSHOT elasticjob-error-handler-wechat diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java similarity index 100% rename from ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java rename to ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java similarity index 100% rename from ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java rename to ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java diff --git a/ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java similarity index 100% rename from ecosystem/error-handler/type/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java rename to ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatPropertiesConstants.java diff --git a/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/type/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java similarity index 100% rename from ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java rename to ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java similarity index 100% rename from ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java rename to ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java diff --git a/ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java similarity index 100% rename from ecosystem/error-handler/type/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java rename to ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/fixture/WechatInternalController.java diff --git a/ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml b/ecosystem/error-handler/wechat/src/test/resources/logback-test.xml similarity index 100% rename from ecosystem/error-handler/type/wechat/src/test/resources/logback-test.xml rename to ecosystem/error-handler/wechat/src/test/resources/logback-test.xml From 16e55486f993c68af9b09acae1b0bb1039b74dc7 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 00:35:20 +0800 Subject: [PATCH 138/178] Refactor error-handler --- bootstrap/src/test/resources/logback-test.xml | 2 +- .../handler/{general => type}/IgnoreJobErrorHandler.java | 2 +- .../error/handler/{general => type}/LogJobErrorHandler.java | 2 +- .../handler/{general => type}/ThrowJobErrorHandler.java | 2 +- ...b.kernel.internal.executor.error.handler.JobErrorHandler | 6 +++--- .../executor/error/handler/JobErrorHandlerReloaderTest.java | 4 ++-- .../{general => type}/IgnoreJobErrorHandlerTest.java | 2 +- .../handler/{general => type}/LogJobErrorHandlerTest.java | 2 +- .../handler/{general => type}/ThrowJobErrorHandlerTest.java | 2 +- kernel/src/test/resources/logback-test.xml | 2 +- spring/core/src/test/resources/META-INF/logback-test.xml | 2 +- spring/namespace/src/test/resources/logback-test.xml | 2 +- test/e2e/src/test/resources/logback-test.xml | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/{general => type}/IgnoreJobErrorHandler.java (97%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/{general => type}/LogJobErrorHandler.java (98%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/{general => type}/ThrowJobErrorHandler.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/{general => type}/IgnoreJobErrorHandlerTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/{general => type}/LogJobErrorHandlerTest.java (98%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/{general => type}/ThrowJobErrorHandlerTest.java (98%) diff --git a/bootstrap/src/test/resources/logback-test.xml b/bootstrap/src/test/resources/logback-test.xml index 0cf45471ae..042c2155d6 100644 --- a/bootstrap/src/test/resources/logback-test.xml +++ b/bootstrap/src/test/resources/logback-test.xml @@ -42,7 +42,7 @@ - + diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandler.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandler.java index f36632b7d3..0cd0b99914 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandler.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandler.java index 5f07bb8eb7..df811ac6d9 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandler.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandler.java index 008604f82b..6ef61f2d6c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; diff --git a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler index 9b191fc16d..a893de8dde 100644 --- a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler +++ b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler @@ -15,6 +15,6 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.LogJobErrorHandler -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.IgnoreJobErrorHandler -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.ThrowJobErrorHandler +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.LogJobErrorHandler +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.IgnoreJobErrorHandler +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.ThrowJobErrorHandler diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java index c9a4c9a397..78e1c27be9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.IgnoreJobErrorHandler; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general.LogJobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.IgnoreJobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.LogJobErrorHandler; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandlerTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandlerTest.java index 18b8dd6e93..11bc0a14ad 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/IgnoreJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandlerTest.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandlerTest.java index ebe37f6caa..b77acfc8a5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/LogJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandlerTest.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandlerTest.java index 3b7636a1eb..e120750fa5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/general/ThrowJobErrorHandlerTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.general; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index 0cf45471ae..042c2155d6 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -42,7 +42,7 @@ - + diff --git a/spring/core/src/test/resources/META-INF/logback-test.xml b/spring/core/src/test/resources/META-INF/logback-test.xml index cb19e66db2..722e4b46be 100644 --- a/spring/core/src/test/resources/META-INF/logback-test.xml +++ b/spring/core/src/test/resources/META-INF/logback-test.xml @@ -38,5 +38,5 @@ - + diff --git a/spring/namespace/src/test/resources/logback-test.xml b/spring/namespace/src/test/resources/logback-test.xml index cb19e66db2..722e4b46be 100644 --- a/spring/namespace/src/test/resources/logback-test.xml +++ b/spring/namespace/src/test/resources/logback-test.xml @@ -38,5 +38,5 @@ - + diff --git a/test/e2e/src/test/resources/logback-test.xml b/test/e2e/src/test/resources/logback-test.xml index 0cf45471ae..042c2155d6 100644 --- a/test/e2e/src/test/resources/logback-test.xml +++ b/test/e2e/src/test/resources/logback-test.xml @@ -42,7 +42,7 @@ - + From f034a23e4c4907c9400b733501ede69093e1d9d6 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 00:38:43 +0800 Subject: [PATCH 139/178] Move package of JobFacade --- .../kernel/internal/executor/ElasticJobExecutor.java | 1 + .../internal/executor/{ => facade}/JobFacade.java | 2 +- .../{ => facade}/JobJobRuntimeServiceImpl.java | 2 +- .../kernel/internal/schedule/JobScheduler.java | 2 +- .../internal/executor/ElasticJobExecutorTest.java | 1 + .../internal/executor/{ => facade}/JobFacadeTest.java | 10 +++++----- 6 files changed, 10 insertions(+), 8 deletions(-) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/{ => facade}/JobFacade.java (99%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/{ => facade}/JobJobRuntimeServiceImpl.java (98%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/{ => facade}/JobFacadeTest.java (99%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java index 26b3234794..0d0366556a 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java @@ -22,6 +22,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerReloader; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade.JobFacade; import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.item.JobItemExecutorFactory; import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacade.java similarity index 99% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacade.java index 18c0b1cfd2..5721a1d574 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacade.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobJobRuntimeServiceImpl.java similarity index 98% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobJobRuntimeServiceImpl.java index 426e9b41cc..80446a66f1 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobJobRuntimeServiceImpl.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobJobRuntimeServiceImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 82b03f3a71..9d6a1f1e01 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -25,7 +25,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ElasticJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.JobFacade; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade.JobFacade; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java index 4959da4691..adc5fc8975 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java @@ -20,6 +20,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade.JobFacade; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacadeTest.java similarity index 99% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacadeTest.java index b008da1168..76e93a362c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/JobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacadeTest.java @@ -15,21 +15,21 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor; +package org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.ElasticJobListenerCaller; -import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService; import org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.ElasticJobListenerCaller; +import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestElasticJobListener; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; From 49d58dd98bb2ccc230498313095f3604225fb226 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 00:55:03 +0800 Subject: [PATCH 140/178] Add elasticjob-error-handler-normal module --- bootstrap/pom.xml | 5 +++ ecosystem/error-handler/normal/pom.xml | 35 +++++++++++++++++++ .../normal}/IgnoreJobErrorHandler.java | 2 +- .../handler/normal}/LogJobErrorHandler.java | 2 +- .../handler/normal}/ThrowJobErrorHandler.java | 4 +-- ...nal.executor.error.handler.JobErrorHandler | 20 +++++++++++ .../normal}/IgnoreJobErrorHandlerTest.java | 2 +- .../normal}/LogJobErrorHandlerTest.java | 2 +- .../normal}/ThrowJobErrorHandlerTest.java | 4 +-- .../src/test/resources/logback-test.xml | 25 +++++++++++++ ecosystem/error-handler/pom.xml | 1 + .../executor/ElasticJobExecutorTest.java | 2 +- .../handler/JobErrorHandlerReloaderTest.java | 23 ++++++------ .../fixture/BarJobErrorHandlerFixture.java | 32 +++++++++++++++++ .../fixture/FooJobErrorHandlerFixture.java | 34 ++++++++++++++++++ ...nal.executor.error.handler.JobErrorHandler | 5 ++- 16 files changed, 174 insertions(+), 24 deletions(-) create mode 100644 ecosystem/error-handler/normal/pom.xml rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type => ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal}/IgnoreJobErrorHandler.java (93%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type => ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal}/LogJobErrorHandler.java (94%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type => ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal}/ThrowJobErrorHandler.java (93%) create mode 100644 ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type => ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal}/IgnoreJobErrorHandlerTest.java (93%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type => ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal}/LogJobErrorHandlerTest.java (96%) rename {kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type => ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal}/ThrowJobErrorHandlerTest.java (94%) create mode 100644 ecosystem/error-handler/normal/src/test/resources/logback-test.xml create mode 100644 kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/BarJobErrorHandlerFixture.java create mode 100644 kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/FooJobErrorHandlerFixture.java rename kernel/src/{main => test}/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler (83%) diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml index 9a6c1ef4e0..75ae790343 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -52,6 +52,11 @@ elasticjob-http-executor ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-error-handler-normal + ${project.parent.version} + org.apache.shardingsphere.elasticjob elasticjob-tracing-rdb diff --git a/ecosystem/error-handler/normal/pom.xml b/ecosystem/error-handler/normal/pom.xml new file mode 100644 index 0000000000..ee4ffbd27b --- /dev/null +++ b/ecosystem/error-handler/normal/pom.xml @@ -0,0 +1,35 @@ + + + + + 4.0.0 + + org.apache.shardingsphere.elasticjob + elasticjob-error-handler + 3.1.0-SNAPSHOT + + elasticjob-error-handler-normal + + + + org.apache.shardingsphere.elasticjob + elasticjob-kernel + ${project.parent.version} + + + diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandler.java rename to ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java index 0cd0b99914..39fd04d9b4 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; +package org.apache.shardingsphere.elasticjob.error.handler.normal; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandler.java rename to ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java index df811ac6d9..72fddca8aa 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; +package org.apache.shardingsphere.elasticjob.error.handler.normal; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandler.java rename to ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java index 6ef61f2d6c..a9381b1c2b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; +package org.apache.shardingsphere.elasticjob.error.handler.normal; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; /** * Job error handler for throw exception. diff --git a/ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler new file mode 100644 index 0000000000..c63ca5bed5 --- /dev/null +++ b/ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler @@ -0,0 +1,20 @@ +# +# 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. +# + +org.apache.shardingsphere.elasticjob.error.handler.normal.LogJobErrorHandler +org.apache.shardingsphere.elasticjob.error.handler.normal.IgnoreJobErrorHandler +org.apache.shardingsphere.elasticjob.error.handler.normal.ThrowJobErrorHandler diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandlerTest.java rename to ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java index 11bc0a14ad..fc7570ab7d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/IgnoreJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; +package org.apache.shardingsphere.elasticjob.error.handler.normal; import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandlerTest.java rename to ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java index b77acfc8a5..02220d1a77 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/LogJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; +package org.apache.shardingsphere.elasticjob.error.handler.normal; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java similarity index 94% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandlerTest.java rename to ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java index e120750fa5..3a7cc95a60 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/type/ThrowJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type; +package org.apache.shardingsphere.elasticjob.error.handler.normal; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/normal/src/test/resources/logback-test.xml b/ecosystem/error-handler/normal/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..df652e0168 --- /dev/null +++ b/ecosystem/error-handler/normal/src/test/resources/logback-test.xml @@ -0,0 +1,25 @@ + + + + + + + + + + diff --git a/ecosystem/error-handler/pom.xml b/ecosystem/error-handler/pom.xml index 976670cf0c..05449536d7 100644 --- a/ecosystem/error-handler/pom.xml +++ b/ecosystem/error-handler/pom.xml @@ -27,6 +27,7 @@ pom + normal email wechat dingtalk diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java index adc5fc8975..eaf94d4d07 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java @@ -80,7 +80,7 @@ void setUp() { private JobConfiguration createJobConfiguration() { return JobConfiguration.newBuilder("test_job", 3) - .cron("0/1 * * * * ?").shardingItemParameters("0=A,1=B,2=C").jobParameter("param").failover(true).misfire(false).jobErrorHandlerType("THROW").description("desc").build(); + .cron("0/1 * * * * ?").shardingItemParameters("0=A,1=B,2=C").jobParameter("param").failover(true).misfire(false).jobErrorHandlerType("FOO").description("desc").build(); } @Test diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java index 78e1c27be9..7f951531c1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.IgnoreJobErrorHandler; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.LogJobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.BarJobErrorHandlerFixture; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.FooJobErrorHandlerFixture; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -43,35 +43,34 @@ class JobErrorHandlerReloaderTest { @Test void assertInitialize() { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("FOO").build(); try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { JobErrorHandler actual = jobErrorHandlerReloader.getJobErrorHandler(); assertNotNull(actual); - assertThat(actual.getType(), is("IGNORE")); - assertTrue(actual instanceof IgnoreJobErrorHandler); + assertThat(actual.getType(), is("FOO")); + assertTrue(actual instanceof FooJobErrorHandlerFixture); } } @Test void assertReload() { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("FOO").build(); try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { when(jobErrorHandler.getType()).thenReturn("mock"); ReflectionUtils.setFieldValue(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); ReflectionUtils.setFieldValue(jobErrorHandlerReloader, "props", new Properties()); - String newJobErrorHandlerType = "LOG"; - JobConfiguration newJobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType(newJobErrorHandlerType).build(); + JobConfiguration newJobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("BAR").build(); jobErrorHandlerReloader.reloadIfNecessary(newJobConfig); verify(jobErrorHandler).close(); JobErrorHandler actual = jobErrorHandlerReloader.getJobErrorHandler(); - assertThat(actual.getType(), is(newJobErrorHandlerType)); - assertTrue(actual instanceof LogJobErrorHandler); + assertThat(actual.getType(), is("BAR")); + assertTrue(actual instanceof BarJobErrorHandlerFixture); } } @Test void assertUnnecessaryToReload() { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("FOO").build(); try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { JobErrorHandler expected = jobErrorHandlerReloader.getJobErrorHandler(); jobErrorHandlerReloader.reloadIfNecessary(jobConfig); @@ -82,7 +81,7 @@ void assertUnnecessaryToReload() { @Test void assertShutdown() { - JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("IGNORE").build(); + JobConfiguration jobConfig = JobConfiguration.newBuilder("job", 1).jobErrorHandlerType("FOO").build(); try (JobErrorHandlerReloader jobErrorHandlerReloader = new JobErrorHandlerReloader(jobConfig)) { ReflectionUtils.setFieldValue(jobErrorHandlerReloader, "jobErrorHandler", jobErrorHandler); jobErrorHandlerReloader.close(); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/BarJobErrorHandlerFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/BarJobErrorHandlerFixture.java new file mode 100644 index 0000000000..f7877217a4 --- /dev/null +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/BarJobErrorHandlerFixture.java @@ -0,0 +1,32 @@ +/* + * 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.elasticjob.kernel.internal.executor.error.handler.fixture; + +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; + +public final class BarJobErrorHandlerFixture implements JobErrorHandler { + + @Override + public void handleException(final String jobName, final Throwable cause) { + } + + @Override + public String getType() { + return "BAR"; + } +} diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/FooJobErrorHandlerFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/FooJobErrorHandlerFixture.java new file mode 100644 index 0000000000..6fce6f14f9 --- /dev/null +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/FooJobErrorHandlerFixture.java @@ -0,0 +1,34 @@ +/* + * 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.elasticjob.kernel.internal.executor.error.handler.fixture; + +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; + +public final class FooJobErrorHandlerFixture implements JobErrorHandler { + + @Override + public void handleException(final String jobName, final Throwable cause) { + throw new JobSystemException(cause); + } + + @Override + public String getType() { + return "FOO"; + } +} diff --git a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler similarity index 83% rename from kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler index a893de8dde..ea578aa4d8 100644 --- a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler @@ -15,6 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.LogJobErrorHandler -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.IgnoreJobErrorHandler -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.type.ThrowJobErrorHandler +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.FooJobErrorHandlerFixture +org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.BarJobErrorHandlerFixture \ No newline at end of file From 6c796462ad8440291c20d71b65905427b8391a25 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 01:18:42 +0800 Subject: [PATCH 141/178] Fix test cases --- bootstrap/src/test/resources/logback-test.xml | 5 ---- .../src/test/resources/logback-test.xml | 26 ++++++++++++++++--- kernel/src/test/resources/logback-test.xml | 5 ---- test/e2e/src/test/resources/logback-test.xml | 5 ---- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/bootstrap/src/test/resources/logback-test.xml b/bootstrap/src/test/resources/logback-test.xml index 042c2155d6..1db232de79 100644 --- a/bootstrap/src/test/resources/logback-test.xml +++ b/bootstrap/src/test/resources/logback-test.xml @@ -33,16 +33,11 @@ ${log.pattern} - - - - - diff --git a/ecosystem/error-handler/normal/src/test/resources/logback-test.xml b/ecosystem/error-handler/normal/src/test/resources/logback-test.xml index df652e0168..81194d3017 100644 --- a/ecosystem/error-handler/normal/src/test/resources/logback-test.xml +++ b/ecosystem/error-handler/normal/src/test/resources/logback-test.xml @@ -17,9 +17,29 @@ --> + + + + + ${log.context.name} + - - - + + + + ERROR + + + ${log.pattern} + + + + + + + + + + diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index 042c2155d6..1db232de79 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -33,16 +33,11 @@ ${log.pattern} - - - - - diff --git a/test/e2e/src/test/resources/logback-test.xml b/test/e2e/src/test/resources/logback-test.xml index 042c2155d6..1db232de79 100644 --- a/test/e2e/src/test/resources/logback-test.xml +++ b/test/e2e/src/test/resources/logback-test.xml @@ -33,16 +33,11 @@ ${log.pattern} - - - - - From 21faf7c48bd630bf64aa214dae12e0898ec239eb Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 14:10:42 +0800 Subject: [PATCH 142/178] Refactor package of kernel.internal --- .../dingtalk/DingtalkJobErrorHandler.java | 2 +- ...talkJobErrorHandlerPropertiesValidator.java | 2 +- ...nel.executor.error.handler.JobErrorHandler} | 0 ...handler.JobErrorHandlerPropertiesValidator} | 0 ...JobErrorHandlerPropertiesValidatorTest.java | 2 +- .../dingtalk/DingtalkJobErrorHandlerTest.java | 2 +- .../handler/email/EmailJobErrorHandler.java | 2 +- ...mailJobErrorHandlerPropertiesValidator.java | 2 +- ...nel.executor.error.handler.JobErrorHandler} | 0 ...handler.JobErrorHandlerPropertiesValidator} | 0 ...JobErrorHandlerPropertiesValidatorTest.java | 2 +- .../email/EmailJobErrorHandlerTest.java | 2 +- .../handler/normal/IgnoreJobErrorHandler.java | 2 +- .../handler/normal/LogJobErrorHandler.java | 2 +- .../handler/normal/ThrowJobErrorHandler.java | 2 +- ...nel.executor.error.handler.JobErrorHandler} | 0 .../normal/IgnoreJobErrorHandlerTest.java | 2 +- .../handler/normal/LogJobErrorHandlerTest.java | 2 +- .../normal/ThrowJobErrorHandlerTest.java | 2 +- .../handler/wechat/WechatJobErrorHandler.java | 2 +- ...chatJobErrorHandlerPropertiesValidator.java | 2 +- ...nel.executor.error.handler.JobErrorHandler} | 0 ...handler.JobErrorHandlerPropertiesValidator} | 0 ...JobErrorHandlerPropertiesValidatorTest.java | 2 +- .../wechat/WechatJobErrorHandlerTest.java | 2 +- .../datasource/DataSourceConfiguration.java | 2 +- .../DataSourceTracingStorageConverter.java | 6 +++--- .../rdb/listener/RDBTracingListener.java | 6 +++--- .../RDBTracingListenerConfiguration.java | 6 +++--- .../rdb/storage/RDBJobEventStorage.java | 10 +++++----- .../rdb/yaml/YamlDataSourceConfiguration.java | 4 ++-- .../YamlDataSourceConfigurationConverter.java | 4 ++-- ...cing.listener.TracingListenerConfiguration} | 0 ...el.tracing.storage.TracingStorageConverter} | 0 .../DataSourceTracingStorageConverterTest.java | 6 +++--- .../RDBTracingListenerConfigurationTest.java | 2 +- .../rdb/listener/RDBTracingListenerTest.java | 12 ++++++------ .../rdb/storage/RDBJobEventStorageTest.java | 8 ++++---- ...mlDataSourceConfigurationConverterTest.java | 2 +- .../elasticjob/example/JavaMain.java | 2 +- .../executor/ElasticJobExecutor.java | 18 +++++++++--------- .../{internal => }/executor/ExecutionType.java | 2 +- .../error/handler/JobErrorHandler.java | 2 +- .../JobErrorHandlerPropertiesValidator.java | 2 +- .../error/handler/JobErrorHandlerReloader.java | 2 +- .../executor/facade/JobFacade.java | 12 ++++++------ .../facade/JobJobRuntimeServiceImpl.java | 2 +- .../executor/item/JobItemExecutorFactory.java | 2 +- .../threadpool/ElasticJobExecutorService.java | 2 +- .../threadpool/ExecutorServiceReloader.java | 2 +- .../JobExecutorThreadPoolSizeProvider.java | 2 +- ...UsageJobExecutorThreadPoolSizeProvider.java | 4 ++-- ...hreadJobExecutorThreadPoolSizeProvider.java | 4 ++-- .../kernel/internal/context/TaskContext.java | 2 +- .../kernel/internal/schedule/JobScheduler.java | 8 ++++---- .../kernel/internal/schedule/LiteJob.java | 2 +- .../tracing/JobTracingEventBus.java | 10 +++++----- .../tracing/api/TracingConfiguration.java | 6 +++--- .../api/TracingStorageConfiguration.java | 2 +- .../{internal => }/tracing/event/JobEvent.java | 2 +- .../tracing/event/JobExecutionEvent.java | 2 +- .../tracing/event/JobStatusTraceEvent.java | 4 ++-- .../TracingConfigurationException.java | 2 +- ...acingStorageConverterNotFoundException.java | 4 ++-- .../TracingStorageUnavailableException.java | 2 +- .../tracing/exception/WrapException.java | 2 +- .../tracing/listener/TracingListener.java | 6 +++--- .../listener/TracingListenerConfiguration.java | 4 ++-- .../storage/TracingStorageConverter.java | 4 ++-- .../TracingStorageConverterFactory.java | 2 +- .../tracing/yaml/YamlTracingConfiguration.java | 6 +++--- .../YamlTracingConfigurationConverter.java | 6 +++--- .../yaml/YamlTracingStorageConfiguration.java | 6 +++--- ...readpool.JobExecutorThreadPoolSizeProvider} | 4 ++-- ...nfra.yaml.config.YamlConfigurationConverter | 2 +- .../executor/ElasticJobExecutorTest.java | 12 ++++++------ .../handler/JobErrorHandlerReloaderTest.java | 6 +++--- .../fixture/BarJobErrorHandlerFixture.java | 4 ++-- .../fixture/FooJobErrorHandlerFixture.java | 4 ++-- .../executor/facade/JobFacadeTest.java | 4 ++-- .../item/JobItemExecutorFactoryTest.java | 6 +++--- .../ElasticJobExecutorServiceTest.java | 2 +- .../ExecutorServiceReloaderTest.java | 2 +- ...eJobExecutorThreadPoolSizeProviderTest.java | 4 ++-- ...dJobExecutorThreadPoolSizeProviderTest.java | 4 ++-- .../internal/context/TaskContextTest.java | 2 +- .../internal/context/fixture/TaskNode.java | 2 +- .../internal/storage/JobNodeStorageTest.java | 2 +- .../tracing/JobTracingEventBusTest.java | 12 ++++++------ .../tracing/event/JobExecutionEventTest.java | 2 +- .../tracing/fixture/JobEventCaller.java | 2 +- .../fixture/JobEventCallerConfiguration.java | 4 ++-- .../fixture/JobEventCallerConverter.java | 6 +++--- .../TestTracingFailureConfiguration.java | 10 +++++----- .../tracing/fixture/TestTracingListener.java | 8 ++++---- .../TestTracingListenerConfiguration.java | 6 +++--- .../TracingStorageConverterFactoryTest.java | 4 ++-- .../yaml/YamlJobEventCallerConfiguration.java | 8 ++++---- ...mlJobEventCallerConfigurationConverter.java | 8 ++++---- .../YamlTracingConfigurationConverterTest.java | 6 +++--- ...nel.executor.error.handler.JobErrorHandler} | 4 ++-- ...nfra.yaml.config.YamlConfigurationConverter | 2 +- ...cing.listener.TracingListenerConfiguration} | 4 ++-- ...el.tracing.storage.TracingStorageConverter} | 2 +- .../job/ElasticJobBootstrapConfiguration.java | 2 +- .../ElasticJobTracingConfiguration.java | 2 +- .../boot/job/ElasticJobSpringBootTest.java | 2 +- .../boot/tracing/TracingConfigurationTest.java | 2 +- .../parser/TracingBeanDefinitionParser.java | 2 +- 109 files changed, 201 insertions(+), 201 deletions(-) rename ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/error-handler/email/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/email/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/error-handler/normal/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/wechat/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/wechat/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration => org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration} (100%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter => org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter} (100%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/ElasticJobExecutor.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/ExecutionType.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/error/handler/JobErrorHandler.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/error/handler/JobErrorHandlerPropertiesValidator.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/error/handler/JobErrorHandlerReloader.java (95%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/facade/JobFacade.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/facade/JobJobRuntimeServiceImpl.java (94%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/item/JobItemExecutorFactory.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/ElasticJobExecutorService.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/ExecutorServiceReloader.java (96%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/JobExecutorThreadPoolSizeProvider.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java (86%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java (84%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/JobTracingEventBus.java (88%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/api/TracingConfiguration.java (84%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/api/TracingStorageConfiguration.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/event/JobEvent.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/event/JobExecutionEvent.java (97%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/event/JobStatusTraceEvent.java (91%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/exception/TracingConfigurationException.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/exception/TracingStorageConverterNotFoundException.java (87%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/exception/TracingStorageUnavailableException.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/exception/WrapException.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/listener/TracingListener.java (84%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/listener/TracingListenerConfiguration.java (88%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/storage/TracingStorageConverter.java (88%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/storage/TracingStorageConverterFactory.java (95%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/yaml/YamlTracingConfiguration.java (83%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/yaml/YamlTracingConfigurationConverter.java (88%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/yaml/YamlTracingStorageConfiguration.java (77%) rename kernel/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider => org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider} (76%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/ElasticJobExecutorTest.java (98%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/error/handler/JobErrorHandlerReloaderTest.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/error/handler/fixture/BarJobErrorHandlerFixture.java (84%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/error/handler/fixture/FooJobErrorHandlerFixture.java (86%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/facade/JobFacadeTest.java (98%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/item/JobItemExecutorFactoryTest.java (96%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/ElasticJobExecutorServiceTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/ExecutorServiceReloaderTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java (86%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java (86%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/JobTracingEventBusTest.java (84%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/event/JobExecutionEventTest.java (97%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/fixture/JobEventCaller.java (92%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/fixture/JobEventCallerConfiguration.java (87%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/fixture/JobEventCallerConverter.java (82%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/fixture/TestTracingFailureConfiguration.java (73%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/fixture/TestTracingListener.java (80%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/fixture/TestTracingListenerConfiguration.java (80%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/storage/TracingStorageConverterFactoryTest.java (89%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/yaml/YamlJobEventCallerConfiguration.java (77%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/yaml/YamlJobEventCallerConfigurationConverter.java (81%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/{internal => }/tracing/yaml/YamlTracingConfigurationConverterTest.java (88%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler} (78%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration => org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration} (79%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter => org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter} (89%) diff --git a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java index 317b7a8be3..ff78fcb59e 100644 --- a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java +++ b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java @@ -30,7 +30,7 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; diff --git a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java index 7d29b7266b..5a11941011 100644 --- a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index 518439f457..440bcf9aad 100644 --- a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index c408d07894..49633dfd8d 100644 --- a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -21,7 +21,7 @@ import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; import org.apache.shardingsphere.elasticjob.error.handler.dingtalk.fixture.DingtalkInternalController; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; diff --git a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java index 5c6a478ba9..05477099d7 100644 --- a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java +++ b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java @@ -20,7 +20,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import javax.mail.Authenticator; import javax.mail.BodyPart; diff --git a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java index 6260372047..7ef1957d49 100644 --- a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index 6e99f5b82d..b634d22e51 100644 --- a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index db91092ec6..d1203870d6 100644 --- a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -20,7 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; diff --git a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java index 39fd04d9b4..ba09daa39c 100644 --- a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; /** * Job error handler for ignore exception. diff --git a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java index 72fddca8aa..ab09c3b3cf 100644 --- a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; /** * Job error handler for log error message. diff --git a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java index a9381b1c2b..01ec88a6c5 100644 --- a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; /** * Job error handler for throw exception. diff --git a/ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java index fc7570ab7d..b4753be052 100644 --- a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java index 02220d1a77..ff88b8c811 100644 --- a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java @@ -20,7 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java index 3a7cc95a60..d8575671f3 100644 --- a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java index a62647fca1..3c76acb95b 100644 --- a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java +++ b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java @@ -29,7 +29,7 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import java.io.IOException; import java.io.PrintWriter; diff --git a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java index 3552dabaa3..70845377b6 100644 --- a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index 778e6ff637..286a09330e 100644 --- a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index 4df5094ad0..8ac0470e36 100644 --- a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -21,7 +21,7 @@ import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; import org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture.WechatInternalController; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java index b4144aa5e3..1e43e0d966 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java @@ -24,7 +24,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java index e4a809b477..b3a1c6fdab 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingStorageUnavailableException; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; import javax.sql.DataSource; import java.sql.Connection; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java index cc67e3318d..2e1e3a31b2 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java index cb47480ec1..789bf1fb7a 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; import javax.sql.DataSource; import java.sql.SQLException; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 28f9dc573c..8c87fa8762 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -19,11 +19,11 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.WrapException; +import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.WrapException; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType; import org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DefaultDatabaseType; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java index 56447cb57a..0f7c36c503 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java @@ -19,8 +19,8 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java index 66dca491f0..c49481f590 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration similarity index 100% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter similarity index 100% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java index dcc49e0951..3495e8a513 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; import com.zaxxer.hikari.HikariDataSource; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingStorageUnavailableException; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverterFactory; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java index eae9b3e7bb..ec572b2bc1 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 85696bc09a..e75a1c5f53 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -18,12 +18,12 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.tracing.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java index b4a64aa3cd..3e0625511a 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java @@ -18,10 +18,10 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java index 2df52bccec..d488e3ca1b 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.yaml; import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; import org.junit.jupiter.api.Test; import javax.sql.DataSource; diff --git a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index 211af4a8e9..a2ff666f76 100644 --- a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java +++ b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -33,7 +33,7 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import javax.sql.DataSource; import java.io.IOException; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutor.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutor.java index 0d0366556a..aa2dbc43f5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutor.java @@ -15,25 +15,25 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor; +package org.apache.shardingsphere.elasticjob.kernel.executor; import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerReloader; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade.JobFacade; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerReloader; +import org.apache.shardingsphere.elasticjob.kernel.executor.facade.JobFacade; import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.item.JobItemExecutorFactory; +import org.apache.shardingsphere.elasticjob.kernel.executor.item.JobItemExecutorFactory; import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.ExecutorServiceReloader; +import org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader; import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.ExceptionUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent.ExecutionSource; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent.ExecutionSource; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Collection; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ExecutionType.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ExecutionType.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ExecutionType.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ExecutionType.java index 26d5247891..b7544b3de9 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ExecutionType.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ExecutionType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor; +package org.apache.shardingsphere.elasticjob.kernel.executor; /** * Execution type. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandler.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandler.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandler.java index ef6cfe6e79..f4a1f0f4d9 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerPropertiesValidator.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerPropertiesValidator.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerPropertiesValidator.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerPropertiesValidator.java index e1ac31b0df..098c6fc35e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerPropertiesValidator.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerPropertiesValidator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloader.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloader.java index 9f1954335d..dd925cd316 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloader.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacade.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java index 5721a1d574..0c50332aeb 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade; +package org.apache.shardingsphere.elasticjob.kernel.executor.facade; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; @@ -31,11 +31,11 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.kernel.tracing.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import java.util.Collection; import java.util.Comparator; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobJobRuntimeServiceImpl.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobJobRuntimeServiceImpl.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobJobRuntimeServiceImpl.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobJobRuntimeServiceImpl.java index 80446a66f1..881c904f13 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobJobRuntimeServiceImpl.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobJobRuntimeServiceImpl.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade; +package org.apache.shardingsphere.elasticjob.kernel.executor.facade; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactory.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactory.java index 3b6fd04c5b..b5db62cd3e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.item; +package org.apache.shardingsphere.elasticjob.kernel.executor.item; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorService.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ElasticJobExecutorService.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorService.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ElasticJobExecutorService.java index bef37b753e..087215c6cc 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorService.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ElasticJobExecutorService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool; import com.google.common.util.concurrent.MoreExecutors; import org.apache.commons.lang3.concurrent.BasicThreadFactory; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloader.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ExecutorServiceReloader.java similarity index 96% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloader.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ExecutorServiceReloader.java index 6cd7b505ba..25769242b4 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloader.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ExecutorServiceReloader.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool; import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/JobExecutorThreadPoolSizeProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/JobExecutorThreadPoolSizeProvider.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/JobExecutorThreadPoolSizeProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/JobExecutorThreadPoolSizeProvider.java index 64ce2d5080..6a7f87f4b0 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/JobExecutorThreadPoolSizeProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/JobExecutorThreadPoolSizeProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java similarity index 86% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java index 9fa4f55f22..a063ba3172 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with use CPU available processors. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java similarity index 84% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java index ed5e9f5580..192b957161 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProvider.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider; /** * Job executor pool size provider with single thread. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java index a0b92ecaa1..391bcaccfd 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java @@ -24,7 +24,7 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; import java.util.Collections; import java.util.List; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 9d6a1f1e01..2407d6b5e8 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -22,10 +22,10 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandlerPropertiesValidator; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ElasticJobExecutor; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade.JobFacade; +import org.apache.shardingsphere.elasticjob.kernel.executor.facade.JobFacade; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance; import org.apache.shardingsphere.elasticjob.spi.listener.ElasticJobListener; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; @@ -34,7 +34,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory; import org.apache.shardingsphere.elasticjob.kernel.internal.setup.SetUpFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.quartz.JobBuilder; import org.quartz.JobDetail; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java index 252465f484..fdf57b99ed 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/LiteJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.schedule; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ElasticJobExecutor; +import org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor; import org.quartz.Job; import org.quartz.JobExecutionContext; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBus.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBus.java similarity index 88% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBus.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBus.java index 1f8d43d10e..78f3fae237 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBus.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBus.java @@ -15,17 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing; +package org.apache.shardingsphere.elasticjob.kernel.tracing; import com.google.common.eventbus.AsyncEventBus; import com.google.common.eventbus.EventBus; import com.google.common.util.concurrent.MoreExecutors; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.concurrent.ExecutorService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingConfiguration.java similarity index 84% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingConfiguration.java index 6163ebdfe3..9b656b6987 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingConfiguration.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api; +package org.apache.shardingsphere.elasticjob.kernel.tracing.api; import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingStorageConverterNotFoundException; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverterFactory; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageConverterNotFoundException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory; /** * Tracing configuration. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingStorageConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingStorageConfiguration.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingStorageConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingStorageConfiguration.java index 6318349020..ced7a878ae 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/api/TracingStorageConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingStorageConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api; +package org.apache.shardingsphere.elasticjob.kernel.tracing.api; /** * Tracing storage configuration. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobEvent.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobEvent.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobEvent.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobEvent.java index ac52eb0a41..fd44f9d09b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobEvent.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobEvent.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.tracing.event; /** * Job event. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEvent.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEvent.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEvent.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEvent.java index 71bad519d0..ab5eb84c90 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEvent.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEvent.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobStatusTraceEvent.java similarity index 91% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobStatusTraceEvent.java index 25361bcf72..9233fe060b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobStatusTraceEvent.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobStatusTraceEvent.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; import java.util.Date; import java.util.UUID; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingConfigurationException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingConfigurationException.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingConfigurationException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingConfigurationException.java index 1776783f60..4643ef9b8c 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingConfigurationException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingConfigurationException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.tracing.exception; /** * Tracing configuration exception. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageConverterNotFoundException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java similarity index 87% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageConverterNotFoundException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java index 9190c3bef0..a2661fb1db 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageConverterNotFoundException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.tracing.exception; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; /** * {@link TracingStorageConverter} not found exception. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageUnavailableException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageUnavailableException.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageUnavailableException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageUnavailableException.java index cb9bdcb7bf..b795104074 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/TracingStorageUnavailableException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageUnavailableException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.tracing.exception; /** * Tracing storage unavailable exception. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/WrapException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/WrapException.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/WrapException.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/WrapException.java index 693ea2bcf2..a0aa125f70 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/exception/WrapException.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/WrapException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception; +package org.apache.shardingsphere.elasticjob.kernel.tracing.exception; /** * Use to wrap Exception. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListener.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListener.java similarity index 84% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListener.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListener.java index 7aac02be30..b95a8a15c0 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListener.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListener.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener; +package org.apache.shardingsphere.elasticjob.kernel.tracing.listener; import com.google.common.eventbus.AllowConcurrentEvents; import com.google.common.eventbus.Subscribe; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; /** * Tracing listener. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListenerConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerConfiguration.java similarity index 88% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListenerConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerConfiguration.java index 5bb0345af5..29211ad7fc 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/listener/TracingListenerConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerConfiguration.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener; +package org.apache.shardingsphere.elasticjob.kernel.tracing.listener; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java similarity index 88% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverter.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java index 9371997f13..6bb4e6ecf3 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage; +package org.apache.shardingsphere.elasticjob.kernel.tracing.storage; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactory.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactory.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactory.java index d1bf19840b..674a4e6d2e 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage; +package org.apache.shardingsphere.elasticjob.kernel.tracing.storage; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java similarity index 83% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java index 9181fb097a..b426ad5ca5 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; /** - * YAML configuration for {@link org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration}. + * YAML configuration for {@link TracingConfiguration}. * * @param type of storage */ diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java similarity index 88% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverter.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java index 60d97f5501..0cd84b84c0 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingStorageConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java similarity index 77% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingStorageConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java index 3ed9605380..8eb67fe665 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingStorageConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; /** - * YAML configuration for {@link org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration}. + * YAML configuration for {@link TracingStorageConfiguration}. * * @param type of storage */ diff --git a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider similarity index 76% rename from kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider rename to kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider index 5b7167c4f0..b6da6de15d 100644 --- a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider +++ b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider -org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider +org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider diff --git a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter index 3582dc2b6c..b88967805e 100644 --- a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter +++ b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlTracingConfigurationConverter +org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfigurationConverter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutorTest.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutorTest.java index eaf94d4d07..5f44299d2e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutorTest.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor; +package org.apache.shardingsphere.elasticjob.kernel.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; -import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade.JobFacade; -import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; +import org.apache.shardingsphere.elasticjob.kernel.executor.facade.JobFacade; import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloaderTest.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloaderTest.java index 7f951531c1..2cba36ca32 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/JobErrorHandlerReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloaderTest.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler; +package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.BarJobErrorHandlerFixture; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.FooJobErrorHandlerFixture; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture.BarJobErrorHandlerFixture; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture.FooJobErrorHandlerFixture; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/BarJobErrorHandlerFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/BarJobErrorHandlerFixture.java similarity index 84% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/BarJobErrorHandlerFixture.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/BarJobErrorHandlerFixture.java index f7877217a4..360da8848a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/BarJobErrorHandlerFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/BarJobErrorHandlerFixture.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture; +package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; public final class BarJobErrorHandlerFixture implements JobErrorHandler { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/FooJobErrorHandlerFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/FooJobErrorHandlerFixture.java similarity index 86% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/FooJobErrorHandlerFixture.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/FooJobErrorHandlerFixture.java index 6fce6f14f9..324306fea9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/error/handler/fixture/FooJobErrorHandlerFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/FooJobErrorHandlerFixture.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture; +package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; public final class FooJobErrorHandlerFixture implements JobErrorHandler { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacadeTest.java similarity index 98% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacadeTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacadeTest.java index 76e93a362c..c587ba8cef 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/facade/JobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacadeTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.facade; +package org.apache.shardingsphere.elasticjob.kernel.executor.facade; import com.google.common.collect.Lists; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; @@ -25,9 +25,9 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestElasticJobListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactoryTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactoryTest.java index 6c5fccc8de..8e7fba6260 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/item/JobItemExecutorFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactoryTest.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.item; +package org.apache.shardingsphere.elasticjob.kernel.executor.item; -import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.fixture.executor.ClassedFooJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.DetailedFooJob; -import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FailedJob; +import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.instanceOf; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorServiceTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ElasticJobExecutorServiceTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorServiceTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ElasticJobExecutorServiceTest.java index 9e0066941e..a3d3b887e4 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ElasticJobExecutorServiceTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ElasticJobExecutorServiceTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ExecutorServiceReloaderTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ExecutorServiceReloaderTest.java index dff7117bf4..55deeead59 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/ExecutorServiceReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/ExecutorServiceReloaderTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java similarity index 86% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java index fd99b1b0b8..0691ebb6ba 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/CPUUsageJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java similarity index 86% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java index a99df1b194..49cfec034a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/threadpool/type/SingleThreadJobExecutorThreadPoolSizeProviderTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.type; +package org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.threadpool.JobExecutorThreadPoolSizeProvider; +import org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java index 7606517642..5c9edf8645 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode; import org.hamcrest.CoreMatchers; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java index e803b112f9..ae9b6383d1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture; import lombok.Builder; -import org.apache.shardingsphere.elasticjob.kernel.internal.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; @Builder public final class TaskNode { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java index 33e69ac903..2c7112308d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/storage/JobNodeStorageTest.java @@ -18,12 +18,12 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.storage; import org.apache.shardingsphere.elasticjob.kernel.internal.listener.ListenerNotifierManager; -import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.base.transaction.TransactionOperation; import org.apache.shardingsphere.elasticjob.reg.exception.RegException; import org.apache.shardingsphere.elasticjob.reg.listener.ConnectionStateChangedEventListener; import org.apache.shardingsphere.elasticjob.reg.listener.DataChangedEventListener; +import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBusTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java similarity index 84% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBusTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java index 3de513c0b6..664328ba06 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/JobTracingEventBusTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing; +package org.apache.shardingsphere.elasticjob.kernel.tracing; import com.google.common.eventbus.EventBus; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.TestTracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.TestTracingListener; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEventTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEventTest.java similarity index 97% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEventTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEventTest.java index fd37cc6665..b2cef1a454 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/event/JobExecutionEventTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEventTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event; +package org.apache.shardingsphere.elasticjob.kernel.tracing.event; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCaller.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCaller.java similarity index 92% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCaller.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCaller.java index a6459bef75..e980ac97c6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCaller.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCaller.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; public interface JobEventCaller { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConfiguration.java similarity index 87% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConfiguration.java index d2f0deaeb9..03e626d0d3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConfiguration.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; /** * {@link TracingStorageConfiguration} for {@link JobEventCaller}. diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConverter.java similarity index 82% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConverter.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConverter.java index 99ebded974..7328f089e9 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/JobEventCallerConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConverter.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; /** * {@link TracingStorageConverter} for {@link JobEventCaller}. diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingFailureConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingFailureConfiguration.java similarity index 73% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingFailureConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingFailureConfiguration.java index 9f59e4bda3..c5f3de380c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingFailureConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingFailureConfiguration.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; -public final class TestTracingFailureConfiguration implements TracingListenerConfiguration { +public final class TestTracingFailureConfiguration implements TracingListenerConfiguration { @Override public TracingListener createTracingListener(final Object storage) throws TracingConfigurationException { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListener.java similarity index 80% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListener.java index 5262686da5..c3b173e16e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListener.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; import lombok.Getter; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; @RequiredArgsConstructor public final class TestTracingListener implements TracingListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListenerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListenerConfiguration.java similarity index 80% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListenerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListenerConfiguration.java index fe0d6b262f..e665257804 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/fixture/TestTracingListenerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListenerConfiguration.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; public final class TestTracingListenerConfiguration implements TracingListenerConfiguration { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java similarity index 89% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java index c142e22fd8..b6a93e14be 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage; +package org.apache.shardingsphere.elasticjob.kernel.tracing.storage; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java similarity index 77% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java index 938c93989b..267678b1f3 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCallerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCallerConfiguration; /** * YAML JobEventCaller configuration. diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfigurationConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java similarity index 81% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfigurationConverter.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java index c6b780f95b..9a385de01b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlJobEventCallerConfigurationConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCallerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCallerConfiguration; /** * YAML JobEventCaller configuration converter. diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverterTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java similarity index 88% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverterTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java index d33ff13e8e..f371b29bfb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml; +package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler similarity index 78% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler index ea578aa4d8..5e7196a3e6 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.JobErrorHandler +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.FooJobErrorHandlerFixture -org.apache.shardingsphere.elasticjob.kernel.internal.executor.error.handler.fixture.BarJobErrorHandlerFixture \ No newline at end of file +org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture.FooJobErrorHandlerFixture +org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture.BarJobErrorHandlerFixture \ No newline at end of file diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter index 228b68f8e7..bef491206f 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.tracing.yaml.YamlJobEventCallerConfigurationConverter +org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlJobEventCallerConfigurationConverter diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration similarity index 79% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration index 1773d05041..e96753af53 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.listener.TracingListenerConfiguration +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.TestTracingListenerConfiguration -org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.TestTracingFailureConfiguration +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.TestTracingListenerConfiguration +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.TestTracingFailureConfiguration diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter similarity index 89% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter index 98c255109d..5a448e5588 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.tracing.storage.TracingStorageConverter +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.internal.tracing.fixture.JobEventCallerConverter +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCallerConverter diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index 1f87c0b212..ff59083bdc 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.SmartInitializingSingleton; import org.springframework.beans.factory.config.SingletonBeanRegistry; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java index 2b285ce337..fe0165a9ab 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import com.zaxxer.hikari.HikariDataSource; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import org.springframework.beans.BeanUtils; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 262bafc898..8735d46caf 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -29,7 +29,7 @@ import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java index d9b7d9ced6..ff6b7fcea3 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java index d75b455f18..1bce808152 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.tracing.parser; import org.apache.shardingsphere.elasticjob.spring.namespace.tracing.tag.TracingBeanDefinitionTag; -import org.apache.shardingsphere.elasticjob.kernel.internal.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; From a8ba448927d7e237ecece9516634a44d822a1b11 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 14:16:42 +0800 Subject: [PATCH 143/178] Refactor ElasticJobTracingConfiguration --- .../boot/tracing/ElasticJobTracingConfiguration.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java index fe0165a9ab..0df9b60ad5 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -68,13 +68,8 @@ public DataSource tracingDataSource(final TracingProperties tracingProperties) { */ @Bean @ConditionalOnBean(DataSource.class) - public TracingConfiguration tracingConfiguration(final DataSource dataSource, - @Nullable final DataSource tracingDataSource) { - DataSource ds = tracingDataSource; - if (ds == null) { - ds = dataSource; - } - return new TracingConfiguration<>("RDB", ds); + public TracingConfiguration tracingConfiguration(final DataSource dataSource, @Nullable final DataSource tracingDataSource) { + return new TracingConfiguration<>("RDB", null == tracingDataSource ? dataSource : tracingDataSource); } } } From ba734384cffe49f0a9ae5e8b860f41d35fafe8c2 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 14:24:33 +0800 Subject: [PATCH 144/178] Rename TracingStorageDatabaseType --- .../rdb/storage/RDBJobEventStorage.java | 18 +++++++++--------- ...pe.java => TracingStorageDatabaseType.java} | 4 ++-- ...java => DB2TracingStorageDatabaseType.java} | 6 +++--- ... => DefaultTracingStorageDatabaseType.java} | 6 +++--- ....java => H2TracingStorageDatabaseType.java} | 6 +++--- ...va => MySQLTracingStorageDatabaseType.java} | 6 +++--- ...a => OracleTracingStorageDatabaseType.java} | 6 +++--- ... PostgreSQLTracingStorageDatabaseType.java} | 6 +++--- ...> SQLServerTracingStorageDatabaseType.java} | 6 +++--- ...racing.rdb.type.TracingStorageDatabaseType} | 12 ++++++------ .../tracing/yaml/YamlTracingConfiguration.java | 2 -- 11 files changed, 38 insertions(+), 40 deletions(-) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/{DatabaseType.java => TracingStorageDatabaseType.java} (94%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/{DB2DatabaseType.java => DB2TracingStorageDatabaseType.java} (82%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/{DefaultDatabaseType.java => DefaultTracingStorageDatabaseType.java} (83%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/{H2DatabaseType.java => H2TracingStorageDatabaseType.java} (82%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/{MySQLDatabaseType.java => MySQLTracingStorageDatabaseType.java} (82%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/{OracleDatabaseType.java => OracleTracingStorageDatabaseType.java} (82%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/{PostgreSQLDatabaseType.java => PostgreSQLTracingStorageDatabaseType.java} (81%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/{SQLServerDatabaseType.java => SQLServerTracingStorageDatabaseType.java} (83%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType => org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType} (77%) diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index 8c87fa8762..de63022858 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -24,8 +24,8 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.WrapException; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DefaultDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DefaultTracingStorageDatabaseType; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; import javax.sql.DataSource; @@ -60,14 +60,14 @@ public final class RDBJobEventStorage { private final DataSource dataSource; - private final DatabaseType databaseType; + private final TracingStorageDatabaseType tracingStorageDatabaseType; private final RDBStorageSQLMapper sqlMapper; private RDBJobEventStorage(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; - databaseType = getDatabaseType(dataSource); - sqlMapper = new RDBStorageSQLMapper(databaseType.getSQLPropertiesFile()); + tracingStorageDatabaseType = getDatabaseType(dataSource); + sqlMapper = new RDBStorageSQLMapper(tracingStorageDatabaseType.getSQLPropertiesFile()); initTablesAndIndexes(); } @@ -106,16 +106,16 @@ public static RDBJobEventStorage wrapException(final Supplier type of storage */ -@NoArgsConstructor @Getter @Setter public final class YamlTracingConfiguration implements YamlConfiguration> { From 33695c90bbfc7960c12bd49442bc688de145e2af Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 15:09:42 +0800 Subject: [PATCH 145/178] Add SQLPropertiesFactory (#2348) * Add SQLPropertiesFactory * Add SQLPropertiesFactory --- .../rdb/storage/RDBJobEventStorage.java | 6 +- .../rdb/storage/RDBStorageSQLMapper.java | 18 +----- .../rdb/storage/SQLPropertiesFactory.java | 56 +++++++++++++++++++ .../rdb/type/TracingStorageDatabaseType.java | 9 --- 4 files changed, 60 insertions(+), 29 deletions(-) create mode 100644 ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/SQLPropertiesFactory.java diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java index de63022858..f59ea96e66 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java @@ -66,8 +66,8 @@ public final class RDBJobEventStorage { private RDBJobEventStorage(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; - tracingStorageDatabaseType = getDatabaseType(dataSource); - sqlMapper = new RDBStorageSQLMapper(tracingStorageDatabaseType.getSQLPropertiesFile()); + tracingStorageDatabaseType = getTracingStorageDatabaseType(dataSource); + sqlMapper = new RDBStorageSQLMapper(SQLPropertiesFactory.getProperties(tracingStorageDatabaseType)); initTablesAndIndexes(); } @@ -106,7 +106,7 @@ public static RDBJobEventStorage wrapException(final Supplier Date: Tue, 31 Oct 2023 15:50:34 +0800 Subject: [PATCH 146/178] Refactor test cases to reduce useless log (#2349) * Update log config file to ignore regular log * Refactor RDBTracingListenerConfigurationTest * Refactor JobTracingEventBusTest * Refactor HttpJobExecutorTest --- ecosystem/executor/http/pom.xml | 6 --- .../http/src/test/resources/logback-test.xml | 40 +++++++++++++++++++ .../RDBTracingListenerConfigurationTest.java | 12 +++++- .../rdb/src/test/resources/logback-test.xml | 2 + kernel/src/test/resources/logback-test.xml | 1 + 5 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 ecosystem/executor/http/src/test/resources/logback-test.xml diff --git a/ecosystem/executor/http/pom.xml b/ecosystem/executor/http/pom.xml index d3d7015c2d..c1af6c9de2 100644 --- a/ecosystem/executor/http/pom.xml +++ b/ecosystem/executor/http/pom.xml @@ -40,12 +40,6 @@ test - - org.slf4j - slf4j-jdk14 - test - true - org.awaitility awaitility diff --git a/ecosystem/executor/http/src/test/resources/logback-test.xml b/ecosystem/executor/http/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..74a43319c7 --- /dev/null +++ b/ecosystem/executor/http/src/test/resources/logback-test.xml @@ -0,0 +1,40 @@ + + + + + + + + + ${log.context.name} + + + + + + ERROR + + + ${log.pattern} + + + + + + + diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java index ec572b2bc1..2b03d79775 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java @@ -21,9 +21,15 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; import org.junit.jupiter.api.Test; +import javax.sql.DataSource; + +import java.sql.SQLException; + import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; class RDBTracingListenerConfigurationTest { @@ -38,7 +44,9 @@ void assertCreateTracingListenerSuccess() throws TracingConfigurationException { } @Test - void assertCreateTracingListenerFailure() { - assertThrows(TracingConfigurationException.class, () -> new RDBTracingListenerConfiguration().createTracingListener(new BasicDataSource())); + void assertCreateTracingListenerFailure() throws SQLException { + DataSource dataSource = mock(DataSource.class); + when(dataSource.getConnection()).thenThrow(new SQLException()); + assertThrows(TracingConfigurationException.class, () -> new RDBTracingListenerConfiguration().createTracingListener(dataSource)); } } diff --git a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml index 74a43319c7..9ba216d493 100644 --- a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml @@ -37,4 +37,6 @@ + + diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index 1db232de79..ea8aa37069 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -39,5 +39,6 @@ + From 66971c25a863ab9dcbbbed918738ec044bb4d746 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 16:05:42 +0800 Subject: [PATCH 147/178] Switch off springboot's banner in test log (#2350) * Switch off springboot's banner in test log * Switch off springboot's banner in test log --- .../spring/boot/job/ElasticJobSpringBootScannerTest.java | 2 +- .../elasticjob/spring/boot/job/ElasticJobSpringBootTest.java | 2 +- .../snapshot/ElasticJobSnapshotServiceConfigurationTest.java | 2 +- .../spring/boot/tracing/TracingConfigurationTest.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java index 45a6e8ead3..06dc616f61 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootScannerTest.java @@ -36,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -@SpringBootTest +@SpringBootTest(properties = "spring.main.banner-mode=off") @ActiveProfiles("elasticjob") @ElasticJobScan(basePackages = "org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl") class ElasticJobSpringBootScannerTest { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index 8735d46caf..c8f10ce0e0 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -55,7 +55,7 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -@SpringBootTest +@SpringBootTest(properties = "spring.main.banner-mode=off") @SpringBootApplication @ActiveProfiles("elasticjob") class ElasticJobSpringBootTest { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java index 42736a9dd6..28061aabba 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/snapshot/ElasticJobSnapshotServiceConfigurationTest.java @@ -29,7 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; -@SpringBootTest +@SpringBootTest(properties = "spring.main.banner-mode=off") @SpringBootApplication @ActiveProfiles("snapshot") class ElasticJobSnapshotServiceConfigurationTest { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java index ff6b7fcea3..5633e3dad9 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java @@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; -@SpringBootTest +@SpringBootTest(properties = "spring.main.banner-mode=off") @SpringBootApplication @ActiveProfiles("tracing") class TracingConfigurationTest { From dcb1a5a1894a6948e6edaa01c53bb66b5c21f61f Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 16:37:36 +0800 Subject: [PATCH 148/178] Unify logback-test.xml (#2351) --- lifecycle/src/test/resources/logback-test.xml | 2 +- spring/boot-starter/src/test/resources/logback-test.xml | 2 +- spring/core/src/test/resources/META-INF/logback-test.xml | 2 +- spring/namespace/src/test/resources/logback-test.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lifecycle/src/test/resources/logback-test.xml b/lifecycle/src/test/resources/logback-test.xml index 1e0e6dafca..74a43319c7 100644 --- a/lifecycle/src/test/resources/logback-test.xml +++ b/lifecycle/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/spring/boot-starter/src/test/resources/logback-test.xml b/spring/boot-starter/src/test/resources/logback-test.xml index 65c90ee7cf..9be3fa9391 100644 --- a/spring/boot-starter/src/test/resources/logback-test.xml +++ b/spring/boot-starter/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/spring/core/src/test/resources/META-INF/logback-test.xml b/spring/core/src/test/resources/META-INF/logback-test.xml index 722e4b46be..73c2de510c 100644 --- a/spring/core/src/test/resources/META-INF/logback-test.xml +++ b/spring/core/src/test/resources/META-INF/logback-test.xml @@ -17,7 +17,7 @@ --> - + diff --git a/spring/namespace/src/test/resources/logback-test.xml b/spring/namespace/src/test/resources/logback-test.xml index 722e4b46be..73c2de510c 100644 --- a/spring/namespace/src/test/resources/logback-test.xml +++ b/spring/namespace/src/test/resources/logback-test.xml @@ -17,7 +17,7 @@ --> - + From e41e1a983f4a77b27b478223cedf40e9d4b0b834 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Tue, 31 Oct 2023 18:08:20 +0800 Subject: [PATCH 149/178] Fix error message occur in spring test cases --- .../fixture/listener/SimpleOnceListener.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java index 4e75613ebc..c4a2d7eedd 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/listener/SimpleOnceListener.java @@ -17,37 +17,27 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.listener; -import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.kernel.listener.AbstractDistributeOnceElasticJobListener; -import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; -import org.springframework.beans.factory.annotation.Autowired; +import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; public class SimpleOnceListener extends AbstractDistributeOnceElasticJobListener { - @Autowired - private FooService fooService; - private final long startedTimeoutMilliseconds; private final long completedTimeoutMilliseconds; public SimpleOnceListener() { - this(10000, 20000); - } - - public SimpleOnceListener(final long startedTimeoutMilliseconds, final long completedTimeoutMilliseconds) { - super(startedTimeoutMilliseconds, completedTimeoutMilliseconds); - this.startedTimeoutMilliseconds = startedTimeoutMilliseconds; - this.completedTimeoutMilliseconds = completedTimeoutMilliseconds; + super(10000L, 20000L); + startedTimeoutMilliseconds = 10000L; + completedTimeoutMilliseconds = 20000L; } @Override public void doBeforeJobExecutedAtLastStarted(final ShardingContexts shardingContexts) { assertThat(startedTimeoutMilliseconds, is(10000L)); - assertThat(fooService.foo(), is("this is fooService.")); } @Override From 7a5f020cd941dae62f7c5b1433626f3404a8e26f Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 18:42:24 +0800 Subject: [PATCH 150/178] Resolve dependencies conflicts (#2353) * Resolve dependencies conflicts * Resolve dependencies conflicts * Revise javadoc --- .../dataflow/props/DataflowJobProperties.java | 2 +- examples/pom.xml | 14 ++++++---- pom.xml | 27 ++++++++++++++++--- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java index 9da5aaefe5..ecca126883 100644 --- a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java +++ b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/props/DataflowJobProperties.java @@ -23,7 +23,7 @@ public final class DataflowJobProperties { /** - * Whether use stream mode to process dataflow job. + * Whether to use stream mode to process dataflow job. */ public static final String STREAM_PROCESS_KEY = "streaming.process"; } diff --git a/examples/pom.xml b/examples/pom.xml index b78cec61f1..202e496402 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -38,13 +38,17 @@ 3.1.0-SNAPSHOT 1.8 + 5.1.0 4.3.4.RELEASE - 1.7.7 - 1.2.0 - 2.9.0 + + 1.7.36 + 1.2.12 + + 2.10.0 2.2.224 - 8.0.28 + 8.0.31 + 3.3 1.2.5 @@ -110,7 +114,7 @@ mysql mysql-connector-java - ${mysql.version} + ${mysql-connector-java} diff --git a/pom.xml b/pom.xml index df518fb764..e7d3339cfb 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,12 @@ 5.4.1 + 32.1.2-jre + 3.39.0 + 2.22.0 + 1.3 + 3.12.0 1.16.0 1.3 @@ -82,7 +87,7 @@ 1.18.30 - 8.0.16 + 8.0.31 2.2.224 5.10.0 @@ -140,11 +145,27 @@ ${guava.version} - com.google.j2objc - j2objc-annotations + com.google.guava + listenablefuture + + org.checkerframework + checker-qual + ${checker-qual.version} + + + com.google.errorprone + error_prone_annotations + ${error_prone_annotations.version} + + + com.google.j2objc + j2objc-annotations + ${j2objc-annotations.version} + + org.apache.commons commons-lang3 From 1bdc817c6a81cd0e0ffffc51aec25ec8d7e1f212 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 19:08:40 +0800 Subject: [PATCH 151/178] Refactor HttpParam (#2354) --- .../http/executor/HttpJobExecutor.java | 71 ++++++-------- .../elasticjob/http/pojo/HttpParam.java | 36 ++++++- .../http/executor/HttpJobExecutorTest.java | 22 +---- .../elasticjob/http/pojo/HttpParamTest.java | 93 +++++++++++++++++++ 4 files changed, 156 insertions(+), 66 deletions(-) create mode 100644 ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParamTest.java diff --git a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java index 9d913920cb..19d633c40e 100644 --- a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java +++ b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java @@ -21,14 +21,13 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.http.pojo.HttpParam; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionException; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; import java.io.BufferedReader; import java.io.IOException; @@ -38,8 +37,6 @@ import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.Properties; /** * Http job executor. @@ -49,42 +46,28 @@ public final class HttpJobExecutor implements TypedJobItemExecutor { @Override public void process(final ElasticJob elasticJob, final JobConfiguration jobConfig, final JobRuntimeService jobRuntimeService, final ShardingContext shardingContext) { - HttpParam httpParam = getHttpParam(jobConfig.getProps()); + HttpParam httpParam = new HttpParam(jobConfig.getProps()); HttpURLConnection connection = null; try { - URL url = new URL(httpParam.getUrl()); - connection = (HttpURLConnection) url.openConnection(); - connection.setRequestMethod(httpParam.getMethod()); - connection.setDoOutput(true); - connection.setConnectTimeout(httpParam.getConnectTimeout()); - connection.setReadTimeout(httpParam.getReadTimeout()); - if (!Strings.isNullOrEmpty(httpParam.getContentType())) { - connection.setRequestProperty("Content-Type", httpParam.getContentType()); - } - connection.setRequestProperty(HttpJobProperties.SHARDING_CONTEXT_KEY, GsonFactory.getGson().toJson(shardingContext)); + connection = getHttpURLConnection(httpParam, shardingContext); connection.connect(); String data = httpParam.getData(); - if (isWriteMethod(httpParam.getMethod()) && !Strings.isNullOrEmpty(data)) { + if (httpParam.isWriteMethod() && !Strings.isNullOrEmpty(data)) { try (OutputStream outputStream = connection.getOutputStream()) { outputStream.write(data.getBytes(StandardCharsets.UTF_8)); } } - int code = connection.getResponseCode(); - InputStream resultInputStream; - if (isRequestSucceed(code)) { - resultInputStream = connection.getInputStream(); - } else { - log.warn("HTTP job {} executed with response code {}", jobConfig.getJobName(), code); - resultInputStream = connection.getErrorStream(); - } + int responseCode = connection.getResponseCode(); StringBuilder result = new StringBuilder(); - try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(resultInputStream, StandardCharsets.UTF_8))) { + try ( + InputStream inputStream = getConnectionInputStream(jobConfig.getJobName(), connection, responseCode); + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { String line; while (null != (line = bufferedReader.readLine())) { result.append(line); } } - if (isRequestSucceed(code)) { + if (isRequestSucceed(responseCode)) { log.debug("HTTP job execute result : {}", result); } else { log.warn("HTTP job {} executed with response body {}", jobConfig.getJobName(), result); @@ -98,24 +81,26 @@ public void process(final ElasticJob elasticJob, final JobConfiguration jobConfi } } - private HttpParam getHttpParam(final Properties props) { - String url = props.getProperty(HttpJobProperties.URI_KEY); - if (Strings.isNullOrEmpty(url)) { - throw new JobConfigurationException("Cannot find HTTP URL, job is not executed."); + private HttpURLConnection getHttpURLConnection(final HttpParam httpParam, final ShardingContext shardingContext) throws IOException { + URL url = new URL(httpParam.getUrl()); + HttpURLConnection result = (HttpURLConnection) url.openConnection(); + result.setRequestMethod(httpParam.getMethod()); + result.setDoOutput(true); + result.setConnectTimeout(httpParam.getConnectTimeoutMilliseconds()); + result.setReadTimeout(httpParam.getReadTimeoutMilliseconds()); + if (!Strings.isNullOrEmpty(httpParam.getContentType())) { + result.setRequestProperty("Content-Type", httpParam.getContentType()); } - String method = props.getProperty(HttpJobProperties.METHOD_KEY); - if (Strings.isNullOrEmpty(method)) { - throw new JobConfigurationException("Cannot find HTTP method, job is not executed."); - } - String data = props.getProperty(HttpJobProperties.DATA_KEY); - int connectTimeout = Integer.parseInt(props.getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")); - int readTimeout = Integer.parseInt(props.getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")); - String contentType = props.getProperty(HttpJobProperties.CONTENT_TYPE_KEY); - return new HttpParam(url, method, data, connectTimeout, readTimeout, contentType); + result.setRequestProperty(HttpJobProperties.SHARDING_CONTEXT_KEY, GsonFactory.getGson().toJson(shardingContext)); + return result; } - private boolean isWriteMethod(final String method) { - return Arrays.asList("POST", "PUT", "DELETE").contains(method.toUpperCase()); + private InputStream getConnectionInputStream(final String jobName, final HttpURLConnection connection, final int code) throws IOException { + if (isRequestSucceed(code)) { + return connection.getInputStream(); + } + log.warn("HTTP job {} executed with response code {}", jobName, code); + return connection.getErrorStream(); } private boolean isRequestSucceed(final int httpStatusCode) { diff --git a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java index 6ad4c839c1..f9419dffe9 100644 --- a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java +++ b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParam.java @@ -17,8 +17,14 @@ package org.apache.shardingsphere.elasticjob.http.pojo; +import com.google.common.base.Strings; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; + +import java.util.Arrays; +import java.util.Properties; /** * Http job param. @@ -31,11 +37,35 @@ public final class HttpParam { private final String method; + private final String contentType; + private final String data; - private final int connectTimeout; + private final int connectTimeoutMilliseconds; - private final int readTimeout; + private final int readTimeoutMilliseconds; - private final String contentType; + public HttpParam(final Properties props) { + url = props.getProperty(HttpJobProperties.URI_KEY); + if (Strings.isNullOrEmpty(url)) { + throw new JobConfigurationException("Cannot find HTTP URL, job is not executed."); + } + method = props.getProperty(HttpJobProperties.METHOD_KEY); + if (Strings.isNullOrEmpty(method)) { + throw new JobConfigurationException("Cannot find HTTP method, job is not executed."); + } + contentType = props.getProperty(HttpJobProperties.CONTENT_TYPE_KEY); + data = props.getProperty(HttpJobProperties.DATA_KEY); + connectTimeoutMilliseconds = Integer.parseInt(props.getProperty(HttpJobProperties.CONNECT_TIMEOUT_KEY, "3000")); + readTimeoutMilliseconds = Integer.parseInt(props.getProperty(HttpJobProperties.READ_TIMEOUT_KEY, "5000")); + } + + /** + * Is write method. + * + * @return write method or not + */ + public boolean isWriteMethod() { + return Arrays.asList("POST", "PUT", "DELETE").contains(method.toUpperCase()); + } } diff --git a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 346cf15439..20852386c1 100644 --- a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -19,15 +19,14 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.http.executor.fixture.InternalController; import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionException; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -93,23 +92,6 @@ static void close() { } } - @Test - void assertUrlEmpty() { - assertThrows(JobConfigurationException.class, () -> { - when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(""); - jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); - }); - } - - @Test - void assertMethodEmpty() { - assertThrows(JobConfigurationException.class, () -> { - when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/getName")); - when(jobConfig.getProps().getProperty(HttpJobProperties.METHOD_KEY)).thenReturn(""); - jobExecutor.process(elasticJob, jobConfig, jobRuntimeService, shardingContext); - }); - } - @Test void assertProcessWithoutSuccessCode() { when(jobConfig.getProps().getProperty(HttpJobProperties.URI_KEY)).thenReturn(getRequestUri("/unknownMethod")); diff --git a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParamTest.java b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParamTest.java new file mode 100644 index 0000000000..42a0694fd0 --- /dev/null +++ b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/pojo/HttpParamTest.java @@ -0,0 +1,93 @@ +/* + * 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.elasticjob.http.pojo; + +import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; +import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; +import org.junit.jupiter.api.Test; + +import java.util.Properties; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class HttpParamTest { + + @Test + void assertNewWithEmptyUrl() { + assertThrows(JobConfigurationException.class, () -> new HttpParam(new Properties())); + } + + @Test + void assertNewWithEmptyMethod() { + Properties props = new Properties(); + props.setProperty(HttpJobProperties.URI_KEY, "foo/url"); + assertThrows(JobConfigurationException.class, () -> new HttpParam(props)); + } + + @Test + void assertNew() { + Properties props = new Properties(); + props.setProperty(HttpJobProperties.URI_KEY, "foo/url"); + props.setProperty(HttpJobProperties.METHOD_KEY, "POST"); + HttpParam actual = new HttpParam(props); + assertThat(actual.getUrl(), is("foo/url")); + assertThat(actual.getMethod(), is("POST")); + assertThat(actual.getConnectTimeoutMilliseconds(), is(3000)); + assertThat(actual.getReadTimeoutMilliseconds(), is(5000)); + } + + @Test + void assertIsWriteMethodWithGet() { + Properties props = new Properties(); + props.setProperty(HttpJobProperties.URI_KEY, "foo/url"); + props.setProperty(HttpJobProperties.METHOD_KEY, "GET"); + HttpParam actual = new HttpParam(props); + assertFalse(actual.isWriteMethod()); + } + + @Test + void assertIsWriteMethodWithPost() { + Properties props = new Properties(); + props.setProperty(HttpJobProperties.URI_KEY, "foo/url"); + props.setProperty(HttpJobProperties.METHOD_KEY, "POST"); + HttpParam actual = new HttpParam(props); + assertTrue(actual.isWriteMethod()); + } + + @Test + void assertIsWriteMethodWithPut() { + Properties props = new Properties(); + props.setProperty(HttpJobProperties.URI_KEY, "foo/url"); + props.setProperty(HttpJobProperties.METHOD_KEY, "PUT"); + HttpParam actual = new HttpParam(props); + assertTrue(actual.isWriteMethod()); + } + + @Test + void assertIsWriteMethodWithDelete() { + Properties props = new Properties(); + props.setProperty(HttpJobProperties.URI_KEY, "foo/url"); + props.setProperty(HttpJobProperties.METHOD_KEY, "DELETE"); + HttpParam actual = new HttpParam(props); + assertTrue(actual.isWriteMethod()); + } +} From 2034bfd2ae2c07d0e7c8711ab674e68f3941b0b2 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 20:53:16 +0800 Subject: [PATCH 152/178] Rename TracingStorageFixture (#2355) * Rename TracingStorageFixture * Rename TracingStorageFixture * Rename TracingStorageFixture --- .../rdb/datasource/DataSourceConfiguration.java | 2 +- .../kernel/tracing/JobTracingEventBusTest.java | 10 +++++----- .../TracingStorageConfigurationFixture.java} | 16 +++++----------- .../TracingStorageFixture.java} | 6 +++--- .../TracingStorageFixtureConverter.java} | 15 ++++++--------- .../TestTracingFailureConfiguration.java | 2 +- .../{ => listener}/TestTracingListener.java | 9 +++++---- .../TestTracingListenerConfiguration.java | 7 ++++--- .../TracingStorageConverterFactoryTest.java | 4 ++-- .../yaml/YamlJobEventCallerConfiguration.java | 12 ++++++------ ...YamlJobEventCallerConfigurationConverter.java | 14 ++++++++------ .../YamlTracingConfigurationConverterTest.java | 12 ++++++------ ...tracing.listener.TracingListenerConfiguration | 4 ++-- ...ernel.tracing.storage.TracingStorageConverter | 2 +- 14 files changed, 55 insertions(+), 60 deletions(-) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/{JobEventCallerConfiguration.java => config/TracingStorageConfigurationFixture.java} (75%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/{JobEventCaller.java => config/TracingStorageFixture.java} (93%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/{JobEventCallerConverter.java => config/TracingStorageFixtureConverter.java} (71%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/{ => listener}/TestTracingFailureConfiguration.java (99%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/{ => listener}/TestTracingListener.java (87%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/{ => listener}/TestTracingListenerConfiguration.java (83%) diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java index 1e43e0d966..ec335f101f 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java @@ -40,8 +40,8 @@ /** * Data source configuration. */ -@Getter @RequiredArgsConstructor +@Getter public final class DataSourceConfiguration implements TracingStorageConfiguration { private static final String GETTER_PREFIX = "get"; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java index 664328ba06..72e23cd874 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java @@ -21,8 +21,8 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.TestTracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TestTracingListener; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; @@ -42,7 +42,7 @@ class JobTracingEventBusTest { @Mock - private JobEventCaller jobEventCaller; + private TracingStorageFixture tracingStorage; @Mock private EventBus eventBus; @@ -57,11 +57,11 @@ void assertRegisterFailure() { @Test void assertPost() { - jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("TEST", jobEventCaller)); + jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("TEST", tracingStorage)); assertTrue((Boolean) ReflectionUtils.getFieldValue(jobTracingEventBus, "isRegistered")); jobTracingEventBus.post(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(TestTracingListener::isExecutionEventCalled); - verify(jobEventCaller).call(); + verify(tracingStorage).call(); } @Test diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java similarity index 75% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java index 03e626d0d3..93576263d5 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java @@ -15,21 +15,15 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config; +import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; -/** - * {@link TracingStorageConfiguration} for {@link JobEventCaller}. - */ @RequiredArgsConstructor -public final class JobEventCallerConfiguration implements TracingStorageConfiguration { - - private final JobEventCaller jobEventCaller; +@Getter +public final class TracingStorageConfigurationFixture implements TracingStorageConfiguration { - @Override - public JobEventCaller getStorage() { - return jobEventCaller; - } + private final TracingStorageFixture storage; } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCaller.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixture.java similarity index 93% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCaller.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixture.java index e980ac97c6..c01563f2b1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCaller.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixture.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config; -public interface JobEventCaller { +public interface TracingStorageFixture { /** - * Execute call. + * Call. */ void call(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java similarity index 71% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConverter.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java index 7328f089e9..8ea3d16dc1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/JobEventCallerConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java @@ -15,23 +15,20 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config; import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; -/** - * {@link TracingStorageConverter} for {@link JobEventCaller}. - */ -public final class JobEventCallerConverter implements TracingStorageConverter { +public final class TracingStorageFixtureConverter implements TracingStorageConverter { @Override - public TracingStorageConfiguration convertObjectToConfiguration(final JobEventCaller storage) { - return new JobEventCallerConfiguration(storage); + public TracingStorageConfiguration convertObjectToConfiguration(final TracingStorageFixture storage) { + return new TracingStorageConfigurationFixture(storage); } @Override - public Class storageType() { - return JobEventCaller.class; + public Class storageType() { + return TracingStorageFixture.class; } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingFailureConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingFailureConfiguration.java similarity index 99% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingFailureConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingFailureConfiguration.java index c5f3de380c..7175f02d16 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingFailureConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingFailureConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListener.java similarity index 87% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListener.java index c3b173e16e..85d4375328 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListener.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener; import lombok.Getter; import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; @@ -29,17 +30,17 @@ public final class TestTracingListener implements TracingListener { @Getter private static volatile boolean executionEventCalled; - private final JobEventCaller jobEventCaller; + private final TracingStorageFixture tracingStorageFixture; @Override public void listen(final JobExecutionEvent jobExecutionEvent) { - jobEventCaller.call(); + tracingStorageFixture.call(); executionEventCalled = true; } @Override public void listen(final JobStatusTraceEvent jobStatusTraceEvent) { - jobEventCaller.call(); + tracingStorageFixture.call(); } /** diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListenerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListenerConfiguration.java similarity index 83% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListenerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListenerConfiguration.java index e665257804..238bfc5b33 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/TestTracingListenerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListenerConfiguration.java @@ -15,15 +15,16 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture; +package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; -public final class TestTracingListenerConfiguration implements TracingListenerConfiguration { +public final class TestTracingListenerConfiguration implements TracingListenerConfiguration { @Override - public TracingListener createTracingListener(final JobEventCaller storage) { + public TracingListener createTracingListener(final TracingStorageFixture storage) { return new TestTracingListener(storage); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java index b6a93e14be..e3f7f71255 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.storage; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -27,7 +27,7 @@ class TracingStorageConverterFactoryTest { @Test void assertConverterExists() { - assertTrue(TracingStorageConverterFactory.findConverter(JobEventCaller.class).isPresent()); + assertTrue(TracingStorageConverterFactory.findConverter(TracingStorageFixture.class).isPresent()); } @Test diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java index 267678b1f3..ae9fb238e1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java @@ -20,22 +20,22 @@ import lombok.Getter; import lombok.Setter; import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCallerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageConfigurationFixture; /** * YAML JobEventCaller configuration. */ @Getter @Setter -public final class YamlJobEventCallerConfiguration implements YamlTracingStorageConfiguration { +public final class YamlJobEventCallerConfiguration implements YamlTracingStorageConfiguration { private static final long serialVersionUID = -3152825887223378472L; - private JobEventCaller jobEventCaller; + private TracingStorageFixture tracingStorageFixture; @Override - public TracingStorageConfiguration toConfiguration() { - return new JobEventCallerConfiguration(jobEventCaller); + public TracingStorageConfiguration toConfiguration() { + return new TracingStorageConfigurationFixture(tracingStorageFixture); } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java index 9a385de01b..89394eb7ea 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java @@ -19,24 +19,26 @@ import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCallerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageConfigurationFixture; /** * YAML JobEventCaller configuration converter. */ @SuppressWarnings({"unchecked", "rawtypes"}) -public final class YamlJobEventCallerConfigurationConverter implements YamlConfigurationConverter, YamlTracingStorageConfiguration> { +public final class YamlJobEventCallerConfigurationConverter + implements + YamlConfigurationConverter, YamlTracingStorageConfiguration> { @Override - public YamlTracingStorageConfiguration convertToYamlConfiguration(final TracingStorageConfiguration data) { + public YamlTracingStorageConfiguration convertToYamlConfiguration(final TracingStorageConfiguration data) { YamlJobEventCallerConfiguration result = new YamlJobEventCallerConfiguration(); - result.setJobEventCaller(data.getStorage()); + result.setTracingStorageFixture(data.getStorage()); return result; } @Override public Class getType() { - return JobEventCallerConfiguration.class; + return TracingStorageConfigurationFixture.class; } } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java index f371b29bfb..acb9312ada 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCaller; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -30,15 +30,15 @@ class YamlTracingConfigurationConverterTest { @Test void assertConvertTracingConfiguration() { - JobEventCaller expectedStorage = () -> { + TracingStorageFixture expectedStorage = () -> { }; - TracingConfiguration tracingConfig = new TracingConfiguration<>("TEST", expectedStorage); - YamlTracingConfigurationConverter converter = new YamlTracingConfigurationConverter<>(); - YamlTracingConfiguration actual = converter.convertToYamlConfiguration(tracingConfig); + TracingConfiguration tracingConfig = new TracingConfiguration<>("TEST", expectedStorage); + YamlTracingConfigurationConverter converter = new YamlTracingConfigurationConverter<>(); + YamlTracingConfiguration actual = converter.convertToYamlConfiguration(tracingConfig); assertThat(actual.getType(), is("TEST")); assertNotNull(actual.getTracingStorageConfiguration()); assertTrue(actual.getTracingStorageConfiguration() instanceof YamlJobEventCallerConfiguration); YamlJobEventCallerConfiguration result = (YamlJobEventCallerConfiguration) actual.getTracingStorageConfiguration(); - assertThat(result.getJobEventCaller(), is(expectedStorage)); + assertThat(result.getTracingStorageFixture(), is(expectedStorage)); } } diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration index e96753af53..24e9ed4f63 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration @@ -15,5 +15,5 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.TestTracingListenerConfiguration -org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.TestTracingFailureConfiguration +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TestTracingListenerConfiguration +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TestTracingFailureConfiguration diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter index 5a448e5588..2e11a5dec6 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.JobEventCallerConverter +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixtureConverter From 8d45e6f5d8c1842d89f7f02ba9b79fc9347d98a1 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 21:27:00 +0800 Subject: [PATCH 153/178] Refactor structure of tracing module (#2356) * Rename RDBTracingStorageConfiguration * Refactor structure of tracing module * Refactor structure of tracing module * Refactor structure of tracing module --- .../RDBTracingStorageConfiguration.java} | 28 +-- .../rdb/listener/RDBTracingListener.java | 6 +- .../RDBTracingStorageConverter.java} | 14 +- .../datasource/DataSourceRegistry.java | 21 +- .../datasource/JDBCParameterDecorator.java | 2 +- .../RDBJobEventRepository.java} | 185 ++++++++---------- .../{ => sql}/RDBStorageSQLMapper.java | 2 +- .../{ => sql}/SQLPropertiesFactory.java | 4 +- .../type/TracingStorageDatabaseType.java | 2 +- .../impl/DB2TracingStorageDatabaseType.java | 4 +- .../DefaultTracingStorageDatabaseType.java | 4 +- .../impl/H2TracingStorageDatabaseType.java | 4 +- .../impl/MySQLTracingStorageDatabaseType.java | 4 +- .../OracleTracingStorageDatabaseType.java | 4 +- .../PostgreSQLTracingStorageDatabaseType.java | 4 +- .../SQLServerTracingStorageDatabaseType.java | 4 +- .../rdb/yaml/YamlDataSourceConfiguration.java | 6 +- .../YamlDataSourceConfigurationConverter.java | 8 +- ...el.tracing.storage.TracingStorageConverter | 2 +- ...b.storage.type.TracingStorageDatabaseType} | 12 +- .../RDBTracingStorageConfigurationTest.java} | 32 +-- .../rdb/listener/RDBTracingListenerTest.java | 8 +- .../RDBTracingStorageConverterTest.java} | 12 +- .../datasource/DataSourceRegistryTest.java | 7 +- .../RDBJobEventRepositoryTest.java} | 61 ++---- ...ingStorageConfigurationConverterTest.java} | 6 +- .../rdb/src/test/resources/logback-test.xml | 2 +- .../elasticjob/example/JavaMain.java | 2 +- .../kernel/executor/facade/JobFacade.java | 4 +- .../internal/schedule/JobScheduler.java | 2 +- .../{api => config}/TracingConfiguration.java | 4 +- .../TracingStorageConfiguration.java | 2 +- .../{ => event}/JobTracingEventBus.java | 5 +- .../storage/TracingStorageConverter.java | 4 +- .../yaml/YamlTracingConfiguration.java | 2 +- .../YamlTracingConfigurationConverter.java | 4 +- .../yaml/YamlTracingStorageConfiguration.java | 2 +- .../kernel/executor/facade/JobFacadeTest.java | 2 +- .../{ => event}/JobTracingEventBusTest.java | 6 +- .../TracingStorageConfigurationFixture.java | 2 +- .../TracingStorageFixtureConverter.java | 4 +- .../yaml/YamlJobEventCallerConfiguration.java | 2 +- ...lJobEventCallerConfigurationConverter.java | 4 +- ...YamlTracingConfigurationConverterTest.java | 2 +- kernel/src/test/resources/logback-test.xml | 2 +- .../job/ElasticJobBootstrapConfiguration.java | 2 +- .../ElasticJobTracingConfiguration.java | 2 +- .../boot/job/ElasticJobSpringBootTest.java | 2 +- .../tracing/TracingConfigurationTest.java | 2 +- .../parser/TracingBeanDefinitionParser.java | 2 +- 50 files changed, 232 insertions(+), 281 deletions(-) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{datasource/DataSourceConfiguration.java => config/RDBTracingStorageConfiguration.java} (86%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{datasource/DataSourceTracingStorageConverter.java => storage/converter/RDBTracingStorageConverter.java} (70%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/datasource/DataSourceRegistry.java (66%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/datasource/JDBCParameterDecorator.java (94%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/{RDBJobEventStorage.java => repository/RDBJobEventRepository.java} (63%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/{ => sql}/RDBStorageSQLMapper.java (99%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/{ => sql}/SQLPropertiesFactory.java (95%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/TracingStorageDatabaseType.java (95%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/impl/DB2TracingStorageDatabaseType.java (86%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/impl/DefaultTracingStorageDatabaseType.java (86%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/impl/H2TracingStorageDatabaseType.java (86%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/impl/MySQLTracingStorageDatabaseType.java (86%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/impl/OracleTracingStorageDatabaseType.java (86%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/impl/PostgreSQLTracingStorageDatabaseType.java (86%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/type/impl/SQLServerTracingStorageDatabaseType.java (87%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType => org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType} (56%) rename ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{datasource/DataSourceConfigurationTest.java => config/RDBTracingStorageConfigurationTest.java} (77%) rename ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{datasource/DataSourceTracingStorageConverterTest.java => storage/converter/RDBTracingStorageConverterTest.java} (85%) rename ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/{ => storage}/datasource/DataSourceRegistryTest.java (87%) rename ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/{RDBJobEventStorageTest.java => repository/RDBJobEventRepositoryTest.java} (61%) rename ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/{YamlDataSourceConfigurationConverterTest.java => YamlRDBTracingStorageConfigurationConverterTest.java} (87%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/{api => config}/TracingConfiguration.java (92%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/{api => config}/TracingStorageConfiguration.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/{ => event}/JobTracingEventBus.java (94%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/{ => event}/JobTracingEventBusTest.java (91%) diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfiguration.java similarity index 86% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfiguration.java index ec335f101f..7d80065e9d 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +package org.apache.shardingsphere.elasticjob.tracing.rdb.config; import com.google.common.base.CaseFormat; import com.google.common.base.Joiner; @@ -24,7 +24,9 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource.DataSourceRegistry; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource.JDBCParameterDecorator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import javax.sql.DataSource; @@ -38,11 +40,11 @@ import java.util.Optional; /** - * Data source configuration. + * RDB tracing storage configuration. */ @RequiredArgsConstructor @Getter -public final class DataSourceConfiguration implements TracingStorageConfiguration { +public final class RDBTracingStorageConfiguration implements TracingStorageConfiguration { private static final String GETTER_PREFIX = "get"; @@ -67,8 +69,8 @@ public final class DataSourceConfiguration implements TracingStorageConfiguratio * @param dataSource data source * @return data source configuration */ - public static DataSourceConfiguration getDataSourceConfiguration(final DataSource dataSource) { - DataSourceConfiguration result = new DataSourceConfiguration(dataSource.getClass().getName()); + public static RDBTracingStorageConfiguration getDataSourceConfiguration(final DataSource dataSource) { + RDBTracingStorageConfiguration result = new RDBTracingStorageConfiguration(dataSource.getClass().getName()); result.props.putAll(findAllGetterProperties(dataSource)); return result; } @@ -97,11 +99,6 @@ private static Collection findAllGetterMethods(final Class clazz) { return result; } - @Override - public DataSource getStorage() { - return DataSourceRegistry.getInstance().getDataSource(this); - } - /** * Create data source. * @@ -135,12 +132,17 @@ private Optional findSetterMethod(final Method[] methods, final String p return Optional.empty(); } + @Override + public DataSource getStorage() { + return DataSourceRegistry.getInstance().getDataSource(this); + } + @Override public boolean equals(final Object obj) { - return this == obj || null != obj && getClass() == obj.getClass() && equalsByProperties((DataSourceConfiguration) obj); + return this == obj || null != obj && getClass() == obj.getClass() && equalsByProperties((RDBTracingStorageConfiguration) obj); } - private boolean equalsByProperties(final DataSourceConfiguration dataSourceConfig) { + private boolean equalsByProperties(final RDBTracingStorageConfiguration dataSourceConfig) { return dataSourceClassName.equals(dataSourceConfig.dataSourceClassName) && props.equals(dataSourceConfig.props); } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java index 2e1e3a31b2..448905610d 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java @@ -20,7 +20,7 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository; import javax.sql.DataSource; import java.sql.SQLException; @@ -30,10 +30,10 @@ */ public final class RDBTracingListener implements TracingListener { - private final RDBJobEventStorage repository; + private final RDBJobEventRepository repository; public RDBTracingListener(final DataSource dataSource) throws SQLException { - repository = RDBJobEventStorage.getInstance(dataSource); + repository = RDBJobEventRepository.getInstance(dataSource); } @Override diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverter.java similarity index 70% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverter.java index b3a1c6fdab..6cb81c55c1 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverter.java @@ -15,32 +15,34 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource.DataSourceRegistry; import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; /** - * {@link TracingStorageConverter} for {@link DataSource}. + * RDB tracing storage converter. */ @Slf4j -public final class DataSourceTracingStorageConverter implements TracingStorageConverter { +public final class RDBTracingStorageConverter implements TracingStorageConverter { @Override - public TracingStorageConfiguration convertObjectToConfiguration(final DataSource dataSource) { + public TracingStorageConfiguration convertToConfiguration(final DataSource dataSource) { try (Connection connection = dataSource.getConnection()) { log.trace("Try to get connection from {}", connection.getMetaData().getURL()); } catch (final SQLException ex) { log.error(ex.getLocalizedMessage(), ex); throw new TracingStorageUnavailableException(ex); } - DataSourceConfiguration result = DataSourceConfiguration.getDataSourceConfiguration(dataSource); + RDBTracingStorageConfiguration result = RDBTracingStorageConfiguration.getDataSourceConfiguration(dataSource); DataSourceRegistry.getInstance().registerDataSource(result, dataSource); return result; } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/DataSourceRegistry.java similarity index 66% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/DataSourceRegistry.java index 518954e388..a80e9fb880 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistry.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/DataSourceRegistry.java @@ -15,24 +15,25 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource; import lombok.AccessLevel; import lombok.NoArgsConstructor; +import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; import javax.sql.DataSource; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** - * Mapping tracing storage configuration} to data source. + * Mapping tracing storage configuration to data source. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class DataSourceRegistry { private static volatile DataSourceRegistry instance; - private final ConcurrentMap dataSources = new ConcurrentHashMap<>(); + private final ConcurrentMap dataSources = new ConcurrentHashMap<>(); /** * Get instance of {@link DataSourceRegistry}. @@ -50,17 +51,23 @@ public static DataSourceRegistry getInstance() { return instance; } - void registerDataSource(final DataSourceConfiguration dataSourceConfig, final DataSource dataSource) { + /** + * Register data source. + * + * @param dataSourceConfig data source configuration + * @param dataSource data source + */ + public void registerDataSource(final RDBTracingStorageConfiguration dataSourceConfig, final DataSource dataSource) { dataSources.putIfAbsent(dataSourceConfig, dataSource); } /** - * Get {@link DataSource} by {@link DataSourceConfiguration}. + * Get {@link DataSource} by {@link RDBTracingStorageConfiguration}. * * @param dataSourceConfig data source configuration * @return instance of {@link DataSource} */ - public DataSource getDataSource(final DataSourceConfiguration dataSourceConfig) { - return dataSources.computeIfAbsent(dataSourceConfig, DataSourceConfiguration::createDataSource); + public DataSource getDataSource(final RDBTracingStorageConfiguration dataSourceConfig) { + return dataSources.computeIfAbsent(dataSourceConfig, RDBTracingStorageConfiguration::createDataSource); } } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/JDBCParameterDecorator.java similarity index 94% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/JDBCParameterDecorator.java index e924b01eff..a56efce299 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/JDBCParameterDecorator.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/JDBCParameterDecorator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java similarity index 63% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java index f59ea96e66..01124317db 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java @@ -15,17 +15,18 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository; import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.WrapException; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DefaultTracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.RDBStorageSQLMapper; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.SQLPropertiesFactory; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.DefaultTracingStorageDatabaseType; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; import javax.sql.DataSource; @@ -35,20 +36,16 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; /** - * RDB job event storage. + * RDB job event repository. */ @Slf4j -public final class RDBJobEventStorage { +public final class RDBJobEventRepository { private static final String TABLE_JOB_EXECUTION_LOG = "JOB_EXECUTION_LOG"; @@ -56,7 +53,7 @@ public final class RDBJobEventStorage { private static final String TASK_ID_STATE_INDEX = "TASK_ID_STATE_INDEX"; - private static final Map STORAGE_MAP = new ConcurrentHashMap<>(); + private static final Map STORAGE_MAP = new ConcurrentHashMap<>(); private final DataSource dataSource; @@ -64,7 +61,7 @@ public final class RDBJobEventStorage { private final RDBStorageSQLMapper sqlMapper; - private RDBJobEventStorage(final DataSource dataSource) throws SQLException { + private RDBJobEventRepository(final DataSource dataSource) throws SQLException { this.dataSource = dataSource; tracingStorageDatabaseType = getTracingStorageDatabaseType(dataSource); sqlMapper = new RDBStorageSQLMapper(SQLPropertiesFactory.getProperties(tracingStorageDatabaseType)); @@ -78,24 +75,17 @@ private RDBJobEventStorage(final DataSource dataSource) throws SQLException { * @return RDBJobEventStorage instance * @throws SQLException SQLException */ - public static RDBJobEventStorage getInstance(final DataSource dataSource) throws SQLException { + public static RDBJobEventRepository getInstance(final DataSource dataSource) throws SQLException { return wrapException(() -> STORAGE_MAP.computeIfAbsent(dataSource, ds -> { try { - return new RDBJobEventStorage(ds); + return new RDBJobEventRepository(ds); } catch (final SQLException ex) { throw new WrapException(ex); } })); } - /** - * WrapException util method. - * - * @param supplier supplier - * @return RDBJobEventStorage - * @throws SQLException SQLException - */ - public static RDBJobEventStorage wrapException(final Supplier supplier) throws SQLException { + private static RDBJobEventRepository wrapException(final Supplier supplier) throws SQLException { try { return supplier.get(); } catch (final WrapException ex) { @@ -187,35 +177,35 @@ private void createTaskIdAndStateIndex(final Connection connection) throws SQLEx /** * Add job execution event. * - * @param jobExecutionEvent job execution event + * @param event job execution event * @return add success or not */ - public boolean addJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { - if (null == jobExecutionEvent.getCompleteTime()) { - return insertJobExecutionEvent(jobExecutionEvent); + public boolean addJobExecutionEvent(final JobExecutionEvent event) { + if (null == event.getCompleteTime()) { + return insertJobExecutionEvent(event); } else { - if (jobExecutionEvent.isSuccess()) { - return updateJobExecutionEventWhenSuccess(jobExecutionEvent); + if (event.isSuccess()) { + return updateJobExecutionEventWhenSuccess(event); } else { - return updateJobExecutionEventFailure(jobExecutionEvent); + return updateJobExecutionEventFailure(event); } } } - private boolean insertJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) { + private boolean insertJobExecutionEvent(final JobExecutionEvent event) { boolean result = false; try ( Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getInsertForJobExecutionLog())) { - preparedStatement.setString(1, jobExecutionEvent.getId()); - preparedStatement.setString(2, jobExecutionEvent.getJobName()); - preparedStatement.setString(3, jobExecutionEvent.getTaskId()); - preparedStatement.setString(4, jobExecutionEvent.getHostname()); - preparedStatement.setString(5, jobExecutionEvent.getIp()); - preparedStatement.setInt(6, jobExecutionEvent.getShardingItem()); - preparedStatement.setString(7, jobExecutionEvent.getSource().toString()); - preparedStatement.setBoolean(8, jobExecutionEvent.isSuccess()); - preparedStatement.setTimestamp(9, new Timestamp(jobExecutionEvent.getStartTime().getTime())); + preparedStatement.setString(1, event.getId()); + preparedStatement.setString(2, event.getJobName()); + preparedStatement.setString(3, event.getTaskId()); + preparedStatement.setString(4, event.getHostname()); + preparedStatement.setString(5, event.getIp()); + preparedStatement.setInt(6, event.getShardingItem()); + preparedStatement.setString(7, event.getSource().toString()); + preparedStatement.setBoolean(8, event.isSuccess()); + preparedStatement.setTimestamp(9, new Timestamp(event.getStartTime().getTime())); preparedStatement.execute(); result = true; } catch (final SQLException ex) { @@ -227,16 +217,16 @@ private boolean insertJobExecutionEvent(final JobExecutionEvent jobExecutionEven return result; } - private boolean updateJobExecutionEventWhenSuccess(final JobExecutionEvent jobExecutionEvent) { + private boolean updateJobExecutionEventWhenSuccess(final JobExecutionEvent event) { boolean result = false; try ( Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getUpdateForJobExecutionLog())) { - preparedStatement.setBoolean(1, jobExecutionEvent.isSuccess()); - preparedStatement.setTimestamp(2, new Timestamp(jobExecutionEvent.getCompleteTime().getTime())); - preparedStatement.setString(3, jobExecutionEvent.getId()); + preparedStatement.setBoolean(1, event.isSuccess()); + preparedStatement.setTimestamp(2, new Timestamp(event.getCompleteTime().getTime())); + preparedStatement.setString(3, event.getId()); if (0 == preparedStatement.executeUpdate()) { - return insertJobExecutionEventWhenSuccess(jobExecutionEvent); + return insertJobExecutionEventWhenSuccess(event); } result = true; } catch (final SQLException ex) { @@ -246,26 +236,26 @@ private boolean updateJobExecutionEventWhenSuccess(final JobExecutionEvent jobEx return result; } - private boolean insertJobExecutionEventWhenSuccess(final JobExecutionEvent jobExecutionEvent) { + private boolean insertJobExecutionEventWhenSuccess(final JobExecutionEvent event) { boolean result = false; try ( Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getInsertForJobExecutionLogForComplete())) { - preparedStatement.setString(1, jobExecutionEvent.getId()); - preparedStatement.setString(2, jobExecutionEvent.getJobName()); - preparedStatement.setString(3, jobExecutionEvent.getTaskId()); - preparedStatement.setString(4, jobExecutionEvent.getHostname()); - preparedStatement.setString(5, jobExecutionEvent.getIp()); - preparedStatement.setInt(6, jobExecutionEvent.getShardingItem()); - preparedStatement.setString(7, jobExecutionEvent.getSource().toString()); - preparedStatement.setBoolean(8, jobExecutionEvent.isSuccess()); - preparedStatement.setTimestamp(9, new Timestamp(jobExecutionEvent.getStartTime().getTime())); - preparedStatement.setTimestamp(10, new Timestamp(jobExecutionEvent.getCompleteTime().getTime())); + preparedStatement.setString(1, event.getId()); + preparedStatement.setString(2, event.getJobName()); + preparedStatement.setString(3, event.getTaskId()); + preparedStatement.setString(4, event.getHostname()); + preparedStatement.setString(5, event.getIp()); + preparedStatement.setInt(6, event.getShardingItem()); + preparedStatement.setString(7, event.getSource().toString()); + preparedStatement.setBoolean(8, event.isSuccess()); + preparedStatement.setTimestamp(9, new Timestamp(event.getStartTime().getTime())); + preparedStatement.setTimestamp(10, new Timestamp(event.getCompleteTime().getTime())); preparedStatement.execute(); result = true; } catch (final SQLException ex) { if (isDuplicateRecord(ex)) { - return updateJobExecutionEventWhenSuccess(jobExecutionEvent); + return updateJobExecutionEventWhenSuccess(event); } // TODO log failure directly to output log, consider to be configurable in the future log.error(ex.getMessage()); @@ -273,17 +263,17 @@ private boolean insertJobExecutionEventWhenSuccess(final JobExecutionEvent jobEx return result; } - private boolean updateJobExecutionEventFailure(final JobExecutionEvent jobExecutionEvent) { + private boolean updateJobExecutionEventFailure(final JobExecutionEvent event) { boolean result = false; try ( Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getUpdateForJobExecutionLogForFailure())) { - preparedStatement.setBoolean(1, jobExecutionEvent.isSuccess()); - preparedStatement.setTimestamp(2, new Timestamp(jobExecutionEvent.getCompleteTime().getTime())); - preparedStatement.setString(3, truncateString(jobExecutionEvent.getFailureCause())); - preparedStatement.setString(4, jobExecutionEvent.getId()); + preparedStatement.setBoolean(1, event.isSuccess()); + preparedStatement.setTimestamp(2, new Timestamp(event.getCompleteTime().getTime())); + preparedStatement.setString(3, truncateString(event.getFailureCause())); + preparedStatement.setString(4, event.getId()); if (0 == preparedStatement.executeUpdate()) { - return insertJobExecutionEventWhenFailure(jobExecutionEvent); + return insertJobExecutionEventWhenFailure(event); } result = true; } catch (final SQLException ex) { @@ -293,26 +283,26 @@ private boolean updateJobExecutionEventFailure(final JobExecutionEvent jobExecut return result; } - private boolean insertJobExecutionEventWhenFailure(final JobExecutionEvent jobExecutionEvent) { + private boolean insertJobExecutionEventWhenFailure(final JobExecutionEvent event) { boolean result = false; try ( Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getInsertForJobExecutionLogForFailure())) { - preparedStatement.setString(1, jobExecutionEvent.getId()); - preparedStatement.setString(2, jobExecutionEvent.getJobName()); - preparedStatement.setString(3, jobExecutionEvent.getTaskId()); - preparedStatement.setString(4, jobExecutionEvent.getHostname()); - preparedStatement.setString(5, jobExecutionEvent.getIp()); - preparedStatement.setInt(6, jobExecutionEvent.getShardingItem()); - preparedStatement.setString(7, jobExecutionEvent.getSource().toString()); - preparedStatement.setString(8, truncateString(jobExecutionEvent.getFailureCause())); - preparedStatement.setBoolean(9, jobExecutionEvent.isSuccess()); - preparedStatement.setTimestamp(10, new Timestamp(jobExecutionEvent.getStartTime().getTime())); + preparedStatement.setString(1, event.getId()); + preparedStatement.setString(2, event.getJobName()); + preparedStatement.setString(3, event.getTaskId()); + preparedStatement.setString(4, event.getHostname()); + preparedStatement.setString(5, event.getIp()); + preparedStatement.setInt(6, event.getShardingItem()); + preparedStatement.setString(7, event.getSource().toString()); + preparedStatement.setString(8, truncateString(event.getFailureCause())); + preparedStatement.setBoolean(9, event.isSuccess()); + preparedStatement.setTimestamp(10, new Timestamp(event.getStartTime().getTime())); preparedStatement.execute(); result = true; } catch (final SQLException ex) { if (isDuplicateRecord(ex)) { - return updateJobExecutionEventFailure(jobExecutionEvent); + return updateJobExecutionEventFailure(event); } // TODO log failure directly to output log, consider to be configurable in the future log.error(ex.getMessage()); @@ -327,28 +317,28 @@ private boolean isDuplicateRecord(final SQLException ex) { /** * Add job status trace event. * - * @param jobStatusTraceEvent job status trace event + * @param event job status trace event * @return add success or not */ - public boolean addJobStatusTraceEvent(final JobStatusTraceEvent jobStatusTraceEvent) { - String originalTaskId = jobStatusTraceEvent.getOriginalTaskId(); - if (State.TASK_STAGING != jobStatusTraceEvent.getState()) { - originalTaskId = getOriginalTaskId(jobStatusTraceEvent.getTaskId()); + public boolean addJobStatusTraceEvent(final JobStatusTraceEvent event) { + String originalTaskId = event.getOriginalTaskId(); + if (State.TASK_STAGING != event.getState()) { + originalTaskId = getOriginalTaskId(event.getTaskId()); } boolean result = false; try ( Connection connection = dataSource.getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getInsertForJobStatusTraceLog())) { preparedStatement.setString(1, UUID.randomUUID().toString()); - preparedStatement.setString(2, jobStatusTraceEvent.getJobName()); + preparedStatement.setString(2, event.getJobName()); preparedStatement.setString(3, originalTaskId); - preparedStatement.setString(4, jobStatusTraceEvent.getTaskId()); - preparedStatement.setString(5, jobStatusTraceEvent.getSlaveId()); - preparedStatement.setString(6, jobStatusTraceEvent.getExecutionType().name()); - preparedStatement.setString(7, jobStatusTraceEvent.getShardingItems()); - preparedStatement.setString(8, jobStatusTraceEvent.getState().toString()); - preparedStatement.setString(9, truncateString(jobStatusTraceEvent.getMessage())); - preparedStatement.setTimestamp(10, new Timestamp(jobStatusTraceEvent.getCreationTime().getTime())); + preparedStatement.setString(4, event.getTaskId()); + preparedStatement.setString(5, event.getSlaveId()); + preparedStatement.setString(6, event.getExecutionType().name()); + preparedStatement.setString(7, event.getShardingItems()); + preparedStatement.setString(8, event.getState().toString()); + preparedStatement.setString(9, truncateString(event.getMessage())); + preparedStatement.setTimestamp(10, new Timestamp(event.getCreationTime().getTime())); preparedStatement.execute(); result = true; } catch (final SQLException ex) { @@ -379,25 +369,4 @@ private String getOriginalTaskId(final String taskId) { private String truncateString(final String str) { return !Strings.isNullOrEmpty(str) && str.length() > 4000 ? str.substring(0, 4000) : str; } - - List getJobStatusTraceEvents(final String taskId) { - List result = new ArrayList<>(); - try ( - Connection connection = dataSource.getConnection(); - PreparedStatement preparedStatement = connection.prepareStatement(sqlMapper.getSelectForJobStatusTraceLog())) { - preparedStatement.setString(1, taskId); - try (ResultSet resultSet = preparedStatement.executeQuery()) { - while (resultSet.next()) { - JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(resultSet.getString(1), resultSet.getString(2), resultSet.getString(3), resultSet.getString(4), - resultSet.getString(5), ExecutionType.valueOf(resultSet.getString(6)), resultSet.getString(7), - State.valueOf(resultSet.getString(8)), resultSet.getString(9), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(resultSet.getString(10))); - result.add(jobStatusTraceEvent); - } - } - } catch (final SQLException | ParseException ex) { - // TODO log failure directly to output log, consider to be configurable in the future - log.error(ex.getMessage()); - } - return result; - } } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/sql/RDBStorageSQLMapper.java similarity index 99% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/sql/RDBStorageSQLMapper.java index 278b26d597..c223bed436 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/sql/RDBStorageSQLMapper.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql; import lombok.Getter; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/SQLPropertiesFactory.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/sql/SQLPropertiesFactory.java similarity index 95% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/SQLPropertiesFactory.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/sql/SQLPropertiesFactory.java index 8732e74593..33607ec7d9 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/SQLPropertiesFactory.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/sql/SQLPropertiesFactory.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; import java.io.IOException; import java.io.InputStream; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/TracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/TracingStorageDatabaseType.java similarity index 95% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/TracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/TracingStorageDatabaseType.java index 2130cd02c2..af1dde60fe 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/TracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/TracingStorageDatabaseType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2TracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/DB2TracingStorageDatabaseType.java similarity index 86% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2TracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/DB2TracingStorageDatabaseType.java index 40dad660a4..93aa2f9395 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2TracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/DB2TracingStorageDatabaseType.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; /** * Tracing storage database type for DB2. diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultTracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/DefaultTracingStorageDatabaseType.java similarity index 86% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultTracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/DefaultTracingStorageDatabaseType.java index 01a2ecd405..2c8ef3e54a 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DefaultTracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/DefaultTracingStorageDatabaseType.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; /** * Default tracing storage database type. diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2TracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/H2TracingStorageDatabaseType.java similarity index 86% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2TracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/H2TracingStorageDatabaseType.java index 7402b0a474..3f6f129d9c 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2TracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/H2TracingStorageDatabaseType.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; /** * Tracing storage database type for H2. diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLTracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/MySQLTracingStorageDatabaseType.java similarity index 86% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLTracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/MySQLTracingStorageDatabaseType.java index 7d691a6a20..bbd234a2e7 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLTracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/MySQLTracingStorageDatabaseType.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; /** * Tracing storage database type for MySQL. diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleTracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/OracleTracingStorageDatabaseType.java similarity index 86% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleTracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/OracleTracingStorageDatabaseType.java index 804902a2d9..8729f3b309 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleTracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/OracleTracingStorageDatabaseType.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; /** * Tracing storage database type for Oracle. diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLTracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/PostgreSQLTracingStorageDatabaseType.java similarity index 86% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLTracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/PostgreSQLTracingStorageDatabaseType.java index c0ade9b555..85a7e48726 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLTracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/PostgreSQLTracingStorageDatabaseType.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; /** * Tracing storage database type for PostgreSQL. diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerTracingStorageDatabaseType.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/SQLServerTracingStorageDatabaseType.java similarity index 87% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerTracingStorageDatabaseType.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/SQLServerTracingStorageDatabaseType.java index a93b9e3712..11e7500fb6 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerTracingStorageDatabaseType.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/type/impl/SQLServerTracingStorageDatabaseType.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl; -import org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; /** * Tracing storage database type for SQLServer. diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java index 0f7c36c503..1c8a89471c 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java @@ -19,9 +19,9 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; +import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; import javax.sql.DataSource; import java.util.LinkedHashMap; @@ -42,7 +42,7 @@ public final class YamlDataSourceConfiguration implements YamlTracingStorageConf @Override public TracingStorageConfiguration toConfiguration() { - DataSourceConfiguration result = new DataSourceConfiguration(dataSourceClassName); + RDBTracingStorageConfiguration result = new RDBTracingStorageConfiguration(dataSourceClassName); result.getProps().putAll(props); return result; } diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java index c49481f590..d995f363d6 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; +import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; import javax.sql.DataSource; @@ -32,7 +32,7 @@ public final class YamlDataSourceConfigurationConverter implements YamlConfigura @Override public YamlTracingStorageConfiguration convertToYamlConfiguration(final TracingStorageConfiguration data) { - DataSourceConfiguration dataSourceConfig = (DataSourceConfiguration) data; + RDBTracingStorageConfiguration dataSourceConfig = (RDBTracingStorageConfiguration) data; YamlDataSourceConfiguration result = new YamlDataSourceConfiguration(); result.setDataSourceClassName(dataSourceConfig.getDataSourceClassName()); result.setProps(dataSourceConfig.getProps()); @@ -41,6 +41,6 @@ public YamlTracingStorageConfiguration convertToYamlConfiguration(fi @Override public Class getType() { - return DataSourceConfiguration.class; + return RDBTracingStorageConfiguration.class; } } diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter index 97410b55d7..a4db540327 100644 --- a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter +++ b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceTracingStorageConverter +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConverter diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType similarity index 56% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType index aa7a3c3f89..a2b209dc3c 100644 --- a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.TracingStorageDatabaseType +++ b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType @@ -15,9 +15,9 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.MySQLTracingStorageDatabaseType -org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.PostgreSQLTracingStorageDatabaseType -org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.OracleTracingStorageDatabaseType -org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.SQLServerTracingStorageDatabaseType -org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DB2TracingStorageDatabaseType -org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.H2TracingStorageDatabaseType +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.MySQLTracingStorageDatabaseType +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.PostgreSQLTracingStorageDatabaseType +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.OracleTracingStorageDatabaseType +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.SQLServerTracingStorageDatabaseType +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.DB2TracingStorageDatabaseType +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.H2TracingStorageDatabaseType diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfigurationTest.java similarity index 77% rename from ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfigurationTest.java index b8ddd1e149..2ba5f83811 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceConfigurationTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfigurationTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +package org.apache.shardingsphere.elasticjob.tracing.rdb.config; import com.zaxxer.hikari.HikariDataSource; import org.apache.commons.dbcp2.BasicDataSource; @@ -35,7 +35,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNull; -class DataSourceConfigurationTest { +class RDBTracingStorageConfigurationTest { @Test void assertGetDataSourceConfiguration() throws SQLException { @@ -45,7 +45,7 @@ void assertGetDataSourceConfiguration() throws SQLException { actualDataSource.setUsername("root"); actualDataSource.setPassword("root"); actualDataSource.setLoginTimeout(1); - DataSourceConfiguration actual = DataSourceConfiguration.getDataSourceConfiguration(actualDataSource); + RDBTracingStorageConfiguration actual = RDBTracingStorageConfiguration.getDataSourceConfiguration(actualDataSource); assertThat(actual.getDataSourceClassName(), is(HikariDataSource.class.getName())); assertThat(actual.getProps().get("driverClassName").toString(), is("org.h2.Driver")); assertThat(actual.getProps().get("jdbcUrl").toString(), is("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL")); @@ -63,7 +63,7 @@ void assertCreateDataSource() { props.put("password", "root"); props.put("loginTimeout", "5000"); props.put("test", "test"); - DataSourceConfiguration dataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration dataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); dataSourceConfig.getProps().putAll(props); HikariDataSource actual = (HikariDataSource) dataSourceConfig.createDataSource(); assertThat(actual.getDriverClassName(), is("org.h2.Driver")); @@ -74,8 +74,8 @@ void assertCreateDataSource() { @Test void assertEquals() { - DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); - DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration originalDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration targetDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); assertThat(originalDataSourceConfig, is(originalDataSourceConfig)); assertThat(originalDataSourceConfig, is(targetDataSourceConfig)); originalDataSourceConfig.getProps().put("username", "root"); @@ -85,8 +85,8 @@ void assertEquals() { @Test void assertNotEquals() { - DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); - DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration originalDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration targetDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); originalDataSourceConfig.getProps().put("username", "root"); targetDataSourceConfig.getProps().put("username", "root0"); assertThat(originalDataSourceConfig, not(targetDataSourceConfig)); @@ -94,13 +94,13 @@ void assertNotEquals() { @Test void assertEqualsWithNull() { - assertFalse(new DataSourceConfiguration(HikariDataSource.class.getName()).equals(null)); + assertFalse(new RDBTracingStorageConfiguration(HikariDataSource.class.getName()).equals(null)); } @Test void assertSameHashCode() { - DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); - DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration originalDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration targetDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); assertThat(originalDataSourceConfig.hashCode(), is(targetDataSourceConfig.hashCode())); originalDataSourceConfig.getProps().put("username", "root"); targetDataSourceConfig.getProps().put("username", "root"); @@ -112,14 +112,14 @@ void assertSameHashCode() { @Test void assertDifferentHashCode() { - DataSourceConfiguration originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); - DataSourceConfiguration targetDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration originalDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); + RDBTracingStorageConfiguration targetDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); originalDataSourceConfig.getProps().put("username", "root"); targetDataSourceConfig.getProps().put("username", "root"); targetDataSourceConfig.getProps().put("password", "root"); assertThat(originalDataSourceConfig.hashCode(), not(targetDataSourceConfig.hashCode())); - originalDataSourceConfig = new DataSourceConfiguration(HikariDataSource.class.getName()); - targetDataSourceConfig = new DataSourceConfiguration(BasicDataSource.class.getName()); + originalDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); + targetDataSourceConfig = new RDBTracingStorageConfiguration(BasicDataSource.class.getName()); assertThat(originalDataSourceConfig.hashCode(), not(targetDataSourceConfig.hashCode())); } @@ -132,7 +132,7 @@ void assertGetDataSourceConfigurationWithConnectionInitSqls() { actualDataSource.setUsername("root"); actualDataSource.setPassword("root"); actualDataSource.setConnectionInitSqls(Arrays.asList("set names utf8mb4;", "set names utf8;")); - DataSourceConfiguration actual = DataSourceConfiguration.getDataSourceConfiguration(actualDataSource); + RDBTracingStorageConfiguration actual = RDBTracingStorageConfiguration.getDataSourceConfiguration(actualDataSource); assertThat(actual.getDataSourceClassName(), is(BasicDataSource.class.getName())); assertThat(actual.getProps().get("driverClassName").toString(), is("org.h2.Driver")); assertThat(actual.getProps().get("url").toString(), is("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL")); diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index e75a1c5f53..d66b25566b 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -19,13 +19,13 @@ import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; -import org.apache.shardingsphere.elasticjob.kernel.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage; +import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -44,7 +44,7 @@ class RDBTracingListenerTest { private static final String JOB_NAME = "test_rdb_event_listener"; @Mock - private RDBJobEventStorage repository; + private RDBJobEventRepository repository; private JobTracingEventBus jobTracingEventBus; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverterTest.java similarity index 85% rename from ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverterTest.java index 3495e8a513..5311dcd5bb 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceTracingStorageConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverterTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter; import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -class DataSourceTracingStorageConverterTest { +class RDBTracingStorageConverterTest { @Mock private DataSource dataSource; @@ -55,16 +55,16 @@ void assertConvert() throws SQLException { when(dataSource.getConnection()).thenReturn(connection); when(connection.getMetaData()).thenReturn(databaseMetaData); when(databaseMetaData.getURL()).thenReturn("jdbc:url"); - DataSourceTracingStorageConverter converter = new DataSourceTracingStorageConverter(); - assertNotNull(converter.convertObjectToConfiguration(dataSource)); + RDBTracingStorageConverter converter = new RDBTracingStorageConverter(); + assertNotNull(converter.convertToConfiguration(dataSource)); } @Test void assertConvertFailed() { assertThrows(TracingStorageUnavailableException.class, () -> { - DataSourceTracingStorageConverter converter = new DataSourceTracingStorageConverter(); + RDBTracingStorageConverter converter = new RDBTracingStorageConverter(); doThrow(SQLException.class).when(dataSource).getConnection(); - converter.convertObjectToConfiguration(dataSource); + converter.convertToConfiguration(dataSource); }); } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/DataSourceRegistryTest.java similarity index 87% rename from ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/DataSourceRegistryTest.java index fff1dbac3a..1d0206381e 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/datasource/DataSourceRegistryTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/datasource/DataSourceRegistryTest.java @@ -15,8 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.datasource; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource; +import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; @@ -35,7 +36,7 @@ class DataSourceRegistryTest { @Mock - private DataSourceConfiguration dataSourceConfig; + private RDBTracingStorageConfiguration dataSourceConfig; @Test void assertGetDataSourceBySameConfiguration() { @@ -49,7 +50,7 @@ void assertGetDataSourceBySameConfiguration() { @Test void assertGetDataSourceWithDifferentConfiguration() { when(dataSourceConfig.createDataSource()).then(invocation -> mock(DataSource.class)); - DataSourceConfiguration anotherDataSourceConfig = mock(DataSourceConfiguration.class); + RDBTracingStorageConfiguration anotherDataSourceConfig = mock(RDBTracingStorageConfiguration.class); when(anotherDataSourceConfig.createDataSource()).then(invocation -> mock(DataSource.class)); DataSource one = DataSourceRegistry.getInstance().getDataSource(dataSourceConfig); DataSource another = DataSourceRegistry.getInstance().getDataSource(anotherDataSourceConfig); diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java similarity index 61% rename from ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java index 3e0625511a..a2950c3dbf 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.tracing.rdb.storage; +package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; @@ -27,7 +27,6 @@ import org.junit.jupiter.api.Test; import java.sql.SQLException; -import java.util.List; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; @@ -36,9 +35,9 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -class RDBJobEventStorageTest { +class RDBJobEventRepositoryTest { - private RDBJobEventStorage storage; + private RDBJobEventRepository repository; private BasicDataSource dataSource; @@ -49,7 +48,7 @@ void setup() throws SQLException { dataSource.setUrl("jdbc:h2:mem:job_event_storage"); dataSource.setUsername("sa"); dataSource.setPassword(""); - storage = RDBJobEventStorage.getInstance(dataSource); + repository = RDBJobEventRepository.getInstance(dataSource); } @AfterEach @@ -59,55 +58,29 @@ void teardown() throws SQLException { @Test void assertAddJobExecutionEvent() { - assertTrue(storage.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0))); + assertTrue(repository.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0))); } @Test void assertAddJobStatusTraceEvent() { - assertTrue(storage.addJobStatusTraceEvent( + assertTrue(repository.addJobStatusTraceEvent( new JobStatusTraceEvent("test_job", "fake_task_id", "fake_slave_id", ExecutionType.READY, "0", State.TASK_RUNNING, "message is empty."))); } - @Test - void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() { - JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failover_task_id", "fake_slave_id", ExecutionType.FAILOVER, "0", State.TASK_STAGING, "message is empty."); - jobStatusTraceEvent.setOriginalTaskId("original_fake_failover_task_id"); - assertThat(storage.getJobStatusTraceEvents("fake_failover_task_id").size(), is(0)); - storage.addJobStatusTraceEvent(jobStatusTraceEvent); - assertThat(storage.getJobStatusTraceEvents("fake_failover_task_id").size(), is(1)); - } - - @Test - void assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState() { - JobStatusTraceEvent stagingJobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failed_failover_task_id", "fake_slave_id", ExecutionType.FAILOVER, "0", State.TASK_STAGING, "message is empty."); - stagingJobStatusTraceEvent.setOriginalTaskId("original_fake_failed_failover_task_id"); - storage.addJobStatusTraceEvent(stagingJobStatusTraceEvent); - JobStatusTraceEvent failedJobStatusTraceEvent = new JobStatusTraceEvent( - "test_job", "fake_failed_failover_task_id", "fake_slave_id", ExecutionType.FAILOVER, "0", State.TASK_FAILED, "message is empty."); - storage.addJobStatusTraceEvent(failedJobStatusTraceEvent); - List jobStatusTraceEvents = storage.getJobStatusTraceEvents("fake_failed_failover_task_id"); - assertThat(jobStatusTraceEvents.size(), is(2)); - for (JobStatusTraceEvent jobStatusTraceEvent : jobStatusTraceEvents) { - assertThat(jobStatusTraceEvent.getOriginalTaskId(), is("original_fake_failed_failover_task_id")); - } - } - @Test void assertUpdateJobExecutionEventWhenSuccess() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); - assertTrue(storage.addJobExecutionEvent(startEvent)); + assertTrue(repository.addJobExecutionEvent(startEvent)); JobExecutionEvent successEvent = startEvent.executionSuccess(); - assertTrue(storage.addJobExecutionEvent(successEvent)); + assertTrue(repository.addJobExecutionEvent(successEvent)); } @Test void assertUpdateJobExecutionEventWhenFailure() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); - assertTrue(storage.addJobExecutionEvent(startEvent)); + assertTrue(repository.addJobExecutionEvent(startEvent)); JobExecutionEvent failureEvent = startEvent.executionFailure("java.lang.RuntimeException: failure"); - assertTrue(storage.addJobExecutionEvent(failureEvent)); + assertTrue(repository.addJobExecutionEvent(failureEvent)); assertThat(failureEvent.getFailureCause(), is("java.lang.RuntimeException: failure")); assertNotNull(failureEvent.getCompleteTime()); } @@ -116,34 +89,34 @@ void assertUpdateJobExecutionEventWhenFailure() { void assertUpdateJobExecutionEventWhenSuccessAndConflict() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); JobExecutionEvent successEvent = startEvent.executionSuccess(); - assertTrue(storage.addJobExecutionEvent(successEvent)); - assertFalse(storage.addJobExecutionEvent(startEvent)); + assertTrue(repository.addJobExecutionEvent(successEvent)); + assertFalse(repository.addJobExecutionEvent(startEvent)); } @Test void assertUpdateJobExecutionEventWhenFailureAndConflict() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); JobExecutionEvent failureEvent = startEvent.executionFailure("java.lang.RuntimeException: failure"); - assertTrue(storage.addJobExecutionEvent(failureEvent)); + assertTrue(repository.addJobExecutionEvent(failureEvent)); assertThat(failureEvent.getFailureCause(), is("java.lang.RuntimeException: failure")); - assertFalse(storage.addJobExecutionEvent(startEvent)); + assertFalse(repository.addJobExecutionEvent(startEvent)); } @Test void assertUpdateJobExecutionEventWhenFailureAndMessageExceed() { JobExecutionEvent startEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0); - assertTrue(storage.addJobExecutionEvent(startEvent)); + assertTrue(repository.addJobExecutionEvent(startEvent)); StringBuilder failureMsg = new StringBuilder(); for (int i = 0; i < 600; i++) { failureMsg.append(i); } JobExecutionEvent failEvent = startEvent.executionFailure("java.lang.RuntimeException: failure" + failureMsg); - assertTrue(storage.addJobExecutionEvent(failEvent)); + assertTrue(repository.addJobExecutionEvent(failEvent)); assertThat(failEvent.getFailureCause(), startsWith("java.lang.RuntimeException: failure")); } @Test void assertFindJobExecutionEvent() { - storage.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); + repository.addJobExecutionEvent(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); } } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlRDBTracingStorageConfigurationConverterTest.java similarity index 87% rename from ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlRDBTracingStorageConfigurationConverterTest.java index d488e3ca1b..aaabb93076 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlRDBTracingStorageConfigurationConverterTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.yaml; -import org.apache.shardingsphere.elasticjob.tracing.rdb.datasource.DataSourceConfiguration; +import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; import org.junit.jupiter.api.Test; @@ -28,11 +28,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertTrue; -class YamlDataSourceConfigurationConverterTest { +class YamlRDBTracingStorageConfigurationConverterTest { @Test void assertConvertDataSourceConfiguration() { - DataSourceConfiguration dataSourceConfig = new DataSourceConfiguration("org.h2.Driver"); + RDBTracingStorageConfiguration dataSourceConfig = new RDBTracingStorageConfiguration("org.h2.Driver"); dataSourceConfig.getProps().put("foo", "bar"); YamlDataSourceConfigurationConverter converter = new YamlDataSourceConfigurationConverter(); YamlTracingStorageConfiguration actual = converter.convertToYamlConfiguration(dataSourceConfig); diff --git a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml index 9ba216d493..17a6dfd847 100644 --- a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml @@ -38,5 +38,5 @@ - + diff --git a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index a2ff666f76..d5502cf2ff 100644 --- a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java +++ b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -33,7 +33,7 @@ import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import javax.sql.DataSource; import java.io.IOException; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java index 0c50332aeb..98f93e8b09 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java @@ -31,8 +31,8 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.kernel.tracing.JobTracingEventBus; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index 2407d6b5e8..e49e63bf26 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -34,7 +34,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory; import org.apache.shardingsphere.elasticjob.kernel.internal.setup.SetUpFacade; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.quartz.JobBuilder; import org.quartz.JobDetail; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java index 9b656b6987..cd05904586 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.api; +package org.apache.shardingsphere.elasticjob.kernel.tracing.config; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -40,6 +40,6 @@ public final class TracingConfiguration implements JobExtraConfiguration { public TracingConfiguration(final String type, final T storage) { this.type = type; this.tracingStorageConfiguration = TracingStorageConverterFactory.findConverter((Class) storage.getClass()) - .orElseThrow(() -> new TracingStorageConverterNotFoundException(storage.getClass())).convertObjectToConfiguration(storage); + .orElseThrow(() -> new TracingStorageConverterNotFoundException(storage.getClass())).convertToConfiguration(storage); } } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingStorageConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingStorageConfiguration.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingStorageConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingStorageConfiguration.java index ced7a878ae..615b393b7b 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/api/TracingStorageConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingStorageConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.api; +package org.apache.shardingsphere.elasticjob.kernel.tracing.config; /** * Tracing storage configuration. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBus.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBus.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java index 78f3fae237..b0acf3b007 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBus.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java @@ -15,15 +15,14 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing; +package org.apache.shardingsphere.elasticjob.kernel.tracing.event; import com.google.common.eventbus.AsyncEventBus; import com.google.common.eventbus.EventBus; import com.google.common.util.concurrent.MoreExecutors; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java index 6bb4e6ecf3..d55a2349ae 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.storage; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** @@ -34,7 +34,7 @@ public interface TracingStorageConverter { * @param storage storage instance * @return instance of {@link TracingStorageConfiguration} */ - TracingStorageConfiguration convertObjectToConfiguration(T storage); + TracingStorageConfiguration convertToConfiguration(T storage); /** * Storage type. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java index 2c0f3d7042..bd1985b4b2 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java @@ -20,7 +20,7 @@ import lombok.Getter; import lombok.Setter; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; /** * YAML configuration for {@link TracingConfiguration}. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java index 0cd84b84c0..989f99eec7 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java index 8eb67fe665..c3201e6d57 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; /** * YAML configuration for {@link TracingStorageConfiguration}. diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacadeTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacadeTest.java index c587ba8cef..8806af610f 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacadeTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacadeTest.java @@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.ElasticJobListenerCaller; import org.apache.shardingsphere.elasticjob.kernel.listener.fixture.TestElasticJobListener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java similarity index 91% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java index 72e23cd874..6534a1288c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/JobTracingEventBusTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java @@ -15,12 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing; +package org.apache.shardingsphere.elasticjob.kernel.tracing.event; import com.google.common.eventbus.EventBus; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TestTracingListener; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java index 93576263d5..95319dba1c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; @RequiredArgsConstructor @Getter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java index 8ea3d16dc1..308e66655a 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java @@ -17,13 +17,13 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; public final class TracingStorageFixtureConverter implements TracingStorageConverter { @Override - public TracingStorageConfiguration convertObjectToConfiguration(final TracingStorageFixture storage) { + public TracingStorageConfiguration convertToConfiguration(final TracingStorageFixture storage) { return new TracingStorageConfigurationFixture(storage); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java index ae9fb238e1..c5c8502209 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageConfigurationFixture; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java index 89394eb7ea..011f938ff1 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java @@ -18,12 +18,12 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageConfigurationFixture; /** - * YAML JobEventCaller configuration converter. + * YAML job event caller configuration converter. */ @SuppressWarnings({"unchecked", "rawtypes"}) public final class YamlJobEventCallerConfigurationConverter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java index acb9312ada..d4f3d7d60b 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverterTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/resources/logback-test.xml b/kernel/src/test/resources/logback-test.xml index ea8aa37069..138f4b618a 100644 --- a/kernel/src/test/resources/logback-test.xml +++ b/kernel/src/test/resources/logback-test.xml @@ -39,6 +39,6 @@ - + diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java index ff59083bdc..9441fa8d22 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobBootstrapConfiguration.java @@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.SmartInitializingSingleton; import org.springframework.beans.factory.config.SingletonBeanRegistry; diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java index 0df9b60ad5..9992500959 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import com.zaxxer.hikari.HikariDataSource; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.springframework.beans.BeanUtils; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java index c8f10ce0e0..f7a93fd208 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/ElasticJobSpringBootTest.java @@ -29,7 +29,7 @@ import org.apache.shardingsphere.elasticjob.spring.boot.tracing.TracingProperties; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.awaitility.Awaitility; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java index 5633e3dad9..abf0e0831a 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/TracingConfigurationTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.tracing; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.ObjectProvider; diff --git a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java index 1bce808152..5feadd6d88 100644 --- a/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java +++ b/spring/namespace/src/main/java/org/apache/shardingsphere/elasticjob/spring/namespace/tracing/parser/TracingBeanDefinitionParser.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.tracing.parser; import org.apache.shardingsphere.elasticjob.spring.namespace.tracing.tag.TracingBeanDefinitionTag; -import org.apache.shardingsphere.elasticjob.kernel.tracing.api.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; From 80956cdd80d69eba57278445fa8451d3f701b8bb Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 21:41:35 +0800 Subject: [PATCH 154/178] Rename TracingListenerConfiguration to TracingListenerFactory (#2357) --- ...on.java => RDBTracingListenerFactory.java} | 8 ++--- ...l.tracing.listener.TracingListenerFactory} | 2 +- ...ava => RDBTracingListenerFactoryTest.java} | 6 ++-- .../tracing/event/JobTracingEventBus.java | 4 +-- ...ation.java => TracingListenerFactory.java} | 6 ++-- .../tracing/event/JobTracingEventBusTest.java | 8 ++--- .../TestTracingFailureConfiguration.java | 35 ------------------- ...tener.java => TracingListenerFixture.java} | 10 +++--- ...ava => TracingListenerFixtureFactory.java} | 8 ++--- ...l.tracing.listener.TracingListenerFactory} | 3 +- 10 files changed, 27 insertions(+), 63 deletions(-) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/{RDBTracingListenerConfiguration.java => RDBTracingListenerFactory.java} (83%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration => org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory} (97%) rename ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/{RDBTracingListenerConfigurationTest.java => RDBTracingListenerFactoryTest.java} (89%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/{TracingListenerConfiguration.java => TracingListenerFactory.java} (87%) delete mode 100644 kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingFailureConfiguration.java rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/{TestTracingListener.java => TracingListenerFixture.java} (87%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/{TestTracingListenerConfiguration.java => TracingListenerFixtureFactory.java} (81%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration => org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory} (85%) diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactory.java similarity index 83% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactory.java index 789bf1fb7a..41ab709416 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactory.java @@ -19,18 +19,18 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory; import javax.sql.DataSource; import java.sql.SQLException; /** - * RDB tracing listener configuration. + * RDB tracing listener factory. */ -public final class RDBTracingListenerConfiguration implements TracingListenerConfiguration { +public final class RDBTracingListenerFactory implements TracingListenerFactory { @Override - public TracingListener createTracingListener(final DataSource storage) throws TracingConfigurationException { + public TracingListener create(final DataSource storage) throws TracingConfigurationException { try { return new RDBTracingListener(storage); } catch (final SQLException ex) { diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory similarity index 97% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory index 567ef3f0a9..b4a29631c8 100644 --- a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration +++ b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration +org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerFactory diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java similarity index 89% rename from ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java index 2b03d79775..31384fb2ad 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java @@ -31,7 +31,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -class RDBTracingListenerConfigurationTest { +class RDBTracingListenerFactoryTest { @Test void assertCreateTracingListenerSuccess() throws TracingConfigurationException { @@ -40,13 +40,13 @@ void assertCreateTracingListenerSuccess() throws TracingConfigurationException { dataSource.setUrl("jdbc:h2:mem:job_event_storage"); dataSource.setUsername("sa"); dataSource.setPassword(""); - assertThat(new RDBTracingListenerConfiguration().createTracingListener(dataSource), instanceOf(RDBTracingListener.class)); + assertThat(new RDBTracingListenerFactory().create(dataSource), instanceOf(RDBTracingListener.class)); } @Test void assertCreateTracingListenerFailure() throws SQLException { DataSource dataSource = mock(DataSource.class); when(dataSource.getConnection()).thenThrow(new SQLException()); - assertThrows(TracingConfigurationException.class, () -> new RDBTracingListenerConfiguration().createTracingListener(dataSource)); + assertThrows(TracingConfigurationException.class, () -> new RDBTracingListenerFactory().create(dataSource)); } } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java index b0acf3b007..6dbd317899 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java @@ -24,7 +24,7 @@ import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.concurrent.ExecutorService; @@ -71,7 +71,7 @@ private void register(final TracingConfiguration tracingConfig) { throw new TracingConfigurationException(String.format("Can not find executor service handler type '%s'.", tracingConfig.getType())); } eventBus.register( - TypedSPILoader.getService(TracingListenerConfiguration.class, tracingConfig.getType()).createTracingListener(tracingConfig.getTracingStorageConfiguration().getStorage())); + TypedSPILoader.getService(TracingListenerFactory.class, tracingConfig.getType()).create(tracingConfig.getTracingStorageConfiguration().getStorage())); isRegistered = true; } catch (final TracingConfigurationException ex) { log.error("Elastic job: create tracing listener failure, error is: ", ex); diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerFactory.java similarity index 87% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerConfiguration.java rename to kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerFactory.java index 29211ad7fc..44485502ef 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerFactory.java @@ -22,12 +22,12 @@ import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; /** - * Tracing listener configuration. + * Tracing listener factory. * * @param type of tracing storage */ @SingletonSPI -public interface TracingListenerConfiguration extends TypedSPI { +public interface TracingListenerFactory extends TypedSPI { /** * Create tracing listener. @@ -36,7 +36,7 @@ public interface TracingListenerConfiguration extends TypedSPI { * @return tracing listener * @throws TracingConfigurationException tracing configuration exception */ - TracingListener createTracingListener(T storage) throws TracingConfigurationException; + TracingListener create(T storage) throws TracingConfigurationException; @Override String getType(); diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java index 6534a1288c..3387d530ab 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java @@ -20,7 +20,7 @@ import com.google.common.eventbus.EventBus; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; -import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TestTracingListener; +import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TracingListenerFixture; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; @@ -48,8 +48,8 @@ class JobTracingEventBusTest { private JobTracingEventBus jobTracingEventBus; @Test - void assertRegisterFailure() { - jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("FAIL", null)); + void assertRegisterWithoutTracingStorageConfiguration() { + jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("TEST", null)); assertFalse((Boolean) ReflectionUtils.getFieldValue(jobTracingEventBus, "isRegistered")); } @@ -58,7 +58,7 @@ void assertPost() { jobTracingEventBus = new JobTracingEventBus(new TracingConfiguration<>("TEST", tracingStorage)); assertTrue((Boolean) ReflectionUtils.getFieldValue(jobTracingEventBus, "isRegistered")); jobTracingEventBus.post(new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)); - Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(TestTracingListener::isExecutionEventCalled); + Awaitility.await().pollDelay(100L, TimeUnit.MILLISECONDS).until(TracingListenerFixture::isExecutionEventCalled); verify(tracingStorage).call(); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingFailureConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingFailureConfiguration.java deleted file mode 100644 index 7175f02d16..0000000000 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingFailureConfiguration.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.elasticjob.kernel.tracing.fixture.listener; - -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; - -public final class TestTracingFailureConfiguration implements TracingListenerConfiguration { - - @Override - public TracingListener createTracingListener(final Object storage) throws TracingConfigurationException { - throw new TracingConfigurationException(new RuntimeException("assert failure")); - } - - @Override - public String getType() { - return "FAIL"; - } -} diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListener.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixture.java similarity index 87% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListener.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixture.java index 85d4375328..e92be453f0 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListener.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixture.java @@ -25,26 +25,26 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; @RequiredArgsConstructor -public final class TestTracingListener implements TracingListener { +public final class TracingListenerFixture implements TracingListener { @Getter private static volatile boolean executionEventCalled; - private final TracingStorageFixture tracingStorageFixture; + private final TracingStorageFixture tracingStorage; @Override public void listen(final JobExecutionEvent jobExecutionEvent) { - tracingStorageFixture.call(); + tracingStorage.call(); executionEventCalled = true; } @Override public void listen(final JobStatusTraceEvent jobStatusTraceEvent) { - tracingStorageFixture.call(); + tracingStorage.call(); } /** - * Set executionEventCalled to false. + * Reset. */ public static void reset() { executionEventCalled = false; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListenerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixtureFactory.java similarity index 81% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListenerConfiguration.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixtureFactory.java index 238bfc5b33..c61c7250e7 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TestTracingListenerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixtureFactory.java @@ -18,14 +18,14 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory; import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; -public final class TestTracingListenerConfiguration implements TracingListenerConfiguration { +public final class TracingListenerFixtureFactory implements TracingListenerFactory { @Override - public TracingListener createTracingListener(final TracingStorageFixture storage) { - return new TestTracingListener(storage); + public TracingListener create(final TracingStorageFixture storage) { + return new TracingListenerFixture(storage); } @Override diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory similarity index 85% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory index 24e9ed4f63..8db8f4759d 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerConfiguration +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory @@ -15,5 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TestTracingListenerConfiguration -org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TestTracingFailureConfiguration +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TracingListenerFixtureFactory From bdd7637f8a48cc40c3ef1074f9f981d943c93be5 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 21:44:06 +0800 Subject: [PATCH 155/178] Remove TracingStorageConverterNotFoundException (#2358) --- .../tracing/config/TracingConfiguration.java | 6 ++-- ...cingStorageConverterNotFoundException.java | 32 ------------------- 2 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java index cd05904586..c700c470d8 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java @@ -20,8 +20,8 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageConverterNotFoundException; import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory; +import org.apache.shardingsphere.infra.spi.exception.ServiceProviderNotFoundException; /** * Tracing configuration. @@ -39,7 +39,7 @@ public final class TracingConfiguration implements JobExtraConfiguration { @SuppressWarnings("unchecked") public TracingConfiguration(final String type, final T storage) { this.type = type; - this.tracingStorageConfiguration = TracingStorageConverterFactory.findConverter((Class) storage.getClass()) - .orElseThrow(() -> new TracingStorageConverterNotFoundException(storage.getClass())).convertToConfiguration(storage); + tracingStorageConfiguration = TracingStorageConverterFactory.findConverter((Class) storage.getClass()) + .orElseThrow(() -> new ServiceProviderNotFoundException(storage.getClass(), storage.getClass().getSimpleName())).convertToConfiguration(storage); } } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java deleted file mode 100644 index a2661fb1db..0000000000 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingStorageConverterNotFoundException.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.elasticjob.kernel.tracing.exception; - -import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; - -/** - * {@link TracingStorageConverter} not found exception. - */ -public final class TracingStorageConverterNotFoundException extends RuntimeException { - - private static final long serialVersionUID = -995858641205565452L; - - public TracingStorageConverterNotFoundException(final Class storageType) { - super(String.format("No TracingConfigurationConverter found for [%s]", storageType.getName())); - } -} From c300d53b6398aeb38d350356ba35640a28bc595d Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Tue, 31 Oct 2023 21:49:50 +0800 Subject: [PATCH 156/178] Remove WrapException (#2359) --- .../repository/RDBJobEventRepository.java | 12 ++++---- .../tracing/exception/WrapException.java | 28 ------------------- 2 files changed, 6 insertions(+), 34 deletions(-) delete mode 100644 kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/WrapException.java diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java index 01124317db..0248e633b5 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java @@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; -import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.WrapException; +import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.RDBStorageSQLMapper; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.SQLPropertiesFactory; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType; @@ -69,26 +69,26 @@ private RDBJobEventRepository(final DataSource dataSource) throws SQLException { } /** - * The same dataSource always return the same RDBJobEventStorage instance. + * The same data source always return the same RDB job event repository instance. * * @param dataSource dataSource * @return RDBJobEventStorage instance * @throws SQLException SQLException */ public static RDBJobEventRepository getInstance(final DataSource dataSource) throws SQLException { - return wrapException(() -> STORAGE_MAP.computeIfAbsent(dataSource, ds -> { + return getInstance(() -> STORAGE_MAP.computeIfAbsent(dataSource, ds -> { try { return new RDBJobEventRepository(ds); } catch (final SQLException ex) { - throw new WrapException(ex); + throw new TracingStorageUnavailableException(ex); } })); } - private static RDBJobEventRepository wrapException(final Supplier supplier) throws SQLException { + private static RDBJobEventRepository getInstance(final Supplier supplier) throws SQLException { try { return supplier.get(); - } catch (final WrapException ex) { + } catch (final TracingStorageUnavailableException ex) { if (ex.getCause() instanceof SQLException) { throw new SQLException(ex.getCause()); } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/WrapException.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/WrapException.java deleted file mode 100644 index a0aa125f70..0000000000 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/WrapException.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.elasticjob.kernel.tracing.exception; - -/** - * Use to wrap Exception. - */ -public class WrapException extends RuntimeException { - - public WrapException(final Throwable cause) { - super(cause); - } -} From 6ca1a3a3d3a19260ae6aef7d74cf78a94319e9d2 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Wed, 1 Nov 2023 05:43:02 +0800 Subject: [PATCH 157/178] Refactor pom (#2360) --- examples/elasticjob-example-java/pom.xml | 4 +- examples/elasticjob-example-spring/pom.xml | 4 +- examples/pom.xml | 6 +- pom.xml | 192 +++++++++++---------- spring/boot-starter/pom.xml | 2 +- spring/pom.xml | 8 + 6 files changed, 113 insertions(+), 103 deletions(-) diff --git a/examples/elasticjob-example-java/pom.xml b/examples/elasticjob-example-java/pom.xml index 3db6224cbd..88190535ad 100644 --- a/examples/elasticjob-example-java/pom.xml +++ b/examples/elasticjob-example-java/pom.xml @@ -85,8 +85,8 @@ h2 - mysql - mysql-connector-java + com.mysql + mysql-connector-j diff --git a/examples/elasticjob-example-spring/pom.xml b/examples/elasticjob-example-spring/pom.xml index bdba0392f5..ca6fdf3b1c 100644 --- a/examples/elasticjob-example-spring/pom.xml +++ b/examples/elasticjob-example-spring/pom.xml @@ -89,8 +89,8 @@ h2 - mysql - mysql-connector-java + com.mysql + mysql-connector-j diff --git a/examples/pom.xml b/examples/pom.xml index 202e496402..a919a8399c 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -112,9 +112,9 @@ ${h2.version} - mysql - mysql-connector-java - ${mysql-connector-java} + com.mysql + mysql-connector-j + ${mysql-connector-java.version} diff --git a/pom.xml b/pom.xml index e7d3339cfb..8ef6e35f32 100644 --- a/pom.xml +++ b/pom.xml @@ -62,40 +62,38 @@ 1.3 3.12.0 - 1.16.0 - 1.3 - 2.2 2.10.1 2.3.2 + 3.9.0 5.5.0 - 1.9.1 + 1.6.0 + 1.16.0 + 1.3 4.5.14 4.4.16 + 4.1.99.Final 1.7.36 1.2.12 - 2.10.0 - 2.11.1 - 4.0.3 - 1.6.0 - 1.18.30 - 8.0.31 - 2.2.224 - 5.10.0 2.2 4.11.0 4.2.0 1.14.8 + 2.2.224 + 4.0.3 + 2.10.0 + 2.11.1 + 3.2.1 3.11.0 @@ -139,6 +137,7 @@ shardingsphere-infra-spi ${shardingsphere.version} + com.google.guava guava @@ -171,6 +170,17 @@ commons-lang3 ${commons-lang3.version} + + org.yaml + snakeyaml + ${snakeyaml.version} + + + com.google.code.gson + gson + ${gson.version} + + org.quartz-scheduler quartz @@ -182,6 +192,7 @@ + org.apache.zookeeper zookeeper @@ -210,46 +221,9 @@ - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - jcl-over-slf4j - ${slf4j.version} - - - org.slf4j - jul-to-slf4j - ${slf4j.version} - - - org.slf4j - log4j-over-slf4j - ${slf4j.version} - - - org.slf4j - slf4j-jdk14 - ${slf4j.version} - true - - - ch.qos.logback - logback-core - ${logback.version} - - - ch.qos.logback - logback-classic - ${logback.version} - - - org.slf4j - slf4j-api - - + com.sun.mail + javax.mail + ${mail.version} commons-codec @@ -271,16 +245,7 @@ httpcore ${httpcore.version} - - org.yaml - snakeyaml - ${snakeyaml.version} - - - com.google.code.gson - gson - ${gson.version} - + io.netty netty-bom @@ -290,24 +255,41 @@ - org.apache.commons - commons-dbcp2 - ${commons-dbcp2.version} + org.slf4j + slf4j-api + ${slf4j.version} - org.apache.commons - commons-pool2 - ${commons-pool2.version} + org.slf4j + jcl-over-slf4j + ${slf4j.version} - com.zaxxer - HikariCP - ${hikari-cp.version} + org.slf4j + jul-to-slf4j + ${slf4j.version} - com.sun.mail - javax.mail - ${mail.version} + org.slf4j + slf4j-jdk14 + ${slf4j.version} + true + + + ch.qos.logback + logback-core + ${logback.version} + + + ch.qos.logback + logback-classic + ${logback.version} + + + org.slf4j + slf4j-api + + @@ -317,24 +299,6 @@ provided - - com.h2database - h2 - ${h2.version} - test - - - org.hamcrest - hamcrest - ${hamcrest.version} - test - - - org.aspectj - aspectjweaver - ${aspectj.version} - test - org.junit junit-bom @@ -343,9 +307,9 @@ import - org.awaitility - awaitility - ${awaitility.version} + org.hamcrest + hamcrest + ${hamcrest.version} test @@ -377,6 +341,35 @@ ${bytebuddy.version} test + + org.awaitility + awaitility + ${awaitility.version} + test + + + + com.h2database + h2 + ${h2.version} + test + + + com.zaxxer + HikariCP + ${hikari-cp.version} + + + org.apache.commons + commons-dbcp2 + ${commons-dbcp2.version} + test + + + org.apache.commons + commons-pool2 + ${commons-pool2.version} + @@ -385,10 +378,19 @@ com.google.guava guava + org.slf4j slf4j-api + + org.slf4j + jcl-over-slf4j + + + org.slf4j + jul-to-slf4j + org.projectlombok diff --git a/spring/boot-starter/pom.xml b/spring/boot-starter/pom.xml index d747fdf586..7fa77d5704 100644 --- a/spring/boot-starter/pom.xml +++ b/spring/boot-starter/pom.xml @@ -59,10 +59,10 @@ spring-boot-starter-test test + com.h2database h2 - test org.awaitility diff --git a/spring/pom.xml b/spring/pom.xml index 6357ab8d90..bec630362d 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -36,6 +36,7 @@ 2.7.10 5.3.26 + 1.9.1 @@ -71,6 +72,13 @@ ${springframework.version} test + + + org.aspectj + aspectjweaver + ${aspectj.version} + test + From 066b556681d611d24b4653e7cea83e208f3cb855 Mon Sep 17 00:00:00 2001 From: zhangliang Date: Wed, 1 Nov 2023 12:48:07 +0800 Subject: [PATCH 158/178] Move all spi interface to api module --- .../elasticjob/spi}/executor/ExecutionType.java | 2 +- .../executor/error/handler/JobErrorHandler.java | 2 +- .../JobErrorHandlerPropertiesValidator.java | 2 +- .../spi/executor/{ => item}/JobItemExecutor.java | 6 +++--- .../{ => item}/param/JobRuntimeService.java | 2 +- .../executor/{ => item}/param/ShardingContext.java | 2 +- .../{ => item}/type/ClassedJobItemExecutor.java | 4 ++-- .../{ => item}/type/TypedJobItemExecutor.java | 4 ++-- .../spi/listener/param/ShardingContexts.java | 2 +- .../elasticjob/spi}/tracing/event/JobEvent.java | 2 +- .../spi}/tracing/event/JobExecutionEvent.java | 2 +- .../spi}/tracing/event/JobStatusTraceEvent.java | 4 ++-- .../exception/TracingConfigurationException.java | 2 +- .../spi}/tracing/listener/TracingListener.java | 6 +++--- .../tracing/listener/TracingListenerFactory.java | 4 ++-- .../storage}/TracingStorageConfiguration.java | 2 +- .../TracingStorageConfigurationConverter.java | 9 ++++----- .../elasticjob/spi/yaml}/YamlConfiguration.java | 2 +- .../spi/yaml}/YamlConfigurationConverter.java | 2 +- .../elasticjob/annotation/job/CustomJob.java | 2 +- .../annotation/job/impl/SimpleTestJob.java | 2 +- .../spi/listener/param/ShardingContextsTest.java | 2 +- .../handler/dingtalk/DingtalkJobErrorHandler.java | 2 +- ...DingtalkJobErrorHandlerPropertiesValidator.java | 2 +- ...job.spi.executor.error.handler.JobErrorHandler} | 0 ...ror.handler.JobErrorHandlerPropertiesValidator} | 0 ...talkJobErrorHandlerPropertiesValidatorTest.java | 2 +- .../dingtalk/DingtalkJobErrorHandlerTest.java | 2 +- .../error/handler/email/EmailJobErrorHandler.java | 2 +- .../EmailJobErrorHandlerPropertiesValidator.java | 2 +- ...job.spi.executor.error.handler.JobErrorHandler} | 0 ...ror.handler.JobErrorHandlerPropertiesValidator} | 0 ...mailJobErrorHandlerPropertiesValidatorTest.java | 2 +- .../handler/email/EmailJobErrorHandlerTest.java | 2 +- .../handler/normal/IgnoreJobErrorHandler.java | 2 +- .../error/handler/normal/LogJobErrorHandler.java | 2 +- .../error/handler/normal/ThrowJobErrorHandler.java | 2 +- ...job.spi.executor.error.handler.JobErrorHandler} | 0 .../handler/normal/IgnoreJobErrorHandlerTest.java | 2 +- .../handler/normal/LogJobErrorHandlerTest.java | 2 +- .../handler/normal/ThrowJobErrorHandlerTest.java | 2 +- .../handler/wechat/WechatJobErrorHandler.java | 2 +- .../WechatJobErrorHandlerPropertiesValidator.java | 2 +- ...job.spi.executor.error.handler.JobErrorHandler} | 0 ...ror.handler.JobErrorHandlerPropertiesValidator} | 0 ...chatJobErrorHandlerPropertiesValidatorTest.java | 2 +- .../handler/wechat/WechatJobErrorHandlerTest.java | 2 +- .../dataflow/executor/DataflowJobExecutor.java | 6 +++--- .../elasticjob/dataflow/job/DataflowJob.java | 2 +- ....spi.executor.item.type.ClassedJobItemExecutor} | 0 .../dataflow/executor/DataflowJobExecutorTest.java | 4 ++-- .../elasticjob/http/executor/HttpJobExecutor.java | 6 +++--- ...ob.spi.executor.item.type.TypedJobItemExecutor} | 0 .../http/executor/HttpJobExecutorTest.java | 4 ++-- .../script/executor/ScriptJobExecutor.java | 6 +++--- ...ob.spi.executor.item.type.TypedJobItemExecutor} | 0 .../elasticjob/script/ScriptJobExecutorTest.java | 4 ++-- .../simple/executor/SimpleJobExecutor.java | 6 +++--- .../elasticjob/simple/job/SimpleJob.java | 2 +- ....spi.executor.item.type.ClassedJobItemExecutor} | 0 .../simple/executor/SimpleJobExecutorTest.java | 2 +- .../elasticjob/simple/job/FooSimpleJob.java | 2 +- .../rdb/config/RDBTracingStorageConfiguration.java | 2 +- .../tracing/rdb/listener/RDBTracingListener.java | 6 +++--- .../rdb/listener/RDBTracingListenerFactory.java | 6 +++--- ...> RDBTracingStorageConfigurationConverter.java} | 8 ++++---- .../storage/repository/RDBJobEventRepository.java | 6 +++--- .../rdb/yaml/YamlDataSourceConfiguration.java | 2 +- .../yaml/YamlDataSourceConfigurationConverter.java | 4 ++-- ...ob.spi.tracing.listener.TracingListenerFactory} | 0 ...g.storage.TracingStorageConfigurationConverter} | 2 +- ...elasticjob.spi.yaml.YamlConfigurationConverter} | 0 .../listener/RDBTracingListenerFactoryTest.java | 2 +- .../rdb/listener/RDBTracingListenerTest.java | 8 ++++---- ...BTracingStorageConfigurationConverterTest.java} | 14 +++++++------- .../repository/RDBJobEventRepositoryTest.java | 8 ++++---- .../rdb/src/test/resources/logback-test.xml | 2 +- .../example/job/dataflow/JavaDataflowJob.java | 2 +- .../example/job/dataflow/SpringDataflowJob.java | 2 +- .../example/job/simple/JavaOccurErrorJob.java | 2 +- .../example/job/simple/JavaSimpleJob.java | 2 +- .../example/job/simple/SpringSimpleJob.java | 2 +- .../example/job/SpringBootDataflowJob.java | 2 +- .../job/SpringBootOccurErrorNoticeDingtalkJob.java | 2 +- .../job/SpringBootOccurErrorNoticeEmailJob.java | 2 +- .../job/SpringBootOccurErrorNoticeWechatJob.java | 2 +- .../example/job/SpringBootSimpleJob.java | 2 +- .../kernel/executor/ElasticJobExecutor.java | 13 +++++++------ .../error/handler/JobErrorHandlerReloader.java | 1 + .../kernel/executor/facade/JobFacade.java | 8 ++++---- .../executor/facade/JobJobRuntimeServiceImpl.java | 2 +- .../executor/item/JobItemExecutorFactory.java | 4 ++-- .../internal/config/JobConfigurationPOJO.java | 4 ++-- .../kernel/internal/context/TaskContext.java | 2 +- .../kernel/internal/schedule/JobScheduler.java | 2 +- .../tracing/config/TracingConfiguration.java | 3 ++- .../kernel/tracing/event/JobTracingEventBus.java | 5 +++-- .../storage/TracingStorageConverterFactory.java | 13 +++++++------ .../tracing/yaml/YamlTracingConfiguration.java | 2 +- .../yaml/YamlTracingConfigurationConverter.java | 4 ++-- .../yaml/YamlTracingStorageConfiguration.java | 4 ++-- ...elasticjob.spi.yaml.YamlConfigurationConverter} | 0 .../kernel/executor/ElasticJobExecutorTest.java | 4 ++-- .../error/handler/JobErrorHandlerReloaderTest.java | 1 + .../handler/fixture/BarJobErrorHandlerFixture.java | 2 +- .../handler/fixture/FooJobErrorHandlerFixture.java | 2 +- .../fixture/executor/ClassedFooJobExecutor.java | 6 +++--- .../fixture/executor/TypedFooJobExecutor.java | 6 +++--- .../kernel/fixture/job/DetailedFooJob.java | 2 +- .../elasticjob/kernel/fixture/job/FooJob.java | 2 +- .../kernel/internal/context/TaskContextTest.java | 2 +- .../kernel/internal/context/fixture/TaskNode.java | 2 +- .../tracing/event/JobExecutionEventTest.java | 1 + .../tracing/event/JobTracingEventBusTest.java | 2 ++ .../config/TracingStorageConfigurationFixture.java | 2 +- ...acingStorageFixtureConfigurationConverter.java} | 8 ++++---- .../fixture/listener/TracingListenerFixture.java | 6 +++--- .../listener/TracingListenerFixtureFactory.java | 4 ++-- ...gStorageConfigurationConverterFactoryTest.java} | 2 +- .../yaml/YamlJobEventCallerConfiguration.java | 2 +- .../YamlJobEventCallerConfigurationConverter.java | 4 ++-- ...job.spi.executor.error.handler.JobErrorHandler} | 0 ....spi.executor.item.type.ClassedJobItemExecutor} | 0 ...ob.spi.executor.item.type.TypedJobItemExecutor} | 0 ...ob.spi.tracing.listener.TracingListenerFactory} | 0 ...g.storage.TracingStorageConfigurationConverter} | 2 +- ...elasticjob.spi.yaml.YamlConfigurationConverter} | 0 .../job/executor/CustomClassedJobExecutor.java | 6 +++--- .../spring/boot/job/executor/PrintJobExecutor.java | 6 +++--- .../spring/boot/job/fixture/job/CustomJob.java | 2 +- .../job/fixture/job/impl/AnnotationCustomJob.java | 2 +- .../boot/job/fixture/job/impl/CustomTestJob.java | 2 +- ....spi.executor.item.type.ClassedJobItemExecutor} | 0 ...ob.spi.executor.item.type.TypedJobItemExecutor} | 0 .../elasticjob/spring/core/util/TargetJob.java | 2 +- .../namespace/fixture/job/DataflowElasticJob.java | 2 +- .../namespace/fixture/job/FooSimpleElasticJob.java | 2 +- .../job/annotation/AnnotationSimpleJob.java | 2 +- .../fixture/job/ref/RefFooDataflowElasticJob.java | 2 +- .../fixture/job/ref/RefFooSimpleElasticJob.java | 2 +- .../annotation/fixture/AnnotationSimpleJob.java | 2 +- .../fixture/AnnotationUnShardingJob.java | 2 +- .../fixture/executor/E2EFixtureJobExecutor.java | 6 +++--- .../test/e2e/raw/fixture/job/E2EFixtureJob.java | 2 +- .../e2e/raw/fixture/job/E2EFixtureJobImpl.java | 2 +- ....spi.executor.item.type.ClassedJobItemExecutor} | 0 146 files changed, 209 insertions(+), 201 deletions(-) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/executor/ExecutionType.java (94%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/executor/error/handler/JobErrorHandler.java (94%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/executor/error/handler/JobErrorHandlerPropertiesValidator.java (94%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/{ => item}/JobItemExecutor.java (85%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/{ => item}/param/JobRuntimeService.java (93%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/{ => item}/param/ShardingContext.java (94%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/{ => item}/type/ClassedJobItemExecutor.java (89%) rename api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/{ => item}/type/TypedJobItemExecutor.java (88%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/tracing/event/JobEvent.java (93%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/tracing/event/JobExecutionEvent.java (97%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/tracing/event/JobStatusTraceEvent.java (92%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/tracing/exception/TracingConfigurationException.java (94%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/tracing/listener/TracingListener.java (85%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel => api/src/main/java/org/apache/shardingsphere/elasticjob/spi}/tracing/listener/TracingListenerFactory.java (89%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage}/TracingStorageConfiguration.java (93%) rename kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfigurationConverter.java (79%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml}/YamlConfiguration.java (93%) rename {kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config => api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml}/YamlConfigurationConverter.java (95%) rename ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/error-handler/email/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/email/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/error-handler/normal/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/wechat/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler} (100%) rename ecosystem/error-handler/wechat/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator} (100%) rename ecosystem/executor/dataflow/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor} (100%) rename ecosystem/executor/http/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor} (100%) rename ecosystem/executor/script/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor} (100%) rename ecosystem/executor/simple/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor} (100%) rename ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/{RDBTracingStorageConverter.java => RDBTracingStorageConfigurationConverter.java} (83%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory => org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory} (100%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter => org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter} (95%) rename ecosystem/tracing/rdb/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter => org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter} (100%) rename ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/{RDBTracingStorageConverterTest.java => RDBTracingStorageConfigurationConverterTest.java} (79%) rename kernel/src/main/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter => org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter} (100%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/{TracingStorageFixtureConverter.java => TracingStorageFixtureConfigurationConverter.java} (71%) rename kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/{TracingStorageConverterFactoryTest.java => TracingStorageConfigurationConverterFactoryTest.java} (96%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler => org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler} (100%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor} (100%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor} (100%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory => org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory} (100%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter => org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter} (94%) rename kernel/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter => org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter} (100%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor} (100%) rename spring/boot-starter/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor} (100%) rename test/e2e/src/test/resources/META-INF/services/{org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor => org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor} (100%) diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ExecutionType.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/ExecutionType.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ExecutionType.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/ExecutionType.java index b7544b3de9..4359a17858 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ExecutionType.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/ExecutionType.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.executor; +package org.apache.shardingsphere.elasticjob.spi.executor; /** * Execution type. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandler.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandler.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandler.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandler.java index f4a1f0f4d9..762981a908 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandler.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler; +package org.apache.shardingsphere.elasticjob.spi.executor.error.handler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerPropertiesValidator.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandlerPropertiesValidator.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerPropertiesValidator.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandlerPropertiesValidator.java index 098c6fc35e..8c7a1253f2 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerPropertiesValidator.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/error/handler/JobErrorHandlerPropertiesValidator.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler; +package org.apache.shardingsphere.elasticjob.spi.executor.error.handler; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/JobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/JobItemExecutor.java similarity index 85% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/JobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/JobItemExecutor.java index e78c97aeb4..e933d8b927 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/JobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/JobItemExecutor.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.executor; +package org.apache.shardingsphere.elasticjob.spi.executor.item; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; /** * Job item executor. diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/JobRuntimeService.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/JobRuntimeService.java similarity index 93% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/JobRuntimeService.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/JobRuntimeService.java index 35538aae5f..375ed64b10 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/JobRuntimeService.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/JobRuntimeService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.executor.param; +package org.apache.shardingsphere.elasticjob.spi.executor.item.param; /** * Job runtime service. diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/ShardingContext.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/ShardingContext.java similarity index 94% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/ShardingContext.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/ShardingContext.java index a3f94167cd..d756377091 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/param/ShardingContext.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/param/ShardingContext.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.executor.param; +package org.apache.shardingsphere.elasticjob.spi.executor.item.param; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/ClassedJobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/ClassedJobItemExecutor.java similarity index 89% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/ClassedJobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/ClassedJobItemExecutor.java index 319618ecbc..166f419a87 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/ClassedJobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/ClassedJobItemExecutor.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.executor.type; +package org.apache.shardingsphere.elasticjob.spi.executor.item.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/TypedJobItemExecutor.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/TypedJobItemExecutor.java similarity index 88% rename from api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/TypedJobItemExecutor.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/TypedJobItemExecutor.java index 1d2c278fd1..bdf808f714 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/type/TypedJobItemExecutor.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/executor/item/type/TypedJobItemExecutor.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.spi.executor.type; +package org.apache.shardingsphere.elasticjob.spi.executor.item.type; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.JobItemExecutor; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java index aa9604868b..e6877b9402 100644 --- a/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContexts.java @@ -21,7 +21,7 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import java.io.Serializable; import java.util.Map; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobEvent.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobEvent.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobEvent.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobEvent.java index fd44f9d09b..db0b4e5a84 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobEvent.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobEvent.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.event; +package org.apache.shardingsphere.elasticjob.spi.tracing.event; /** * Job event. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEvent.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobExecutionEvent.java similarity index 97% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEvent.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobExecutionEvent.java index ab5eb84c90..bd15c9ea45 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEvent.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobExecutionEvent.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.event; +package org.apache.shardingsphere.elasticjob.spi.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobStatusTraceEvent.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobStatusTraceEvent.java similarity index 92% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobStatusTraceEvent.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobStatusTraceEvent.java index 9233fe060b..4ea6fe8413 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobStatusTraceEvent.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/event/JobStatusTraceEvent.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.event; +package org.apache.shardingsphere.elasticjob.spi.tracing.event; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; import java.util.Date; import java.util.UUID; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingConfigurationException.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/exception/TracingConfigurationException.java similarity index 94% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingConfigurationException.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/exception/TracingConfigurationException.java index 4643ef9b8c..7b31d1000a 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/exception/TracingConfigurationException.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/exception/TracingConfigurationException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.exception; +package org.apache.shardingsphere.elasticjob.spi.tracing.exception; /** * Tracing configuration exception. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListener.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListener.java similarity index 85% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListener.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListener.java index b95a8a15c0..4437562092 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListener.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListener.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.listener; +package org.apache.shardingsphere.elasticjob.spi.tracing.listener; import com.google.common.eventbus.AllowConcurrentEvents; import com.google.common.eventbus.Subscribe; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; /** * Tracing listener. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerFactory.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListenerFactory.java similarity index 89% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerFactory.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListenerFactory.java index 44485502ef..39179f7e08 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/listener/TracingListenerFactory.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/listener/TracingListenerFactory.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.listener; +package org.apache.shardingsphere.elasticjob.spi.tracing.listener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.spi.tracing.exception.TracingConfigurationException; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingStorageConfiguration.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfiguration.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingStorageConfiguration.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfiguration.java index 615b393b7b..e1c8602a96 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingStorageConfiguration.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.config; +package org.apache.shardingsphere.elasticjob.spi.tracing.storage; /** * Tracing storage configuration. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfigurationConverter.java similarity index 79% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfigurationConverter.java index d55a2349ae..4752237eb1 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverter.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/tracing/storage/TracingStorageConfigurationConverter.java @@ -15,18 +15,17 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.tracing.storage; +package org.apache.shardingsphere.elasticjob.spi.tracing.storage; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; /** - * Tracing storage converter. + * Tracing storage configuration converter. * * @param storage type */ @SingletonSPI -public interface TracingStorageConverter { +public interface TracingStorageConfigurationConverter { /** * Convert storage to {@link TracingStorageConfiguration}. @@ -34,7 +33,7 @@ public interface TracingStorageConverter { * @param storage storage instance * @return instance of {@link TracingStorageConfiguration} */ - TracingStorageConfiguration convertToConfiguration(T storage); + TracingStorageConfiguration toConfiguration(T storage); /** * Storage type. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfiguration.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfiguration.java similarity index 93% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfiguration.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfiguration.java index 0dc414979d..2b55cd3067 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfiguration.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfiguration.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config; +package org.apache.shardingsphere.elasticjob.spi.yaml; import java.io.Serializable; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfigurationConverter.java b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfigurationConverter.java similarity index 95% rename from kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfigurationConverter.java rename to api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfigurationConverter.java index 1e38b4028c..6ed998c8d2 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/infra/yaml/config/YamlConfigurationConverter.java +++ b/api/src/main/java/org/apache/shardingsphere/elasticjob/spi/yaml/YamlConfigurationConverter.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config; +package org.apache.shardingsphere.elasticjob.spi.yaml; import org.apache.shardingsphere.infra.spi.annotation.SingletonSPI; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPI; diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java index cd2f29ebd3..56eb51b707 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/CustomJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.annotation.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; public interface CustomJob extends ElasticJob { diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java index 340a0fccd6..97119dbc41 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/annotation/job/impl/SimpleTestJob.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.annotation.SimpleTracingConfigurationFactory; import org.apache.shardingsphere.elasticjob.annotation.job.CustomJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; @ElasticJobConfiguration( cron = "0/5 * * * * ?", diff --git a/api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java b/api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java index f4d32bb326..2051b1069c 100644 --- a/api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java +++ b/api/src/test/java/org/apache/shardingsphere/elasticjob/spi/listener/param/ShardingContextsTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.spi.listener.param; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.junit.jupiter.api.Test; import java.util.HashMap; diff --git a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java index ff78fcb59e..8103375337 100644 --- a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java +++ b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandler.java @@ -30,7 +30,7 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; diff --git a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java index 5a11941011..b791cf460f 100644 --- a/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/dingtalk/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/dingtalk/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java index 440bcf9aad..7bc3c4705d 100644 --- a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.dingtalk; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index 49633dfd8d..60cd6dbd4e 100644 --- a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -21,7 +21,7 @@ import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; import org.apache.shardingsphere.elasticjob.error.handler.dingtalk.fixture.DingtalkInternalController; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; diff --git a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java index 05477099d7..d65f914da3 100644 --- a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java +++ b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java @@ -20,7 +20,7 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import javax.mail.Authenticator; import javax.mail.BodyPart; diff --git a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java index 7ef1957d49..449df4a061 100644 --- a/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/email/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java index b634d22e51..0d9af1d87e 100644 --- a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.email; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java index d1203870d6..97c8ed4dce 100644 --- a/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java +++ b/ecosystem/error-handler/email/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandlerTest.java @@ -20,7 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; diff --git a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java index ba09daa39c..bff139e161 100644 --- a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandler.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; /** * Job error handler for ignore exception. diff --git a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java index ab09c3b3cf..506009c61a 100644 --- a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandler.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; /** * Job error handler for log error message. diff --git a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java index 01ec88a6c5..88da113910 100644 --- a/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java +++ b/ecosystem/error-handler/normal/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandler.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; /** * Job error handler for throw exception. diff --git a/ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/normal/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java index b4753be052..cec199cd60 100644 --- a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/IgnoreJobErrorHandlerTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java index ff88b8c811..acdfb044b6 100644 --- a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/LogJobErrorHandlerTest.java @@ -20,7 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java index d8575671f3..7b82744729 100644 --- a/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java +++ b/ecosystem/error-handler/normal/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/normal/ThrowJobErrorHandlerTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.normal; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java index 3c76acb95b..903867157b 100644 --- a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java +++ b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandler.java @@ -29,7 +29,7 @@ import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import java.io.IOException; import java.io.PrintWriter; diff --git a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java index 70845377b6..bd1e056eb8 100644 --- a/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java +++ b/ecosystem/error-handler/wechat/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidator.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.PropertiesPreconditions; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator; import java.util.Properties; diff --git a/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler b/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler similarity index 100% rename from ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler rename to ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler diff --git a/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator b/ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator similarity index 100% rename from ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator rename to ecosystem/error-handler/wechat/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator diff --git a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java index 286a09330e..108964c2a3 100644 --- a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java +++ b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerPropertiesValidatorTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.error.handler.wechat; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; diff --git a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index 8ac0470e36..97041d52aa 100644 --- a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -21,7 +21,7 @@ import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; import org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture.WechatInternalController; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; diff --git a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java index f3b1d3806e..2547527b3b 100644 --- a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java +++ b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutor.java @@ -18,11 +18,11 @@ package org.apache.shardingsphere.elasticjob.dataflow.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor; import java.util.List; diff --git a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java index a8009ead2f..38f330cac4 100644 --- a/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java +++ b/ecosystem/executor/dataflow/src/main/java/org/apache/shardingsphere/elasticjob/dataflow/job/DataflowJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.dataflow.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import java.util.List; diff --git a/ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor b/ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor rename to ecosystem/executor/dataflow/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java b/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java index 439efa5d91..a7603ed028 100644 --- a/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java +++ b/ecosystem/executor/dataflow/src/test/java/org/apache/shardingsphere/elasticjob/dataflow/executor/DataflowJobExecutorTest.java @@ -18,10 +18,10 @@ package org.apache.shardingsphere.elasticjob.dataflow.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java index 19d633c40e..1ad5588d0a 100644 --- a/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java +++ b/ecosystem/executor/http/src/main/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutor.java @@ -25,9 +25,9 @@ import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionException; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor; import java.io.BufferedReader; import java.io.IOException; diff --git a/ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor b/ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor rename to ecosystem/executor/http/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor diff --git a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java index 20852386c1..ad25edb04a 100644 --- a/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java +++ b/ecosystem/executor/http/src/test/java/org/apache/shardingsphere/elasticjob/http/executor/HttpJobExecutorTest.java @@ -25,8 +25,8 @@ import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulServiceConfiguration; import org.apache.shardingsphere.elasticjob.restful.RestfulService; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java index cd6177dde6..6fef6457ea 100644 --- a/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java +++ b/ecosystem/executor/script/src/main/java/org/apache/shardingsphere/elasticjob/script/executor/ScriptJobExecutor.java @@ -22,9 +22,9 @@ import org.apache.commons.exec.DefaultExecutor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; diff --git a/ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor b/ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor similarity index 100% rename from ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor rename to ecosystem/executor/script/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor diff --git a/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java b/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java index febe4f5613..935b7fc050 100644 --- a/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java +++ b/ecosystem/executor/script/src/test/java/org/apache/shardingsphere/elasticjob/script/ScriptJobExecutorTest.java @@ -20,8 +20,8 @@ import org.apache.commons.exec.OS; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor; diff --git a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java index 7ff8134aa9..fa51474481 100644 --- a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java +++ b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.simple.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; /** diff --git a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java index de6005ca18..c32211310b 100644 --- a/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java +++ b/ecosystem/executor/simple/src/main/java/org/apache/shardingsphere/elasticjob/simple/job/SimpleJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; /** * Simple job. diff --git a/ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor b/ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor similarity index 100% rename from ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor rename to ecosystem/executor/simple/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor diff --git a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java index dba7f87ec0..969982e548 100644 --- a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java +++ b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/executor/SimpleJobExecutorTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.simple.job.FooSimpleJob; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java index e314e7dd14..b0910df78d 100644 --- a/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java +++ b/ecosystem/executor/simple/src/test/java/org/apache/shardingsphere/elasticjob/simple/job/FooSimpleJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.simple.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; @Getter public final class FooSimpleJob implements SimpleJob { diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfiguration.java index 7d80065e9d..be918f9c50 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfiguration.java @@ -24,7 +24,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource.DataSourceRegistry; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource.JDBCParameterDecorator; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java index 448905610d..cf764477f1 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListener; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactory.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactory.java index 41ab709416..a22d592521 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactory.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactory.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory; +import org.apache.shardingsphere.elasticjob.spi.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory; import javax.sql.DataSource; import java.sql.SQLException; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConfigurationConverter.java similarity index 83% rename from ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverter.java rename to ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConfigurationConverter.java index 6cb81c55c1..90cc6af370 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConfigurationConverter.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; -import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter; import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.datasource.DataSourceRegistry; @@ -32,10 +32,10 @@ * RDB tracing storage converter. */ @Slf4j -public final class RDBTracingStorageConverter implements TracingStorageConverter { +public final class RDBTracingStorageConfigurationConverter implements TracingStorageConfigurationConverter { @Override - public TracingStorageConfiguration convertToConfiguration(final DataSource dataSource) { + public TracingStorageConfiguration toConfiguration(final DataSource dataSource) { try (Connection connection = dataSource.getConnection()) { log.trace("Try to get connection from {}", connection.getMetaData().getURL()); } catch (final SQLException ex) { diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java index 0248e633b5..9bfbf6f274 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepository.java @@ -19,9 +19,9 @@ import com.google.common.base.Strings; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.RDBStorageSQLMapper; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.SQLPropertiesFactory; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java index 1c8a89471c..3cab8d6be9 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfiguration.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; diff --git a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java index d995f363d6..70128c85fa 100644 --- a/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java +++ b/ecosystem/tracing/rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/yaml/YamlDataSourceConfigurationConverter.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.yaml; -import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.tracing.rdb.config.RDBTracingStorageConfiguration; diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory similarity index 100% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter similarity index 95% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter index a4db540327..590d3becc0 100644 --- a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter +++ b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConverter +org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConfigurationConverter diff --git a/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter b/ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter similarity index 100% rename from ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter rename to ecosystem/tracing/rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java index 31384fb2ad..78a1469088 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.spi.tracing.exception.TracingConfigurationException; import org.junit.jupiter.api.Test; import javax.sql.DataSource; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index d66b25566b..1f146704b7 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -18,12 +18,12 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository; import org.junit.jupiter.api.BeforeEach; diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverterTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConfigurationConverterTest.java similarity index 79% rename from ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverterTest.java rename to ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConfigurationConverterTest.java index 5311dcd5bb..77b4e608c3 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConverterTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/converter/RDBTracingStorageConfigurationConverterTest.java @@ -19,7 +19,7 @@ import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingStorageUnavailableException; -import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter; import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -39,7 +39,7 @@ import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -class RDBTracingStorageConverterTest { +class RDBTracingStorageConfigurationConverterTest { @Mock private DataSource dataSource; @@ -55,22 +55,22 @@ void assertConvert() throws SQLException { when(dataSource.getConnection()).thenReturn(connection); when(connection.getMetaData()).thenReturn(databaseMetaData); when(databaseMetaData.getURL()).thenReturn("jdbc:url"); - RDBTracingStorageConverter converter = new RDBTracingStorageConverter(); - assertNotNull(converter.convertToConfiguration(dataSource)); + RDBTracingStorageConfigurationConverter converter = new RDBTracingStorageConfigurationConverter(); + assertNotNull(converter.toConfiguration(dataSource)); } @Test void assertConvertFailed() { assertThrows(TracingStorageUnavailableException.class, () -> { - RDBTracingStorageConverter converter = new RDBTracingStorageConverter(); + RDBTracingStorageConfigurationConverter converter = new RDBTracingStorageConfigurationConverter(); doThrow(SQLException.class).when(dataSource).getConnection(); - converter.convertToConfiguration(dataSource); + converter.toConfiguration(dataSource); }); } @Test void assertStorageType() { - TracingStorageConverter converter = TracingStorageConverterFactory.findConverter(HikariDataSource.class).orElse(null); + TracingStorageConfigurationConverter converter = TracingStorageConverterFactory.findConverter(HikariDataSource.class).orElse(null); assertNotNull(converter); assertThat(converter.storageType(), is(DataSource.class)); } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java index a2950c3dbf..9afa7b6f91 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java @@ -18,10 +18,10 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository; import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent.State; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml index 17a6dfd847..93c6fecd5d 100644 --- a/ecosystem/tracing/rdb/src/test/resources/logback-test.xml +++ b/ecosystem/tracing/rdb/src/test/resources/logback-test.xml @@ -38,5 +38,5 @@ - + diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java index 08f20d1876..a2ff3209f7 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/JavaDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.dataflow; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java index e6c01aa5eb..9cc3e2c2cb 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.dataflow; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java index 3bc494e706..a9cf55ad07 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaOccurErrorJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; public final class JavaOccurErrorJob implements SimpleJob { diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java index 5310c7d6e9..90d7690ea9 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/JavaSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java index bf2ccaae80..3f2e4ee18d 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java index c0eee45820..32baef85a4 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootDataflowJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.entity.Foo; import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java index a261595d47..ad38263bff 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeDingtalkJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java index f6b31f4455..42e3bf4154 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeEmailJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java index f11efc9344..1e605122a7 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootOccurErrorNoticeWechatJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.springframework.stereotype.Component; diff --git a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java index 13e6a8bc5a..caf18bcfdc 100644 --- a/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java +++ b/examples/elasticjob-example-springboot/src/main/java/org/apache/shardingsphere/elasticjob/example/job/SpringBootSimpleJob.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.example.job; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.example.entity.Foo; import org.apache.shardingsphere.elasticjob.example.repository.FooRepository; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutor.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutor.java index aa2dbc43f5..c6623896d6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutor.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutor.java @@ -20,20 +20,20 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerReloader; import org.apache.shardingsphere.elasticjob.kernel.executor.facade.JobFacade; -import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.JobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.executor.item.JobItemExecutorFactory; -import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader; import org.apache.shardingsphere.elasticjob.kernel.infra.env.IpUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.ExceptionUtils; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent.ExecutionSource; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent.ExecutionSource; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent.State; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.Collection; @@ -52,6 +52,7 @@ public final class ElasticJobExecutor { private final JobFacade jobFacade; + @SuppressWarnings("rawtypes") private final JobItemExecutor jobItemExecutor; private final ExecutorServiceReloader executorServiceReloader; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloader.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloader.java index dd925cd316..ec9e546a0a 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloader.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloader.java @@ -19,6 +19,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.io.Closeable; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java index 98f93e8b09..7c6eaf040d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobFacade.java @@ -30,12 +30,12 @@ import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService; import org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent.State; import java.util.Collection; import java.util.Comparator; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobJobRuntimeServiceImpl.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobJobRuntimeServiceImpl.java index 881c904f13..952ac3bff4 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobJobRuntimeServiceImpl.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/facade/JobJobRuntimeServiceImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.executor.facade; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; /** * Job runtime service implementation. diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactory.java index b5db62cd3e..f28def299d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/executor/item/JobItemExecutorFactory.java @@ -20,8 +20,8 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.JobItemExecutor; -import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.JobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobConfigurationException; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java index 1d9a912412..9d5ca39c99 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/config/JobConfigurationPOJO.java @@ -21,8 +21,8 @@ import lombok.Setter; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfiguration; +import org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.ArrayList; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java index 391bcaccfd..a827dccf35 100755 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContext.java @@ -24,7 +24,7 @@ import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.ToString; -import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; import java.util.Collections; import java.util.List; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java index e49e63bf26..0311b6fc6f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/internal/schedule/JobScheduler.java @@ -22,7 +22,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerPropertiesValidator; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandlerPropertiesValidator; import org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; import org.apache.shardingsphere.elasticjob.kernel.executor.facade.JobFacade; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java index c700c470d8..6f993db14d 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/config/TracingConfiguration.java @@ -21,6 +21,7 @@ import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.api.JobExtraConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.exception.ServiceProviderNotFoundException; /** @@ -40,6 +41,6 @@ public final class TracingConfiguration implements JobExtraConfiguration { public TracingConfiguration(final String type, final T storage) { this.type = type; tracingStorageConfiguration = TracingStorageConverterFactory.findConverter((Class) storage.getClass()) - .orElseThrow(() -> new ServiceProviderNotFoundException(storage.getClass(), storage.getClass().getSimpleName())).convertToConfiguration(storage); + .orElseThrow(() -> new ServiceProviderNotFoundException(storage.getClass(), storage.getClass().getSimpleName())).toConfiguration(storage); } } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java index 6dbd317899..86128eaf90 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBus.java @@ -23,8 +23,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.exception.TracingConfigurationException; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory; +import org.apache.shardingsphere.elasticjob.spi.tracing.exception.TracingConfigurationException; +import org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobEvent; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import java.util.concurrent.ExecutorService; diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactory.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactory.java index 674a4e6d2e..0fc466e150 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactory.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactory.java @@ -19,26 +19,27 @@ import lombok.AccessLevel; import lombok.NoArgsConstructor; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter; import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader; import java.util.Optional; /** - * Factory for {@link TracingStorageConverter}. + * Factory for {@link TracingStorageConfigurationConverter}. */ @NoArgsConstructor(access = AccessLevel.PRIVATE) public final class TracingStorageConverterFactory { /** - * Find {@link TracingStorageConverter} for specific storage type. + * Find {@link TracingStorageConfigurationConverter} for specific storage type. * * @param storageType storage type * @param storage type - * @return instance of {@link TracingStorageConverter} + * @return instance of {@link TracingStorageConfigurationConverter} */ @SuppressWarnings("unchecked") - public static Optional> findConverter(final Class storageType) { - return ShardingSphereServiceLoader.getServiceInstances(TracingStorageConverter.class).stream() - .filter(each -> each.storageType().isAssignableFrom(storageType)).map(each -> (TracingStorageConverter) each).findFirst(); + public static Optional> findConverter(final Class storageType) { + return ShardingSphereServiceLoader.getServiceInstances(TracingStorageConfigurationConverter.class).stream() + .filter(each -> each.storageType().isAssignableFrom(storageType)).map(each -> (TracingStorageConfigurationConverter) each).findFirst(); } } diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java index bd1985b4b2..1990d004d6 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfiguration.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; +import org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java index 989f99eec7..e91fdb87a2 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingConfigurationConverter.java @@ -17,9 +17,9 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; -import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; /** diff --git a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java index c3201e6d57..ceeb33a58f 100644 --- a/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java +++ b/kernel/src/main/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlTracingStorageConfiguration.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; -import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; /** * YAML configuration for {@link TracingStorageConfiguration}. diff --git a/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter b/kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter similarity index 100% rename from kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter rename to kernel/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutorTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutorTest.java index 5f44299d2e..220ae2df9c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutorTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/ElasticJobExecutorTest.java @@ -23,8 +23,8 @@ import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobExecutionEnvironmentException; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent.State; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent.State; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; import org.apache.shardingsphere.elasticjob.spi.listener.param.ShardingContexts; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.BeforeEach; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloaderTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloaderTest.java index 2cba36ca32..8956e5a029 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloaderTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/JobErrorHandlerReloaderTest.java @@ -20,6 +20,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture.BarJobErrorHandlerFixture; import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture.FooJobErrorHandlerFixture; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/BarJobErrorHandlerFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/BarJobErrorHandlerFixture.java index 360da8848a..f3269d08bb 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/BarJobErrorHandlerFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/BarJobErrorHandlerFixture.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; public final class BarJobErrorHandlerFixture implements JobErrorHandler { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/FooJobErrorHandlerFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/FooJobErrorHandlerFixture.java index 324306fea9..2ce50e5635 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/FooJobErrorHandlerFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/executor/error/handler/fixture/FooJobErrorHandlerFixture.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.fixture; import org.apache.shardingsphere.elasticjob.kernel.infra.exception.JobSystemException; -import org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler; +import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; public final class FooJobErrorHandlerFixture implements JobErrorHandler { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java index fbe294734f..95be8fb150 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/ClassedFooJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.kernel.fixture.job.FooJob; public final class ClassedFooJobExecutor implements ClassedJobItemExecutor { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java index 52fbcd893d..fd7b717fcf 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/executor/TypedFooJobExecutor.java @@ -19,9 +19,9 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor; public final class TypedFooJobExecutor implements TypedJobItemExecutor { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java index 2a94673197..b4e33468db 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/DetailedFooJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java index f114912941..10ec9232b2 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/fixture/job/FooJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; public interface FooJob extends ElasticJob { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java index 5c9edf8645..0192f72b6e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/TaskContextTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context; -import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.kernel.internal.context.TaskContext.MetaInfo; import org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture.TaskNode; import org.hamcrest.CoreMatchers; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java index ae9b6383d1..3c4bfadaf6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/internal/context/fixture/TaskNode.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.kernel.internal.context.fixture; import lombok.Builder; -import org.apache.shardingsphere.elasticjob.kernel.executor.ExecutionType; +import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; @Builder public final class TaskNode { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEventTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEventTest.java index b2cef1a454..22433ddd49 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEventTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobExecutionEventTest.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.event; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java index 3387d530ab..e0bc5a4f4d 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/event/JobTracingEventBusTest.java @@ -21,6 +21,8 @@ import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener.TracingListenerFixture; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java index 95319dba1c..0d0714181c 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageConfigurationFixture.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; @RequiredArgsConstructor @Getter diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConfigurationConverter.java similarity index 71% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConfigurationConverter.java index 308e66655a..25134464ef 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/config/TracingStorageFixtureConfigurationConverter.java @@ -17,13 +17,13 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; -import org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter; -public final class TracingStorageFixtureConverter implements TracingStorageConverter { +public final class TracingStorageFixtureConfigurationConverter implements TracingStorageConfigurationConverter { @Override - public TracingStorageConfiguration convertToConfiguration(final TracingStorageFixture storage) { + public TracingStorageConfiguration toConfiguration(final TracingStorageFixture storage) { return new TracingStorageConfigurationFixture(storage); } diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixture.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixture.java index e92be453f0..2ac4182a4e 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixture.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixture.java @@ -20,9 +20,9 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobExecutionEvent; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobStatusTraceEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; +import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; @RequiredArgsConstructor public final class TracingListenerFixture implements TracingListener { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixtureFactory.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixtureFactory.java index c61c7250e7..d2f7b5eb81 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixtureFactory.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/fixture/listener/TracingListenerFixtureFactory.java @@ -18,8 +18,8 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.listener; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory; -import org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListener; +import org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory; +import org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListener; public final class TracingListenerFixtureFactory implements TracingListenerFactory { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConfigurationConverterFactoryTest.java similarity index 96% rename from kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java rename to kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConfigurationConverterFactoryTest.java index e3f7f71255..80d47d60a6 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConverterFactoryTest.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/storage/TracingStorageConfigurationConverterFactoryTest.java @@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -class TracingStorageConverterFactoryTest { +class TracingStorageConfigurationConverterFactoryTest { @Test void assertConverterExists() { diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java index c5c8502209..e826072679 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfiguration.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageConfigurationFixture; diff --git a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java index 011f938ff1..84e9c5eb75 100644 --- a/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java +++ b/kernel/src/test/java/org/apache/shardingsphere/elasticjob/kernel/tracing/yaml/YamlJobEventCallerConfigurationConverter.java @@ -17,8 +17,8 @@ package org.apache.shardingsphere.elasticjob.kernel.tracing.yaml; -import org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingStorageConfiguration; +import org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter; +import org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfiguration; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixture; import org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageConfigurationFixture; diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandler rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.listener.TracingListenerFactory rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter similarity index 94% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter index 2e11a5dec6..5e15aaaed2 100644 --- a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverter +++ b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter @@ -15,4 +15,4 @@ # limitations under the License. # -org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixtureConverter +org.apache.shardingsphere.elasticjob.kernel.tracing.fixture.config.TracingStorageFixtureConfigurationConverter diff --git a/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter b/kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter similarity index 100% rename from kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.kernel.infra.yaml.config.YamlConfigurationConverter rename to kernel/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java index c3ea0c5445..a323928dae 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/CustomClassedJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; public final class CustomClassedJobExecutor implements ClassedJobItemExecutor { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java index 43f7d249cc..6b826b4d14 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/executor/PrintJobExecutor.java @@ -20,9 +20,9 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor; @Slf4j public final class PrintJobExecutor implements TypedJobItemExecutor { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java index b3015cca8d..a23fd7b8f2 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/CustomJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; public interface CustomJob extends ElasticJob { diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java index 7992abc35a..6b6b81dd2c 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/AnnotationCustomJob.java @@ -21,7 +21,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; import org.springframework.transaction.annotation.Transactional; diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java index ebda24390b..0ee8bcfa04 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/job/fixture/job/impl/CustomTestJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.impl; import lombok.extern.slf4j.Slf4j; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.spring.boot.job.fixture.job.CustomJob; import org.apache.shardingsphere.elasticjob.spring.boot.job.repository.BarRepository; import org.springframework.beans.factory.annotation.Autowired; diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor diff --git a/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor b/spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor similarity index 100% rename from spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.TypedJobItemExecutor rename to spring/boot-starter/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor diff --git a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java index 1b100c73b0..14db9f6f55 100644 --- a/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java +++ b/spring/core/src/test/java/org/apache/shardingsphere/elasticjob/spring/core/util/TargetJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.core.util; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; public class TargetJob implements ElasticJob { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java index dd2345f313..d24f774745 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/DataflowElasticJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import java.util.Collections; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java index a2adbe1331..e6d6cec6ac 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/FooSimpleElasticJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.spring.namespace.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; public class FooSimpleElasticJob implements SimpleJob { diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java index eb17cc2746..b9b8c7281c 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/annotation/AnnotationSimpleJob.java @@ -20,7 +20,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; @Getter diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java index 2dfa998190..2d7518aa85 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooDataflowElasticJob.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; diff --git a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java index d65ddf5770..bd037c9fa1 100644 --- a/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java +++ b/spring/namespace/src/test/java/org/apache/shardingsphere/elasticjob/spring/namespace/fixture/job/ref/RefFooSimpleElasticJob.java @@ -19,7 +19,7 @@ import lombok.Getter; import lombok.Setter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.spring.namespace.fixture.service.FooService; diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java index babcc7c605..9ef84b84b3 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationSimpleJob.java @@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobProp; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; @ElasticJobConfiguration( jobName = "AnnotationSimpleJob", diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java index 0bd7def12d..f376efc69e 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/fixture/AnnotationUnShardingJob.java @@ -20,7 +20,7 @@ import lombok.Getter; import org.apache.shardingsphere.elasticjob.annotation.ElasticJobConfiguration; import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; @ElasticJobConfiguration(jobName = "AnnotationUnShardingJob", description = "desc", shardingTotalCount = 1) @Getter diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java index ef57329956..e81af6fd14 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/executor/E2EFixtureJobExecutor.java @@ -18,9 +18,9 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.executor; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; -import org.apache.shardingsphere.elasticjob.spi.executor.param.JobRuntimeService; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.JobRuntimeService; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor; import org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job.E2EFixtureJob; public final class E2EFixtureJobExecutor implements ClassedJobItemExecutor { diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java index 9b2aec429c..118002b5c8 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJob.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job; import org.apache.shardingsphere.elasticjob.api.ElasticJob; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; public interface E2EFixtureJob extends ElasticJob { diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java index 8bfe65c7f8..60ae346a11 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/fixture/job/E2EFixtureJobImpl.java @@ -18,7 +18,7 @@ package org.apache.shardingsphere.elasticjob.test.e2e.raw.fixture.job; import lombok.Getter; -import org.apache.shardingsphere.elasticjob.spi.executor.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import java.util.Collection; import java.util.concurrent.CopyOnWriteArraySet; diff --git a/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor b/test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor similarity index 100% rename from test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.type.ClassedJobItemExecutor rename to test/e2e/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor From 0517b4af7428a632e418ec630ceaf9b89e2a546e Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Wed, 1 Nov 2023 21:38:19 +0800 Subject: [PATCH 159/178] Remove useless dependencies (#2362) * Remove commons-pool2 * Remove useless dependencies --- .../usage/tracing/spring-namespace.cn.md | 4 ++-- .../usage/tracing/spring-namespace.en.md | 4 ++-- ecosystem/tracing/rdb/pom.xml | 5 ---- .../RDBTracingStorageConfigurationTest.java | 24 +++++++------------ .../RDBTracingListenerFactoryTest.java | 7 +++--- .../rdb/listener/RDBTracingListenerTest.java | 10 ++++---- .../repository/RDBJobEventRepositoryTest.java | 10 ++++---- .../META-INF/application-context.xml | 4 ++-- pom.xml | 13 ---------- spring/namespace/pom.xml | 5 ---- .../src/test/resources/META-INF/job/base.xml | 4 ++-- 11 files changed, 29 insertions(+), 61 deletions(-) diff --git a/docs/content/user-manual/usage/tracing/spring-namespace.cn.md b/docs/content/user-manual/usage/tracing/spring-namespace.cn.md index bb5c497ef2..c45b5008ac 100644 --- a/docs/content/user-manual/usage/tracing/spring-namespace.cn.md +++ b/docs/content/user-manual/usage/tracing/spring-namespace.cn.md @@ -35,9 +35,9 @@ chapter = true - + - + diff --git a/docs/content/user-manual/usage/tracing/spring-namespace.en.md b/docs/content/user-manual/usage/tracing/spring-namespace.en.md index d5f68f07f1..c58c531938 100644 --- a/docs/content/user-manual/usage/tracing/spring-namespace.en.md +++ b/docs/content/user-manual/usage/tracing/spring-namespace.en.md @@ -33,9 +33,9 @@ chapter = true - + - + diff --git a/ecosystem/tracing/rdb/pom.xml b/ecosystem/tracing/rdb/pom.xml index 1bf77c6f3a..2dcc16378e 100644 --- a/ecosystem/tracing/rdb/pom.xml +++ b/ecosystem/tracing/rdb/pom.xml @@ -40,11 +40,6 @@ test - - org.apache.commons - commons-dbcp2 - test - com.zaxxer HikariCP diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfigurationTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfigurationTest.java index 2ba5f83811..b733454f94 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfigurationTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/config/RDBTracingStorageConfigurationTest.java @@ -18,17 +18,13 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.config; import com.zaxxer.hikari.HikariDataSource; -import org.apache.commons.dbcp2.BasicDataSource; import org.junit.jupiter.api.Test; +import javax.sql.DataSource; import java.sql.SQLException; -import java.util.Arrays; import java.util.HashMap; -import java.util.List; import java.util.Map; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; @@ -119,29 +115,25 @@ void assertDifferentHashCode() { targetDataSourceConfig.getProps().put("password", "root"); assertThat(originalDataSourceConfig.hashCode(), not(targetDataSourceConfig.hashCode())); originalDataSourceConfig = new RDBTracingStorageConfiguration(HikariDataSource.class.getName()); - targetDataSourceConfig = new RDBTracingStorageConfiguration(BasicDataSource.class.getName()); + targetDataSourceConfig = new RDBTracingStorageConfiguration(DataSource.class.getName()); assertThat(originalDataSourceConfig.hashCode(), not(targetDataSourceConfig.hashCode())); } - @SuppressWarnings("unchecked") @Test void assertGetDataSourceConfigurationWithConnectionInitSqls() { - BasicDataSource actualDataSource = new BasicDataSource(); + HikariDataSource actualDataSource = new HikariDataSource(); actualDataSource.setDriverClassName("org.h2.Driver"); - actualDataSource.setUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL"); + actualDataSource.setJdbcUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL"); actualDataSource.setUsername("root"); actualDataSource.setPassword("root"); - actualDataSource.setConnectionInitSqls(Arrays.asList("set names utf8mb4;", "set names utf8;")); + actualDataSource.setConnectionInitSql("set names utf8mb4;set names utf8;"); RDBTracingStorageConfiguration actual = RDBTracingStorageConfiguration.getDataSourceConfiguration(actualDataSource); - assertThat(actual.getDataSourceClassName(), is(BasicDataSource.class.getName())); + assertThat(actual.getDataSourceClassName(), is(HikariDataSource.class.getName())); assertThat(actual.getProps().get("driverClassName").toString(), is("org.h2.Driver")); - assertThat(actual.getProps().get("url").toString(), is("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL")); + assertThat(actual.getProps().get("jdbcUrl").toString(), is("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL")); assertThat(actual.getProps().get("username").toString(), is("root")); assertThat(actual.getProps().get("password").toString(), is("root")); assertNull(actual.getProps().get("loginTimeout")); - assertThat(actual.getProps().get("connectionInitSqls"), instanceOf(List.class)); - List actualConnectionInitSql = (List) actual.getProps().get("connectionInitSqls"); - assertThat(actualConnectionInitSql, hasItem("set names utf8mb4;")); - assertThat(actualConnectionInitSql, hasItem("set names utf8;")); + assertThat(actual.getProps().get("connectionInitSql"), is("set names utf8mb4;set names utf8;")); } } diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java index 78a1469088..eaa8bac8a0 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerFactoryTest.java @@ -17,12 +17,11 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.commons.dbcp2.BasicDataSource; +import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.spi.tracing.exception.TracingConfigurationException; import org.junit.jupiter.api.Test; import javax.sql.DataSource; - import java.sql.SQLException; import static org.hamcrest.CoreMatchers.instanceOf; @@ -35,9 +34,9 @@ class RDBTracingListenerFactoryTest { @Test void assertCreateTracingListenerSuccess() throws TracingConfigurationException { - BasicDataSource dataSource = new BasicDataSource(); + HikariDataSource dataSource = new HikariDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); - dataSource.setUrl("jdbc:h2:mem:job_event_storage"); + dataSource.setJdbcUrl("jdbc:h2:mem:job_event_storage"); dataSource.setUsername("sa"); dataSource.setPassword(""); assertThat(new RDBTracingListenerFactory().create(dataSource), instanceOf(RDBTracingListener.class)); diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java index 1f146704b7..a21fff4f4c 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java @@ -17,10 +17,10 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.listener; -import org.apache.commons.dbcp2.BasicDataSource; -import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; -import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus; +import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus; +import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent.State; @@ -50,9 +50,9 @@ class RDBTracingListenerTest { @BeforeEach void setUp() throws SQLException { - BasicDataSource dataSource = new BasicDataSource(); + HikariDataSource dataSource = new HikariDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); - dataSource.setUrl("jdbc:h2:mem:job_event_storage"); + dataSource.setJdbcUrl("jdbc:h2:mem:job_event_storage"); dataSource.setUsername("sa"); dataSource.setPassword(""); RDBTracingListener tracingListener = new RDBTracingListener(dataSource); diff --git a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java index 9afa7b6f91..ee239ece63 100644 --- a/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java +++ b/ecosystem/tracing/rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/repository/RDBJobEventRepositoryTest.java @@ -17,7 +17,7 @@ package org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository; -import org.apache.commons.dbcp2.BasicDataSource; +import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.spi.executor.ExecutionType; import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobExecutionEvent; import org.apache.shardingsphere.elasticjob.spi.tracing.event.JobStatusTraceEvent; @@ -39,20 +39,20 @@ class RDBJobEventRepositoryTest { private RDBJobEventRepository repository; - private BasicDataSource dataSource; + private HikariDataSource dataSource; @BeforeEach void setup() throws SQLException { - dataSource = new BasicDataSource(); + dataSource = new HikariDataSource(); dataSource.setDriverClassName(org.h2.Driver.class.getName()); - dataSource.setUrl("jdbc:h2:mem:job_event_storage"); + dataSource.setJdbcUrl("jdbc:h2:mem:job_event_storage"); dataSource.setUsername("sa"); dataSource.setPassword(""); repository = RDBJobEventRepository.getInstance(dataSource); } @AfterEach - void teardown() throws SQLException { + void tearDown() { dataSource.close(); } diff --git a/examples/elasticjob-example-spring/src/main/resources/META-INF/application-context.xml b/examples/elasticjob-example-spring/src/main/resources/META-INF/application-context.xml index 4706d4fda0..94acf66557 100644 --- a/examples/elasticjob-example-spring/src/main/resources/META-INF/application-context.xml +++ b/examples/elasticjob-example-spring/src/main/resources/META-INF/application-context.xml @@ -36,9 +36,9 @@ - + - + diff --git a/pom.xml b/pom.xml index 8ef6e35f32..13f3c90577 100644 --- a/pom.xml +++ b/pom.xml @@ -91,8 +91,6 @@ 2.2.224 4.0.3 - 2.10.0 - 2.11.1 3.2.1 @@ -359,17 +357,6 @@ HikariCP ${hikari-cp.version} - - org.apache.commons - commons-dbcp2 - ${commons-dbcp2.version} - test - - - org.apache.commons - commons-pool2 - ${commons-pool2.version} - diff --git a/spring/namespace/pom.xml b/spring/namespace/pom.xml index 48ba28d340..62d842f237 100644 --- a/spring/namespace/pom.xml +++ b/spring/namespace/pom.xml @@ -80,11 +80,6 @@ com.h2database h2 - - org.apache.commons - commons-dbcp2 - test - org.awaitility awaitility diff --git a/spring/namespace/src/test/resources/META-INF/job/base.xml b/spring/namespace/src/test/resources/META-INF/job/base.xml index b2b83c4509..9162e848bd 100644 --- a/spring/namespace/src/test/resources/META-INF/job/base.xml +++ b/spring/namespace/src/test/resources/META-INF/job/base.xml @@ -32,9 +32,9 @@ - + - + From 0b3a6eb993ee1abcb8ae81efa6ccaeb9b494ea5c Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Wed, 1 Nov 2023 22:53:32 +0800 Subject: [PATCH 160/178] Revise example (#2363) * Revise example * Revise example --- ecosystem/tracing/rdb/pom.xml | 1 - examples/elasticjob-example-java/pom.xml | 10 ++++++---- .../elasticjob/example/JavaMain.java | 14 +++++++------- .../job/dataflow/SpringDataflowJob.java | 6 +++--- .../example/job/simple/SpringSimpleJob.java | 8 ++++---- examples/elasticjob-example-spring/pom.xml | 10 ++++++---- examples/pom.xml | 18 +++++++++++------- 7 files changed, 37 insertions(+), 30 deletions(-) diff --git a/ecosystem/tracing/rdb/pom.xml b/ecosystem/tracing/rdb/pom.xml index 2dcc16378e..840e367dac 100644 --- a/ecosystem/tracing/rdb/pom.xml +++ b/ecosystem/tracing/rdb/pom.xml @@ -43,7 +43,6 @@ com.zaxxer HikariCP - test com.h2database diff --git a/examples/elasticjob-example-java/pom.xml b/examples/elasticjob-example-java/pom.xml index 88190535ad..b0cb73419d 100644 --- a/examples/elasticjob-example-java/pom.xml +++ b/examples/elasticjob-example-java/pom.xml @@ -76,10 +76,7 @@ ch.qos.logback logback-classic - - org.apache.commons - commons-dbcp2 - + com.h2database h2 @@ -88,5 +85,10 @@ com.mysql mysql-connector-j + + + com.zaxxer + HikariCP + diff --git a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java index d5502cf2ff..c559e8bb5a 100644 --- a/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java +++ b/examples/elasticjob-example-java/src/main/java/org/apache/shardingsphere/elasticjob/example/JavaMain.java @@ -17,23 +17,23 @@ package org.apache.shardingsphere.elasticjob.example; -import org.apache.commons.dbcp2.BasicDataSource; +import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; import org.apache.shardingsphere.elasticjob.error.handler.dingtalk.DingtalkPropertiesConstants; import org.apache.shardingsphere.elasticjob.error.handler.email.EmailPropertiesConstants; import org.apache.shardingsphere.elasticjob.error.handler.wechat.WechatPropertiesConstants; import org.apache.shardingsphere.elasticjob.example.job.dataflow.JavaDataflowJob; -import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; -import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; -import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; import org.apache.shardingsphere.elasticjob.example.job.simple.JavaOccurErrorJob; import org.apache.shardingsphere.elasticjob.example.job.simple.JavaSimpleJob; +import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; -import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import javax.sql.DataSource; import java.io.IOException; @@ -86,9 +86,9 @@ private static CoordinatorRegistryCenter setUpRegistryCenter() { } private static DataSource setUpEventTraceDataSource() { - BasicDataSource result = new BasicDataSource(); + HikariDataSource result = new HikariDataSource(); result.setDriverClassName(EVENT_RDB_STORAGE_DRIVER); - result.setUrl(EVENT_RDB_STORAGE_URL); + result.setJdbcUrl(EVENT_RDB_STORAGE_URL); result.setUsername(EVENT_RDB_STORAGE_USERNAME); result.setPassword(EVENT_RDB_STORAGE_PASSWORD); return result; diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java index 9cc3e2c2cb..32f332ebbc 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/dataflow/SpringDataflowJob.java @@ -17,19 +17,19 @@ package org.apache.shardingsphere.elasticjob.example.job.dataflow; -import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; public class SpringDataflowJob implements DataflowJob { - @Resource + @Autowired private FooRepository fooRepository; @Override diff --git a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java index 3f2e4ee18d..4f5e794b0c 100644 --- a/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java +++ b/examples/elasticjob-example-jobs/src/main/java/org/apache/shardingsphere/elasticjob/example/job/simple/SpringSimpleJob.java @@ -17,19 +17,19 @@ package org.apache.shardingsphere.elasticjob.example.job.simple; -import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; -import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; import org.apache.shardingsphere.elasticjob.example.fixture.entity.Foo; import org.apache.shardingsphere.elasticjob.example.fixture.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.springframework.beans.factory.annotation.Autowired; -import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; public class SpringSimpleJob implements SimpleJob { - @Resource + @Autowired private FooRepository fooRepository; @Override diff --git a/examples/elasticjob-example-spring/pom.xml b/examples/elasticjob-example-spring/pom.xml index ca6fdf3b1c..1ab4ffaa76 100644 --- a/examples/elasticjob-example-spring/pom.xml +++ b/examples/elasticjob-example-spring/pom.xml @@ -80,10 +80,7 @@ ch.qos.logback logback-classic - - org.apache.commons - commons-dbcp2 - + com.h2database h2 @@ -92,5 +89,10 @@ com.mysql mysql-connector-j + + + com.zaxxer + HikariCP + diff --git a/examples/pom.xml b/examples/pom.xml index a919a8399c..44330cc31d 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -44,11 +44,12 @@ 1.7.36 1.2.12 - - 2.10.0 + 2.2.224 8.0.31 + 4.0.3 + 3.3 1.2.5 @@ -81,6 +82,7 @@ spring-context ${springframework.version} + org.slf4j slf4j-api @@ -101,11 +103,7 @@ logback-classic ${logback.version} - - org.apache.commons - commons-dbcp2 - ${commons-dbcp2.version} - + com.h2database h2 @@ -116,6 +114,12 @@ mysql-connector-j ${mysql-connector-java.version} + + + com.zaxxer + HikariCP + ${hikari-cp.version} + From 8911bdaaf25260b2221a02e086a6c4a690c66d65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:21:05 +0800 Subject: [PATCH 161/178] Bump ch.qos.logback:logback-core from 1.2.12 to 1.2.13 (#2375) Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.2.12 to 1.2.13. - [Commits](https://github.com/qos-ch/logback/compare/v_1.2.12...v_1.2.13) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 13f3c90577..dcf218af60 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 4.1.99.Final 1.7.36 - 1.2.12 + 1.2.13 1.18.30 From bf6a59bff66db5f6d049c61e3c46fceb6a66e32b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:37:17 +0800 Subject: [PATCH 162/178] Bump org.apache.zookeeper:zookeeper from 3.9.0 to 3.9.1 (#2379) Bumps org.apache.zookeeper:zookeeper from 3.9.0 to 3.9.1. --- updated-dependencies: - dependency-name: org.apache.zookeeper:zookeeper dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dcf218af60..b17aefed19 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 2.3.2 - 3.9.0 + 3.9.1 5.5.0 1.6.0 From 38eedb89f051f5ce17872c230828d2e0bdf231e3 Mon Sep 17 00:00:00 2001 From: TestBoost <153348110+TestBoost@users.noreply.github.com> Date: Thu, 14 Dec 2023 01:34:45 -0600 Subject: [PATCH 163/178] Move zkRegCenter.init() and zkRegCenter.close() to @BeforeAll and @AfterAll to make tests run faster and look similar to other tests (#2378) --- .../bootstrap/type/OneOffJobBootstrapTest.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java index 5528c28fca..443a1a865c 100644 --- a/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java +++ b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java @@ -25,9 +25,8 @@ import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; import org.apache.shardingsphere.elasticjob.test.util.ReflectionUtils; import org.awaitility.Awaitility; -import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.quartz.Scheduler; import org.quartz.SchedulerException; @@ -48,21 +47,17 @@ class OneOffJobBootstrapTest { private static final int SHARDING_TOTAL_COUNT = 3; - private ZookeeperRegistryCenter zkRegCenter; + private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void init() { EMBED_TESTING_SERVER.start(); - } - - @BeforeEach - void setUp() { zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); zkRegCenter.init(); } - @AfterEach - void tearDown() { + @AfterAll + static void tearDown() { zkRegCenter.close(); } From 9fe902a36d54af51c59b4677b6b37cb03abb9a87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:56:27 +0800 Subject: [PATCH 164/178] Bump ch.qos.logback:logback-classic from 1.2.12 to 1.2.13 in /examples (#2377) Bumps [ch.qos.logback:logback-classic](https://github.com/qos-ch/logback) from 1.2.12 to 1.2.13. - [Commits](https://github.com/qos-ch/logback/compare/v_1.2.12...v_1.2.13) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/pom.xml b/examples/pom.xml index 44330cc31d..69104c6f0a 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -43,7 +43,7 @@ 4.3.4.RELEASE 1.7.36 - 1.2.12 + 1.2.13 2.2.224 8.0.31 From a6839136ed8fbecbd9994ccd25d45779a6f97079 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 00:13:15 +0800 Subject: [PATCH 165/178] Bump org.springframework:spring-context (#2386) Bumps [org.springframework:spring-context](https://github.com/spring-projects/spring-framework) from 4.3.4.RELEASE to 5.2.22.RELEASE. - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v4.3.4.RELEASE...v5.2.22.RELEASE) --- updated-dependencies: - dependency-name: org.springframework:spring-context dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- examples/elasticjob-example-springboot/pom.xml | 2 +- examples/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/elasticjob-example-springboot/pom.xml b/examples/elasticjob-example-springboot/pom.xml index 9e6c287e12..a4fe0efe28 100644 --- a/examples/elasticjob-example-springboot/pom.xml +++ b/examples/elasticjob-example-springboot/pom.xml @@ -30,7 +30,7 @@ 2.5.12 - 5.2.7.RELEASE + 5.2.22.RELEASE diff --git a/examples/pom.xml b/examples/pom.xml index 69104c6f0a..06acfe584f 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -40,7 +40,7 @@ 1.8 5.1.0 - 4.3.4.RELEASE + 5.2.22.RELEASE 1.7.36 1.2.13 From d94ce276d9763509cf86246f809d2e714e8500a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:42:12 +0800 Subject: [PATCH 166/178] Bump org.apache.zookeeper:zookeeper from 3.9.1 to 3.9.2 (#2390) Bumps org.apache.zookeeper:zookeeper from 3.9.1 to 3.9.2. --- updated-dependencies: - dependency-name: org.apache.zookeeper:zookeeper dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b17aefed19..025f2b4ae2 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 2.3.2 - 3.9.1 + 3.9.2 5.5.0 1.6.0 From 9bceb88a044a8ed786fb9c3bcc94eebe5825361a Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sat, 27 Jul 2024 11:22:02 +0800 Subject: [PATCH 167/178] Migrate the JDK used by CI from Temurin to Zulu (#2406) --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index aadcf1e40c..5dfa747e48 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -42,7 +42,7 @@ jobs: - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 with: - distribution: 'temurin' + distribution: 'zulu' java-version: ${{ matrix.java }} - name: Build with Maven in Windows if: matrix.os == 'windows-latest' From 206a40e0aa611657a8f4b777db77646f1980f4ed Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sun, 28 Jul 2024 12:15:13 +0800 Subject: [PATCH 168/178] Prevent unit tests and E2E from using host ports `1`, `2181`, `7181`, `8181`, `8899`, `9000`, `9181`, `9872` and `9875` (#2409) --- .../type/OneOffJobBootstrapTest.java | 7 +++--- ecosystem/error-handler/dingtalk/pom.xml | 5 +++++ .../dingtalk/DingtalkJobErrorHandlerTest.java | 11 +++++----- ecosystem/error-handler/wechat/pom.xml | 5 +++++ .../wechat/WechatJobErrorHandlerTest.java | 9 ++++---- .../lifecycle/api/JobAPIFactoryTest.java | 2 +- .../operate/JobOperateAPIImplTest.java | 2 -- .../reg/RegistryCenterFactoryTest.java | 2 +- pom.xml | 2 +- .../zookeeper/ZookeeperConfigurationTest.java | 6 +++-- .../ZookeeperElectionServiceTest.java | 9 +++++--- ...eperRegistryCenterExecuteInLeaderTest.java | 10 ++++----- .../ZookeeperRegistryCenterForAuthTest.java | 13 +++++------ ...ookeeperRegistryCenterInitFailureTest.java | 4 +++- ...keeperRegistryCenterMiscellaneousTest.java | 14 ++++++------ .../ZookeeperRegistryCenterModifyTest.java | 9 ++++---- ...eeperRegistryCenterQueryWithCacheTest.java | 10 ++++----- ...erRegistryCenterQueryWithoutCacheTest.java | 10 ++++----- ...ookeeperRegistryCenterTransactionTest.java | 10 ++++----- .../ZookeeperRegistryCenterWatchTest.java | 9 ++++---- .../boot/reg/ZookeeperPropertiesTest.java | 3 ++- .../test/resources/application-elasticjob.yml | 2 +- .../test/resources/application-snapshot.yml | 2 +- .../test/resources/application-tracing.yml | 2 +- .../test/resources/conf/job/conf.properties | 2 +- .../test/resources/conf/reg/conf.properties | 4 ++-- .../e2e/annotation/BaseAnnotationE2ETest.java | 18 ++++++++------- .../annotation/OneOffEnabledJobE2ETest.java | 12 +++++----- .../annotation/ScheduleEnabledJobE2ETest.java | 12 +++++----- .../elasticjob/test/e2e/raw/BaseE2ETest.java | 18 ++++++++------- .../e2e/raw/disable/DisabledJobE2ETest.java | 6 ++--- .../disable/ScheduleDisabledJobE2ETest.java | 8 +++---- .../e2e/raw/enable/EnabledJobE2ETest.java | 10 ++++----- .../raw/enable/OneOffEnabledJobE2ETest.java | 2 +- .../raw/enable/ScheduleEnabledJobE2ETest.java | 2 +- .../snapshot/BaseSnapshotServiceE2ETest.java | 22 ++++++++++--------- .../SnapshotServiceDisableE2ETest.java | 4 ++-- .../test/util/EmbedTestingServer.java | 16 ++++++++++---- 38 files changed, 157 insertions(+), 137 deletions(-) diff --git a/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java index 443a1a865c..fd74b915a8 100644 --- a/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java +++ b/bootstrap/src/test/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrapTest.java @@ -41,9 +41,7 @@ class OneOffJobBootstrapTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), OneOffJobBootstrapTest.class.getSimpleName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static final int SHARDING_TOTAL_COUNT = 3; @@ -52,7 +50,8 @@ class OneOffJobBootstrapTest { @BeforeAll static void init() { EMBED_TESTING_SERVER.start(); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), OneOffJobBootstrapTest.class.getSimpleName()); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); zkRegCenter.init(); } diff --git a/ecosystem/error-handler/dingtalk/pom.xml b/ecosystem/error-handler/dingtalk/pom.xml index ab841db6cd..29d45876f6 100644 --- a/ecosystem/error-handler/dingtalk/pom.xml +++ b/ecosystem/error-handler/dingtalk/pom.xml @@ -46,5 +46,10 @@ org.apache.httpcomponents httpcore + + org.apache.curator + curator-test + test + diff --git a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java index 60cd6dbd4e..404b15b6b3 100644 --- a/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java +++ b/ecosystem/error-handler/dingtalk/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/dingtalk/DingtalkJobErrorHandlerTest.java @@ -20,6 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; +import org.apache.curator.test.InstanceSpec; import org.apache.shardingsphere.elasticjob.error.handler.dingtalk.fixture.DingtalkInternalController; import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; @@ -40,7 +41,7 @@ class DingtalkJobErrorHandlerTest { - private static final int PORT = 9875; + private static final int PORT = InstanceSpec.getRandomPort(); private static final String HOST = "localhost"; @@ -75,7 +76,7 @@ static void close() { @Test void assertHandleExceptionWithNotifySuccessful() { - DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:9875/send?access_token=mocked_token")); + DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:" + PORT + "/send?access_token=mocked_token")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); @@ -85,7 +86,7 @@ void assertHandleExceptionWithNotifySuccessful() { @Test void assertHandleExceptionWithWrongToken() { - DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:9875/send?access_token=wrong_token")); + DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:" + PORT + "/send?access_token=wrong_token")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); @@ -95,7 +96,7 @@ void assertHandleExceptionWithWrongToken() { @Test void assertHandleExceptionWithUrlIsNotFound() { - DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:9875/404")); + DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createConfigurationProperties("http://localhost:" + PORT + "/404")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); @@ -115,7 +116,7 @@ void assertHandleExceptionWithWrongUrl() { @Test void assertHandleExceptionWithNoSign() { - DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createNoSignJobConfigurationProperties("http://localhost:9875/send?access_token=mocked_token")); + DingtalkJobErrorHandler actual = getDingtalkJobErrorHandler(createNoSignJobConfigurationProperties("http://localhost:" + PORT + "/send?access_token=mocked_token")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); diff --git a/ecosystem/error-handler/wechat/pom.xml b/ecosystem/error-handler/wechat/pom.xml index 3a03ad2bec..f424e68bf7 100644 --- a/ecosystem/error-handler/wechat/pom.xml +++ b/ecosystem/error-handler/wechat/pom.xml @@ -46,5 +46,10 @@ org.apache.httpcomponents httpcore + + org.apache.curator + curator-test + test + diff --git a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java index 97041d52aa..95b7d93bc3 100644 --- a/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java +++ b/ecosystem/error-handler/wechat/src/test/java/org/apache/shardingsphere/elasticjob/error/handler/wechat/WechatJobErrorHandlerTest.java @@ -20,6 +20,7 @@ import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.LoggingEvent; import ch.qos.logback.core.read.ListAppender; +import org.apache.curator.test.InstanceSpec; import org.apache.shardingsphere.elasticjob.error.handler.wechat.fixture.WechatInternalController; import org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler; import org.apache.shardingsphere.elasticjob.restful.NettyRestfulService; @@ -40,7 +41,7 @@ class WechatJobErrorHandlerTest { - private static final int PORT = 9872; + private static final int PORT = InstanceSpec.getRandomPort(); private static final String HOST = "localhost"; @@ -75,7 +76,7 @@ static void close() { @Test void assertHandleExceptionWithNotifySuccessful() { - WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:9872/send?key=mocked_key")); + WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:" + PORT + "/send?key=mocked_key")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); @@ -85,7 +86,7 @@ void assertHandleExceptionWithNotifySuccessful() { @Test void assertHandleExceptionWithWrongToken() { - WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:9872/send?key=wrong_key")); + WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:" + PORT + "/send?key=wrong_key")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); @@ -105,7 +106,7 @@ void assertHandleExceptionWithWrongUrl() { @Test void assertHandleExceptionWithUrlIsNotFound() { - WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:9872/404")); + WechatJobErrorHandler actual = getWechatJobErrorHandler(createConfigurationProperties("http://localhost:" + PORT + "/404")); Throwable cause = new RuntimeException("test"); actual.handleException("test_job", cause); assertThat(appenderList.size(), is(1)); diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java index bf9e40f677..a4dd1cf2bb 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/api/JobAPIFactoryTest.java @@ -26,7 +26,7 @@ class JobAPIFactoryTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(8181); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); @BeforeAll static void setUp() { diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImplTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImplTest.java index d42db686fa..a295f521d9 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImplTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/operate/JobOperateAPIImplTest.java @@ -36,8 +36,6 @@ @ExtendWith(MockitoExtension.class) class JobOperateAPIImplTest { - static final int DUMP_PORT = 9000; - private JobOperateAPI jobOperateAPI; // TODO We should not use `Mock.Strictness.LENIENT` here, but the default. This is a flaw in the unit test design. diff --git a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java index 48ba2e25be..5f07ac120c 100644 --- a/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java +++ b/lifecycle/src/test/java/org/apache/shardingsphere/elasticjob/lifecycle/internal/reg/RegistryCenterFactoryTest.java @@ -32,7 +32,7 @@ class RegistryCenterFactoryTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(8181); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); @BeforeAll static void setUp() { diff --git a/pom.xml b/pom.xml index 025f2b4ae2..ded453146e 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 2.3.2 3.9.2 - 5.5.0 + 5.7.0 1.6.0 1.16.0 diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java index 3320dde803..b20ee782a2 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperConfigurationTest.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; +import org.apache.curator.test.InstanceSpec; import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; @@ -26,8 +27,9 @@ class ZookeeperConfigurationTest { @Test void assertNewZookeeperConfigurationForServerListsAndNamespace() { - ZookeeperConfiguration zkConfig = new ZookeeperConfiguration("localhost:2181", "myNamespace"); - assertThat(zkConfig.getServerLists(), is("localhost:2181")); + int randomPort = InstanceSpec.getRandomPort(); + ZookeeperConfiguration zkConfig = new ZookeeperConfiguration("localhost:" + randomPort, "myNamespace"); + assertThat(zkConfig.getServerLists(), is("localhost:" + randomPort)); assertThat(zkConfig.getNamespace(), is("myNamespace")); assertThat(zkConfig.getBaseSleepTimeMilliseconds(), is(1000)); assertThat(zkConfig.getMaxSleepTimeMilliseconds(), is(3000)); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java index 440191c2e9..d10b4484be 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperElectionServiceTest.java @@ -21,6 +21,7 @@ import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.recipes.leader.LeaderSelector; import org.apache.curator.retry.RetryOneTime; +import org.apache.curator.test.InstanceSpec; import org.apache.curator.test.KillSession; import org.apache.shardingsphere.elasticjob.reg.base.ElectionCandidate; import org.apache.shardingsphere.elasticjob.test.util.EmbedTestingServer; @@ -43,9 +44,11 @@ @ExtendWith(MockitoExtension.class) class ZookeeperElectionServiceTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); - private static final String HOST_AND_PORT = "localhost:8899"; + private static final int RANDOM_PORT = InstanceSpec.getRandomPort(); + + private static final String HOST_AND_PORT = "localhost:" + RANDOM_PORT; private static final String ELECTION_PATH = "/election"; @@ -66,7 +69,7 @@ void assertContend() throws Exception { service.start(); ElectionCandidate anotherElectionCandidate = mock(ElectionCandidate.class); CuratorFramework anotherClient = CuratorFrameworkFactory.newClient(EMBED_TESTING_SERVER.getConnectionString(), new RetryOneTime(2000)); - ZookeeperElectionService anotherService = new ZookeeperElectionService("ANOTHER_CLIENT:8899", anotherClient, ELECTION_PATH, anotherElectionCandidate); + ZookeeperElectionService anotherService = new ZookeeperElectionService("ANOTHER_CLIENT:" + RANDOM_PORT, anotherClient, ELECTION_PATH, anotherElectionCandidate); anotherClient.start(); anotherClient.blockUntilConnected(); anotherService.start(); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java index f44fb68d2d..88f5a3ae77 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterExecuteInLeaderTest.java @@ -33,18 +33,16 @@ class ZookeeperRegistryCenterExecuteInLeaderTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterExecuteInLeaderTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterExecuteInLeaderTest.class.getName()); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java index 95592c85c8..eeccf9113d 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterForAuthTest.java @@ -33,21 +33,20 @@ class ZookeeperRegistryCenterForAuthTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static final String NAME_SPACE = ZookeeperRegistryCenterForAuthTest.class.getName(); - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), NAME_SPACE); - private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - ZOOKEEPER_CONFIGURATION.setDigest("digest:password"); - ZOOKEEPER_CONFIGURATION.setSessionTimeoutMilliseconds(5000); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(5000); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), NAME_SPACE); + zookeeperConfiguration.setDigest("digest:password"); + zookeeperConfiguration.setSessionTimeoutMilliseconds(5000); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(5000); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); zkRegCenter.init(); RegistryCenterEnvironmentPreparer.persist(zkRegCenter); } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java index e32e51a966..5a521c5144 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterInitFailureTest.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.reg.zookeeper; +import org.apache.curator.test.InstanceSpec; import org.apache.shardingsphere.elasticjob.reg.exception.RegException; import org.junit.jupiter.api.Test; @@ -27,7 +28,8 @@ class ZookeeperRegistryCenterInitFailureTest { @Test void assertInitFailure() { assertThrows(RegException.class, () -> { - ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("localhost:1", ZookeeperRegistryCenterInitFailureTest.class.getName())); + ZookeeperRegistryCenter zkRegCenter = + new ZookeeperRegistryCenter(new ZookeeperConfiguration("localhost:" + InstanceSpec.getRandomPort(), ZookeeperRegistryCenterInitFailureTest.class.getName())); zkRegCenter.init(); }); } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java index c92d551989..9f9a74583d 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterMiscellaneousTest.java @@ -30,18 +30,18 @@ class ZookeeperRegistryCenterMiscellaneousTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterMiscellaneousTest.class.getName()); + private static ZookeeperConfiguration zookeeperConfiguration; private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); + zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterMiscellaneousTest.class.getName()); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(30000); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); zkRegCenter.init(); zkRegCenter.addCacheData("/test"); } @@ -64,7 +64,7 @@ void assertGetRawCache() { @Test void assertGetZkConfig() { - ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); - assertThat(zkRegCenter.getZkConfig(), is(ZOOKEEPER_CONFIGURATION)); + ZookeeperRegistryCenter zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); + assertThat(zkRegCenter.getZkConfig(), is(zookeeperConfiguration)); } } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java index d4a1c9c5fc..300ac2e154 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterModifyTest.java @@ -37,17 +37,16 @@ class ZookeeperRegistryCenterModifyTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterModifyTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterModifyTest.class.getName()); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); RegistryCenterEnvironmentPreparer.persist(zkRegCenter); } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java index 59eb61cf83..f37f1276a7 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithCacheTest.java @@ -29,18 +29,16 @@ class ZookeeperRegistryCenterQueryWithCacheTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterQueryWithCacheTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterQueryWithCacheTest.class.getName()); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); RegistryCenterEnvironmentPreparer.persist(zkRegCenter); zkRegCenter.addCacheData("/test"); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java index c370073a85..d253d09056 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterQueryWithoutCacheTest.java @@ -34,18 +34,16 @@ class ZookeeperRegistryCenterQueryWithoutCacheTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterQueryWithoutCacheTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterQueryWithoutCacheTest.class.getName()); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(30000); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); zkRegCenter.init(); RegistryCenterEnvironmentPreparer.persist(zkRegCenter); zkRegCenter.addCacheData("/other"); diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java index b08795a04b..d73c975a59 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterTransactionTest.java @@ -34,18 +34,16 @@ class ZookeeperRegistryCenterTransactionTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = - new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterTransactionTest.class.getName()); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); } diff --git a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java index 1ead5e3f15..735afc18be 100644 --- a/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java +++ b/registry-center/provider/zookeeper-curator/src/test/java/org/apache/shardingsphere/elasticjob/reg/zookeeper/ZookeeperRegistryCenterWatchTest.java @@ -37,17 +37,16 @@ class ZookeeperRegistryCenterWatchTest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(9181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIGURATION = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); private static ZookeeperRegistryCenter zkRegCenter; @BeforeAll static void setUp() { EMBED_TESTING_SERVER.start(); - zkRegCenter = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIGURATION); - ZOOKEEPER_CONFIGURATION.setConnectionTimeoutMilliseconds(30000); + ZookeeperConfiguration zookeeperConfiguration = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), ZookeeperRegistryCenterWatchTest.class.getName()); + zkRegCenter = new ZookeeperRegistryCenter(zookeeperConfiguration); + zookeeperConfiguration.setConnectionTimeoutMilliseconds(30000); zkRegCenter.init(); RegistryCenterEnvironmentPreparer.persist(zkRegCenter); } diff --git a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperPropertiesTest.java b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperPropertiesTest.java index 7bf2804fff..5e7594240d 100644 --- a/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperPropertiesTest.java +++ b/spring/boot-starter/src/test/java/org/apache/shardingsphere/elasticjob/spring/boot/reg/ZookeeperPropertiesTest.java @@ -17,6 +17,7 @@ package org.apache.shardingsphere.elasticjob.spring.boot.reg; +import org.apache.curator.test.InstanceSpec; import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; import org.junit.jupiter.api.Test; @@ -28,7 +29,7 @@ class ZookeeperPropertiesTest { @Test void assertToZookeeperConfiguration() { ZookeeperProperties properties = new ZookeeperProperties(); - properties.setServerLists("localhost:18181"); + properties.setServerLists("localhost:" + InstanceSpec.getRandomPort()); properties.setNamespace("test"); properties.setBaseSleepTimeMilliseconds(2000); properties.setMaxSleepTimeMilliseconds(4000); diff --git a/spring/boot-starter/src/test/resources/application-elasticjob.yml b/spring/boot-starter/src/test/resources/application-elasticjob.yml index 204bd0e0f5..0990201b66 100644 --- a/spring/boot-starter/src/test/resources/application-elasticjob.yml +++ b/spring/boot-starter/src/test/resources/application-elasticjob.yml @@ -27,7 +27,7 @@ elasticjob: type: RDB excludeJobNames: [customTestJob] regCenter: - serverLists: localhost:18181 + serverLists: 127.0.0.1:18181 namespace: elasticjob-spring-boot-starter jobs: customTestJob: diff --git a/spring/boot-starter/src/test/resources/application-snapshot.yml b/spring/boot-starter/src/test/resources/application-snapshot.yml index 95e28f1de6..f0930efc86 100644 --- a/spring/boot-starter/src/test/resources/application-snapshot.yml +++ b/spring/boot-starter/src/test/resources/application-snapshot.yml @@ -19,5 +19,5 @@ elasticjob: dump: port: 0 regCenter: - serverLists: localhost:18181 + serverLists: 127.0.0.1:18181 namespace: elasticjob-spring-boot-starter diff --git a/spring/boot-starter/src/test/resources/application-tracing.yml b/spring/boot-starter/src/test/resources/application-tracing.yml index 610a73cf9a..be446ee6d6 100644 --- a/spring/boot-starter/src/test/resources/application-tracing.yml +++ b/spring/boot-starter/src/test/resources/application-tracing.yml @@ -17,5 +17,5 @@ elasticjob: regCenter: - serverLists: localhost:18181 + serverLists: 127.0.0.1:18181 namespace: elasticjob-spring-boot-starter diff --git a/spring/namespace/src/test/resources/conf/job/conf.properties b/spring/namespace/src/test/resources/conf/job/conf.properties index 4f09309e23..ff5e933aae 100644 --- a/spring/namespace/src/test/resources/conf/job/conf.properties +++ b/spring/namespace/src/test/resources/conf/job/conf.properties @@ -15,7 +15,7 @@ # limitations under the License. # -regCenter.serverLists=localhost:3181 +regCenter.serverLists=127.0.0.1:3181 regCenter.namespace=elasticjob-spring-test regCenter.baseSleepTimeMilliseconds=1000 regCenter.maxSleepTimeMilliseconds=3000 diff --git a/spring/namespace/src/test/resources/conf/reg/conf.properties b/spring/namespace/src/test/resources/conf/reg/conf.properties index 41de41504d..14c24279e0 100644 --- a/spring/namespace/src/test/resources/conf/reg/conf.properties +++ b/spring/namespace/src/test/resources/conf/reg/conf.properties @@ -15,13 +15,13 @@ # limitations under the License. # -regCenter1.serverLists=localhost:3181 +regCenter1.serverLists=127.0.0.1:3181 regCenter1.namespace=regCenter1 regCenter1.baseSleepTimeMilliseconds=1000 regCenter1.maxSleepTimeMilliseconds=3000 regCenter1.maxRetries=3 -regCenter2.serverLists=localhost:3181 +regCenter2.serverLists=127.0.0.1:3181 regCenter2.namespace=regCenter2 regCenter2.baseSleepTimeMilliseconds=1000 regCenter2.maxSleepTimeMilliseconds=3000 diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java index 8dfa287dd3..3ac80f506a 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/BaseAnnotationE2ETest.java @@ -39,12 +39,12 @@ @Getter(AccessLevel.PROTECTED) public abstract class BaseAnnotationE2ETest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); - private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); + private static ZookeeperConfiguration zookeeperConfig; @Getter(AccessLevel.PROTECTED) - private static final CoordinatorRegistryCenter REGISTRY_CENTER = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIG); + private static CoordinatorRegistryCenter registryCenter; private final ElasticJob elasticJob; @@ -61,15 +61,15 @@ protected BaseAnnotationE2ETest(final TestType type, final ElasticJob elasticJob jobConfiguration = JobAnnotationBuilder.generateJobConfiguration(elasticJob.getClass()); jobName = jobConfiguration.getJobName(); jobBootstrap = createJobBootstrap(type, elasticJob); - leaderService = new LeaderService(REGISTRY_CENTER, jobName); + leaderService = new LeaderService(registryCenter, jobName); } private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob elasticJob) { switch (type) { case SCHEDULE: - return new ScheduleJobBootstrap(REGISTRY_CENTER, elasticJob); + return new ScheduleJobBootstrap(registryCenter, elasticJob); case ONE_OFF: - return new OneOffJobBootstrap(REGISTRY_CENTER, elasticJob); + return new OneOffJobBootstrap(registryCenter, elasticJob); default: throw new RuntimeException(String.format("Cannot support `%s`", type)); } @@ -78,8 +78,10 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el @BeforeAll static void init() { EMBED_TESTING_SERVER.start(); - ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); - REGISTRY_CENTER.init(); + zookeeperConfig = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); + registryCenter = new ZookeeperRegistryCenter(zookeeperConfig); + zookeeperConfig.setConnectionTimeoutMilliseconds(30000); + registryCenter.init(); } @BeforeEach diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java index e23072f521..f776b0b241 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/OneOffEnabledJobE2ETest.java @@ -46,20 +46,20 @@ class OneOffEnabledJobE2ETest extends BaseAnnotationE2ETest { void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(1)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); - JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); + JobConfiguration jobConfig = YamlEngine.unmarshal(getRegistryCenter().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); assertThat(jobConfig.getShardingTotalCount(), is(1)); assertNull(jobConfig.getCron()); - assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); - assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); - getREGISTRY_CENTER().remove("/" + getJobName() + "/leader/election"); + assertThat(getRegistryCenter().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); + assertThat(getRegistryCenter().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + getRegistryCenter().remove("/" + getJobName() + "/leader/election"); assertTrue(getLeaderService().isLeaderUntilBlock()); } @Test void assertJobInit() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> MatcherAssert.assertThat(((AnnotationUnShardingJob) getElasticJob()).isCompleted(), is(true))); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java index d8162f688f..ba23457d94 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/annotation/ScheduleEnabledJobE2ETest.java @@ -46,22 +46,22 @@ class ScheduleEnabledJobE2ETest extends BaseAnnotationE2ETest { void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); - JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); + JobConfiguration jobConfig = YamlEngine.unmarshal(getRegistryCenter().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); assertThat(jobConfig.getShardingTotalCount(), is(3)); assertThat(jobConfig.getCron(), is("*/10 * * * * ?")); assertNull(jobConfig.getTimeZone()); assertThat(jobConfig.getShardingItemParameters(), is("0=a,1=b,2=c")); - assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); - assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); - getREGISTRY_CENTER().remove("/" + getJobName() + "/leader/election"); + assertThat(getRegistryCenter().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); + assertThat(getRegistryCenter().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + getRegistryCenter().remove("/" + getJobName() + "/leader/election"); assertTrue(getLeaderService().isLeaderUntilBlock()); } @Test void assertJobInit() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> MatcherAssert.assertThat(((AnnotationSimpleJob) getElasticJob()).isCompleted(), is(true))); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java index ba384d29a9..e4126b15dd 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/BaseE2ETest.java @@ -38,12 +38,12 @@ @Getter(AccessLevel.PROTECTED) public abstract class BaseE2ETest { - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); - private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); + private static ZookeeperConfiguration zookeeperConfig; @Getter(AccessLevel.PROTECTED) - private static final CoordinatorRegistryCenter REGISTRY_CENTER = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIG); + private static CoordinatorRegistryCenter registryCenter; private final ElasticJob elasticJob; @@ -59,7 +59,7 @@ protected BaseE2ETest(final TestType type, final ElasticJob elasticJob) { this.elasticJob = elasticJob; jobConfiguration = getJobConfiguration(jobName); jobBootstrap = createJobBootstrap(type, elasticJob); - leaderService = new LeaderService(REGISTRY_CENTER, jobName); + leaderService = new LeaderService(registryCenter, jobName); } protected abstract JobConfiguration getJobConfiguration(String jobName); @@ -67,9 +67,9 @@ protected BaseE2ETest(final TestType type, final ElasticJob elasticJob) { private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob elasticJob) { switch (type) { case SCHEDULE: - return new ScheduleJobBootstrap(REGISTRY_CENTER, elasticJob, jobConfiguration); + return new ScheduleJobBootstrap(registryCenter, elasticJob, jobConfiguration); case ONE_OFF: - return new OneOffJobBootstrap(REGISTRY_CENTER, elasticJob, jobConfiguration); + return new OneOffJobBootstrap(registryCenter, elasticJob, jobConfiguration); default: throw new RuntimeException(String.format("Cannot support `%s`", type)); } @@ -78,8 +78,10 @@ private JobBootstrap createJobBootstrap(final TestType type, final ElasticJob el @BeforeAll static void init() { EMBED_TESTING_SERVER.start(); - ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); - REGISTRY_CENTER.init(); + zookeeperConfig = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); + registryCenter = new ZookeeperRegistryCenter(zookeeperConfig); + zookeeperConfig.setConnectionTimeoutMilliseconds(30000); + registryCenter.init(); } @BeforeEach diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java index f387b076d3..01ce148406 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/DisabledJobE2ETest.java @@ -46,7 +46,7 @@ protected final void assertDisabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); }); - JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); + JobConfiguration jobConfig = YamlEngine.unmarshal(getRegistryCenter().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); assertThat(jobConfig.getShardingTotalCount(), is(3)); if (getJobBootstrap() instanceof ScheduleJobBootstrap) { assertThat(jobConfig.getCron(), is("0/1 * * * * ?")); @@ -54,7 +54,7 @@ protected final void assertDisabledRegCenterInfo() { assertNull(jobConfig.getCron()); } assertThat(jobConfig.getShardingItemParameters(), is("0=A,1=B,2=C")); - assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.DISABLED.name())); - Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance"), is(IsNull.nullValue()))); + assertThat(getRegistryCenter().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.DISABLED.name())); + Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(getRegistryCenter().get("/" + getJobName() + "/leader/election/instance"), is(IsNull.nullValue()))); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/ScheduleDisabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/ScheduleDisabledJobE2ETest.java index f397a43e4a..542923a629 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/ScheduleDisabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/disable/ScheduleDisabledJobE2ETest.java @@ -51,12 +51,12 @@ void assertJobRunning() { } private void setJobEnable() { - getREGISTRY_CENTER().persist("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), ServerStatus.ENABLED.name()); + getRegistryCenter().persist("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), ServerStatus.ENABLED.name()); } private void assertEnabledRegCenterInfo() { - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); - getREGISTRY_CENTER().remove("/" + getJobName() + "/leader/election"); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + getRegistryCenter().remove("/" + getJobName() + "/leader/election"); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java index 8c3cd2b605..4ed1973f13 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/EnabledJobE2ETest.java @@ -43,7 +43,7 @@ protected EnabledJobE2ETest(final TestType type, final ElasticJob elasticJob) { void assertEnabledRegCenterInfo() { assertThat(JobRegistry.getInstance().getCurrentShardingTotalCount(getJobName()), is(3)); assertThat(JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp(), is(IpUtils.getIp())); - JobConfiguration jobConfig = YamlEngine.unmarshal(getREGISTRY_CENTER().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); + JobConfiguration jobConfig = YamlEngine.unmarshal(getRegistryCenter().get("/" + getJobName() + "/config"), JobConfigurationPOJO.class).toJobConfiguration(); assertThat(jobConfig.getShardingTotalCount(), is(3)); if (getJobBootstrap() instanceof ScheduleJobBootstrap) { assertThat(jobConfig.getCron(), is("0/1 * * * * ?")); @@ -51,10 +51,10 @@ void assertEnabledRegCenterInfo() { assertNull(jobConfig.getCron()); } assertThat(jobConfig.getShardingItemParameters(), is("0=A,1=B,2=C")); - assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); - assertThat(getREGISTRY_CENTER().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); - getREGISTRY_CENTER().remove("/" + getJobName() + "/leader/election"); + assertThat(getRegistryCenter().get("/" + getJobName() + "/servers/" + JobRegistry.getInstance().getJobInstance(getJobName()).getServerIp()), is(ServerStatus.ENABLED.name())); + assertThat(getRegistryCenter().get("/" + getJobName() + "/leader/election/instance"), is(JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/instances/" + JobRegistry.getInstance().getJobInstance(getJobName()).getJobInstanceId())); + getRegistryCenter().remove("/" + getJobName() + "/leader/election"); assertTrue(getLeaderService().isLeaderUntilBlock()); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/OneOffEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/OneOffEnabledJobE2ETest.java index 6c117b347b..6b92e25b4a 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/OneOffEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/OneOffEnabledJobE2ETest.java @@ -43,6 +43,6 @@ protected JobConfiguration getJobConfiguration(final String jobName) { @Test void assertJobInit() { Awaitility.await().atMost(1L, TimeUnit.MINUTES).untilAsserted(() -> assertThat(((E2EFixtureJobImpl) getElasticJob()).isCompleted(), is(true))); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/ScheduleEnabledJobE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/ScheduleEnabledJobE2ETest.java index d211e4fc02..449b0e8793 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/ScheduleEnabledJobE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/raw/enable/ScheduleEnabledJobE2ETest.java @@ -43,6 +43,6 @@ protected JobConfiguration getJobConfiguration(final String jobName) { @Test void assertJobInit() { Awaitility.await().atMost(10L, TimeUnit.SECONDS).untilAsserted(() -> assertThat(((E2EFixtureJobImpl) getElasticJob()).isCompleted(), is(true))); - assertTrue(getREGISTRY_CENTER().isExisted("/" + getJobName() + "/sharding")); + assertTrue(getRegistryCenter().isExisted("/" + getJobName() + "/sharding")); } } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java index e6d75ba387..3e88a87f2c 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/BaseSnapshotServiceE2ETest.java @@ -19,6 +19,7 @@ import lombok.AccessLevel; import lombok.Getter; +import org.apache.curator.test.InstanceSpec; import org.apache.shardingsphere.elasticjob.api.ElasticJob; import org.apache.shardingsphere.elasticjob.api.JobConfiguration; import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; @@ -35,17 +36,15 @@ public abstract class BaseSnapshotServiceE2ETest { - static final int DUMP_PORT = 9000; + static final int DUMP_PORT = InstanceSpec.getRandomPort(); - private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(7181); - - private static final ZookeeperConfiguration ZOOKEEPER_CONFIG = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); + private static final EmbedTestingServer EMBED_TESTING_SERVER = new EmbedTestingServer(); @Getter(value = AccessLevel.PROTECTED) - private static final CoordinatorRegistryCenter REG_CENTER = new ZookeeperRegistryCenter(ZOOKEEPER_CONFIG); + private static CoordinatorRegistryCenter regCenter; @Getter(value = AccessLevel.PROTECTED) - private static SnapshotService snapshotService = new SnapshotService(REG_CENTER, DUMP_PORT); + private static SnapshotService snapshotService; private final ScheduleJobBootstrap bootstrap; @@ -53,19 +52,22 @@ public abstract class BaseSnapshotServiceE2ETest { private final String jobName = System.nanoTime() + "_test_job"; public BaseSnapshotServiceE2ETest(final ElasticJob elasticJob) { - bootstrap = new ScheduleJobBootstrap(REG_CENTER, elasticJob, JobConfiguration.newBuilder(jobName, 3).cron("0/1 * * * * ?").overwrite(true).build()); + bootstrap = new ScheduleJobBootstrap(regCenter, elasticJob, JobConfiguration.newBuilder(jobName, 3).cron("0/1 * * * * ?").overwrite(true).build()); } @BeforeAll static void init() { EMBED_TESTING_SERVER.start(); - ZOOKEEPER_CONFIG.setConnectionTimeoutMilliseconds(30000); - REG_CENTER.init(); + ZookeeperConfiguration zookeeperConfig = new ZookeeperConfiguration(EMBED_TESTING_SERVER.getConnectionString(), "zkRegTestCenter"); + regCenter = new ZookeeperRegistryCenter(zookeeperConfig); + snapshotService = new SnapshotService(regCenter, DUMP_PORT); + zookeeperConfig.setConnectionTimeoutMilliseconds(30000); + regCenter.init(); } @BeforeEach void setUp() { - REG_CENTER.init(); + regCenter.init(); bootstrap.schedule(); } diff --git a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java index a060052542..30b7fbe2d7 100644 --- a/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java +++ b/test/e2e/src/test/java/org/apache/shardingsphere/elasticjob/test/e2e/snapshot/SnapshotServiceDisableE2ETest.java @@ -41,13 +41,13 @@ void assertMonitorWithDumpCommand() { @Test void assertPortInvalid() { - assertThrows(IllegalArgumentException.class, () -> new SnapshotService(getREG_CENTER(), -1).listen()); + assertThrows(IllegalArgumentException.class, () -> new SnapshotService(getRegCenter(), -1).listen()); } @Test void assertListenException() throws IOException { ServerSocket serverSocket = new ServerSocket(9898); - SnapshotService snapshotService = new SnapshotService(getREG_CENTER(), 9898); + SnapshotService snapshotService = new SnapshotService(getRegCenter(), 9898); snapshotService.listen(); serverSocket.close(); assertNull(ReflectionUtils.getFieldValue(snapshotService, "serverSocket")); diff --git a/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/EmbedTestingServer.java b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/EmbedTestingServer.java index ee460f25cb..67e5d9993f 100644 --- a/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/EmbedTestingServer.java +++ b/test/util/src/main/java/org/apache/shardingsphere/elasticjob/test/util/EmbedTestingServer.java @@ -17,12 +17,13 @@ package org.apache.shardingsphere.elasticjob.test.util; -import lombok.RequiredArgsConstructor; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.framework.CuratorFrameworkFactory; import org.apache.curator.framework.imps.CuratorFrameworkState; import org.apache.curator.retry.ExponentialBackoffRetry; +import org.apache.curator.test.InstanceSpec; import org.apache.curator.test.TestingServer; import org.apache.zookeeper.KeeperException; @@ -33,7 +34,7 @@ /** * Embed ZooKeeper testing server. */ -@RequiredArgsConstructor +@AllArgsConstructor @Slf4j public final class EmbedTestingServer { @@ -43,6 +44,13 @@ public final class EmbedTestingServer { private final int port; + /** + * Create the server using a random port. + */ + public EmbedTestingServer() { + port = InstanceSpec.getRandomPort(); + } + /** * Start embed zookeeper server. */ @@ -64,7 +72,7 @@ public void start() { private void start0() { try { - testingServer = new TestingServer(port, true); + testingServer = new TestingServer(port); // CHECKSTYLE:OFF } catch (final Exception ex) { // CHECKSTYLE:ON @@ -132,6 +140,6 @@ private boolean isIgnoredException(final Throwable cause) { * @return connection string */ public String getConnectionString() { - return "localhost:" + port; + return testingServer.getConnectString(); } } From fb9231afb0d7e15a1e82f4e042cf03b5f28c83f8 Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sun, 28 Jul 2024 15:30:24 +0800 Subject: [PATCH 169/178] Support for building with OpenJDK 22 (#2411) --- .github/workflows/maven.yml | 2 +- pom.xml | 6 +++--- spring/pom.xml | 29 ++--------------------------- 3 files changed, 6 insertions(+), 31 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 5dfa747e48..1f9a05c46d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -28,7 +28,7 @@ jobs: build: strategy: matrix: - java: [ 8, 17, 21 ] + java: [ 8, 17, 21, 22 ] os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ] runs-on: ${{ matrix.os }} diff --git a/pom.xml b/pom.xml index ded453146e..dee0a8d466 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 4.5.14 4.4.16 - 4.1.99.Final + 4.1.112.Final 1.7.36 1.2.13 @@ -87,7 +87,7 @@ 2.2 4.11.0 4.2.0 - 1.14.8 + 1.14.18 2.2.224 4.0.3 @@ -113,7 +113,7 @@ 3.20.0 4.3.0 2.7 - 0.8.10 + 0.8.12 4.0.0-M6 diff --git a/spring/pom.xml b/spring/pom.xml index bec630362d..6198458281 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -34,9 +34,8 @@ - 2.7.10 - 5.3.26 - 1.9.1 + 2.7.18 + 1.9.22.1 @@ -48,30 +47,6 @@ pom import - - org.springframework - spring-context - ${springframework.version} - provided - - - org.springframework - spring-context-support - ${springframework.version} - provided - - - org.springframework - spring-context - - - - - org.springframework - spring-test - ${springframework.version} - test - org.aspectj From a3e96a683452723a8932d35dfa716dd6d51c0877 Mon Sep 17 00:00:00 2001 From: Jay Zhou <4192339+jaychoww@users.noreply.github.com> Date: Mon, 29 Jul 2024 01:06:14 +0800 Subject: [PATCH 170/178] fix: Tracing is incompatible with Spring Boot 3.2.x #2401 (#2405) * fix: Tracing is incompatible with Spring Boot 3.2.x #2401 * chore: pass the code formatting validation --------- Co-authored-by: Jay Chow <4192339+westarest@users.noreply.github.com> --- .../spring/boot/tracing/ElasticJobTracingConfiguration.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java index 9992500959..6ed0edfba3 100644 --- a/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java +++ b/spring/boot-starter/src/main/java/org/apache/shardingsphere/elasticjob/spring/boot/tracing/ElasticJobTracingConfiguration.java @@ -20,6 +20,7 @@ import com.zaxxer.hikari.HikariDataSource; import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; @@ -68,7 +69,8 @@ public DataSource tracingDataSource(final TracingProperties tracingProperties) { */ @Bean @ConditionalOnBean(DataSource.class) - public TracingConfiguration tracingConfiguration(final DataSource dataSource, @Nullable final DataSource tracingDataSource) { + public TracingConfiguration tracingConfiguration(@Qualifier("dataSource") final DataSource dataSource, + @Qualifier("tracingDataSource") @Nullable final DataSource tracingDataSource) { return new TracingConfiguration<>("RDB", null == tracingDataSource ? dataSource : tracingDataSource); } } From 8bb5fa88d4435628d41f0a9b74c1503f521405ad Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Mon, 29 Jul 2024 15:40:29 +0800 Subject: [PATCH 171/178] Provides built-in GraalVM Reachability Metadata and nativeTest on Elasticjob Bootstrap (#2268) --- .github/workflows/graalvm.yml | 47 ++++ bootstrap/pom.xml | 5 + .../configuration/graalvm-native-image.cn.md | 169 ++++++++++++ .../configuration/graalvm-native-image.en.md | 173 ++++++++++++ pom.xml | 101 ++++++- reachability-metadata/pom.xml | 29 ++ .../reflect-config.json | 7 + .../resource-config.json | 11 + .../jni-config.json | 2 + .../predefined-classes-config.json | 7 + .../proxy-config.json | 6 + .../reflect-config.json | 253 ++++++++++++++++++ .../resource-config.json | 41 +++ .../serialization-config.json | 8 + .../zookeeper/3.9.2/reflect-config.json | 56 ++++ spring/core/pom.xml | 3 + spring/namespace/pom.xml | 3 + .../native-image-filter/extra-filter.json | 17 ++ .../native-image-filter/user-code-filter.json | 7 + test/native/pom.xml | 67 +++++ .../elasticjob/test/natived/JavaTest.java | 168 ++++++++++++ .../test/natived/commons/entity/Foo.java | 45 ++++ .../commons/job/dataflow/JavaDataflowJob.java | 55 ++++ .../commons/job/simple/JavaSimpleJob.java | 45 ++++ .../commons/repository/FooRepository.java | 72 +++++ .../repository/FooRepositoryFactory.java | 27 ++ test/native/src/test/resources/script/demo.sh | 21 ++ test/pom.xml | 1 + 28 files changed, 1445 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/graalvm.yml create mode 100644 docs/content/user-manual/configuration/graalvm-native-image.cn.md create mode 100644 docs/content/user-manual/configuration/graalvm-native-image.en.md create mode 100644 reachability-metadata/pom.xml create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/resource-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/jni-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/predefined-classes-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/serialization-config.json create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.apache.zookeeper/zookeeper/3.9.2/reflect-config.json create mode 100644 test/native/native-image-filter/extra-filter.json create mode 100644 test/native/native-image-filter/user-code-filter.json create mode 100644 test/native/pom.xml create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepositoryFactory.java create mode 100644 test/native/src/test/resources/script/demo.sh diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml new file mode 100644 index 0000000000..fcff1f14e3 --- /dev/null +++ b/.github/workflows/graalvm.yml @@ -0,0 +1,47 @@ +# +# 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. +# + +name: NativeTest CI - GraalVM Native Image + +on: + pull_request: + branches: [ master ] + paths: + - '.github/workflows/graalvm.yml' + - 'reachability-metadata/src/**' + - 'test/native/native-image-filter/**' + - 'test/native/src/**' + +jobs: + build: + strategy: + matrix: + java: [ '22.0.2' ] + os: [ 'ubuntu-latest' ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up GraalVM CE ${{ matrix.java }} + uses: graalvm/setup-graalvm@v1 + with: + java-version: ${{ matrix.java }} + distribution: 'graalvm-community' + github-token: ${{ secrets.GITHUB_TOKEN }} + cache: 'maven' + - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} + continue-on-error: true + run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test diff --git a/bootstrap/pom.xml b/bootstrap/pom.xml index 75ae790343..4606a518dd 100644 --- a/bootstrap/pom.xml +++ b/bootstrap/pom.xml @@ -62,6 +62,11 @@ elasticjob-tracing-rdb ${project.parent.version} + + org.apache.shardingsphere.elasticjob + elasticjob-reachability-metadata + ${project.version} + org.apache.shardingsphere.elasticjob diff --git a/docs/content/user-manual/configuration/graalvm-native-image.cn.md b/docs/content/user-manual/configuration/graalvm-native-image.cn.md new file mode 100644 index 0000000000..8a892fa376 --- /dev/null +++ b/docs/content/user-manual/configuration/graalvm-native-image.cn.md @@ -0,0 +1,169 @@ ++++ +title = "GraalVM Native Image" +weight = 6 +chapter = true ++++ + +## 背景信息 + +ElasticJob 已在 GraalVM Native Image 下完成可用性验证。 + +构建包含 `org.apache.shardingsphere.elasticjob:elasticjob-bootstrap:${elasticjob.version}` 的 Maven 依赖的 GraalVM Native Image, +你需要借助于 GraalVM Native Build Tools。 +GraalVM Native Build Tools 提供了 Maven Plugin 和 Gradle Plugin 来简化 GraalVM CE 的 `native-image` 命令行工具的长篇大论的 shell 命令。 + +ElasticJob 要求在如下或更高版本的 `GraalVM CE` 完成构建 GraalVM Native Image。使用者可通过 `SDKMAN!` 快速切换 JDK。这同理 +适用于 https://sdkman.io/jdks#graal , https://sdkman.io/jdks#nik 和 https://sdkman.io/jdks#mandrel 等 `GraalVM CE` 的下游发行版。 + +- GraalVM CE For JDK 22.0.2,对应于 SDKMAN! 的 `22.0.2-graalce` + +用户依然可以使用 SDKMAN! 上的 `21.0.2-graalce` 等旧版本的 GraalVM CE 来构建 ElasticJob 的 GraalVM Native Image 产物。 +ElasticJob 不为已停止维护的 GraalVM CE 版本设置 CI。 + +## 使用 ElasticJob 的 Java API + +### Maven 生态 + +使用者需要主动使用 GraalVM Reachability Metadata 中央仓库。 +如下配置可供参考,以配置项目额外的 Maven Profiles,以 GraalVM Native Build Tools 的文档为准。 + +```xml + + + + org.apache.shardingsphere.elasticjob + elasticjob-bootstrap + ${elasticjob.version} + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + 0.10.2 + true + + + build-native + + compile-no-fork + + package + + + test-native + + test + + test + + + + + + +``` + +### Gradle 生态 + +使用者需要主动使用 GraalVM Reachability Metadata 中央仓库。 +如下配置可供参考,以配置项目额外的 Gradle Tasks,以 GraalVM Native Build Tools 的文档为准。 +由于 https://github.com/gradle/gradle/issues/17559 的限制,用户需要通过 Maven 依赖的形式引入 Metadata Repository 的 JSON 文件。 +参考 https://github.com/graalvm/native-build-tools/issues/572 。 + +```groovy +plugins { + id 'org.graalvm.buildtools.native' version '0.10.2' +} + +dependencies { + implementation 'org.apache.shardingsphere.elasticjob:elasticjob-bootstrap:${elasticjob.version}' + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') +} + +graalvmNative { + metadataRepository { + enabled.set(false) + } +} +``` + +## 对于 sbt 等不被 GraalVM Native Build Tools 支持的构建工具 + +此类需求需要在 https://github.com/graalvm/native-build-tools 打开额外的 issue 并提供对应构建工具的 Plugin 实现。 + +## 使用限制 + +1. 使用者依然需要在 `src/main/resources/META-INF/native-image` 文件夹或 `src/test/resources/META-INF/native-image` 文件夹配置独立文件的 GraalVM Reachability Metadata。 +使用者可通过 GraalVM Native Build Tools 的 GraalVM Tracing Agent 来快速采集 GraalVM Reachability Metadata。 + +2. 对于在 Linux 系统下执行 `elasticJobType` 为 `SCRIPT` 的 `org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap`, +若 `script.command.line` 设置为构建 GraalVM Native Image 时, 私有项目的 classpath 下的某个 `.sh` 文件在 GraalVM Native Image 下的相对路径, +则此 `.sh` 文件至少提前设置 `rwxr-xr-x` 的 POSIX 文件权限。 +因为 `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` 显然不支持 `java.nio.file.attribute.PosixFileAttributeView`。 + +3. ElasticJob 的 Spring 命名空间集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` 尚未在 GraalVM Native Image 下可用。 + +4. ElasticJob 的 Spring Boot Starter 集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` 尚未在 GraalVM Native Image 下可用。 + +## 贡献 GraalVM Reachability Metadata + +ElasticJob 对在 GraalVM Native Image 下的可用性的验证,是通过 GraalVM Native Build Tools 的 Maven Plugin 子项目来完成的。 +通过在 JVM 下运行单元测试,为单元测试打上 `junit-platform-unique-ids*` 标签,此后构建为 GraalVM Native Image 进行 nativeTest 来测试 +在 GraalVM Native Image 下的单元测试覆盖率。请贡献者不要使用 `io.kotest:kotest-runner-junit5-jvm:5.5.4` 等在 `test listener` mode 下 +failed to discover tests 的测试库。 + +ElasticJob 定义了 `elasticjob-test-native` 的 Maven Module 用于为 native Test 提供小型的单元测试子集, +此单元测试子集避免了使用 Mockito 等 native Test 下无法使用的第三方库。 + +ElasticJob 定义了 `nativeTestInElasticJob` 的 Maven Profile 用于为 `elasticjob-test-native` 模块执行 nativeTest 。 + +假设贡献者处于新的 Ubuntu 22.04.4 LTS 实例下,其可通过如下 bash 命令通过 SDKMAN! 管理 JDK 和工具链, +并为 `elasticjob-test-native` 子模块执行 nativeTest。 + +贡献者必须安装 Docker Engine 以执行 `testcontainers-java` 相关的单元测试。 + +```bash +sudo apt install unzip zip curl sed -y +curl -s "https://get.sdkman.io" | bash +source "$HOME/.sdkman/bin/sdkman-init.sh" +sdk install java 22.0.2-graalce +sdk use java 22.0.2-graalce +sudo apt-get install build-essential zlib1g-dev -y + +git clone git@github.com:apache/shardingsphere-elasticjob.git +cd ./shardingsphere-elasticjob/ +./mvnw -PnativeTestInElasticJob -T1C -e clean test +``` + +当贡献者发现缺少与 ElasticJob 无关的第三方库的 GraalVM Reachability Metadata 时,应当在 +https://github.com/oracle/graalvm-reachability-metadata 打开新的 issue, 并提交包含依赖的第三方库缺失的 GraalVM Reachability +Metadata 的 PR。ElasticJob 在 `elasticjob-reachability-metadata` 子模块主动托管了部分第三方库的 GraalVM Reachability Metadata。 + +如果 nativeTest 执行失败, 应为单元测试生成初步的 GraalVM Reachability Metadata, +并手动调整 `elasticjob-reachability-metadata` 子模块的 classpath 的 `META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/` 文件夹下的内容以修复 nativeTest。 +如有需要,请使用 `org.junit.jupiter.api.condition.DisabledInNativeImage` 注解或 `org.graalvm.nativeimage.imagecode` 的 +System Property 屏蔽部分单元测试在 GraalVM Native Image 下运行。 + +ElasticJob 定义了 `generateMetadata` 的 Maven Profile 用于在 GraalVM JIT Compiler 下携带 GraalVM Tracing Agent 执行单元测试, +并在 `elasticjob-reachability-metadata` 子模块的 classpath 的 `META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/` 文件夹下, +生成或覆盖已有的 GraalVM Reachability Metadata 文件。可通过如下 bash 命令简单处理此流程。 +贡献者仍可能需要手动调整具体的 JSON 条目,并适时调整 Maven Profile 和 GraalVM Tracing Agent 的 Filter 链。 +针对 `elasticjob-reachability-metadata` 子模块, +手动增删改动的 JSON 条目应位于 `META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/` 文件夹下, +而 `META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/` 中的条目仅应由 `generateMetadata` 的 Maven Profile 生成。 + +以下命令仅为 `elasticjob-test-native` 生成 Conditional 形态的 GraalVM Reachability Metadata 的一个举例。 +生成的 GraalVM Reachability Metadata 位于 `elasticjob-reachability-metadata` 子模块下。 + +对于测试类和测试文件独立使用的 GraalVM Reachability Metadata,贡献者应该放置到 `shardingsphere-test-native` 子模块的 classpath 的 +`META-INF/native-image/elasticjob-test-native-test-metadata/` 下。 + +```bash +git clone git@github.com:apache/shardingsphere.git +cd ./shardingsphere/ +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy +``` diff --git a/docs/content/user-manual/configuration/graalvm-native-image.en.md b/docs/content/user-manual/configuration/graalvm-native-image.en.md new file mode 100644 index 0000000000..5b9018c8c5 --- /dev/null +++ b/docs/content/user-manual/configuration/graalvm-native-image.en.md @@ -0,0 +1,173 @@ ++++ +title = "GraalVM Native Image" +weight = 6 +chapter = true ++++ + +## Background information + +ElasticJob has been verified for availability under GraalVM Native Image. + +To build a GraalVM Native Image with the Maven dependency `org.apache.shardingsphere.elasticjob:elasticjob-bootstrap:${elasticjob.version}`, +you need to use GraalVM Native Build Tools. + +GraalVM Native Build Tools provides Maven Plugin and Gradle Plugin to simplify the long-winded shell commands of GraalVM CE's `native-image` command line tool. + +ElasticJob requires the following or higher versions of `GraalVM CE` to build the GraalVM Native Image. Users can quickly switch JDKs through `SDKMAN!`. +This also applies to downstream distributions of `GraalVM CE` such as https://sdkman.io/jdks#graal, https://sdkman.io/jdks#nik and https://sdkman.io/jdks#mandrel. + +- GraalVM CE For JDK 22.0.2, corresponding to `22.0.2-graalce` of SDKMAN! + +Users can still use old versions of GraalVM CE such as `21.0.2-graalce` on SDKMAN! to build ElasticJob's GraalVM Native Image product. +ElasticJob does not set CI for GraalVM CE versions that have stopped maintenance. + +## Using ElasticJob's Java API + +### Maven Ecosystem + +Users need to actively use the GraalVM Reachability Metadata Central Repository. +The following configuration is for reference. To configure additional Maven Profiles for the project, +refer to the documentation of GraalVM Native Build Tools. + +```xml + + + + org.apache.shardingsphere.elasticjob + elasticjob-bootstrap + ${elasticjob.version} + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + 0.10.2 + true + + + build-native + + compile-no-fork + + package + + + test-native + + test + + test + + + + + + +``` + +### Gradle Ecosystem + +Users need to actively use the GraalVM Reachability Metadata Central Repository. +The following configuration is for reference. To configure additional Gradle Tasks for the project, refer to the documentation of GraalVM Native Build Tools. +Due to the limitations of https://github.com/gradle/gradle/issues/17559, users need to introduce the Metadata Repository JSON file in the form of Maven dependencies. +Refer to https://github.com/graalvm/native-build-tools/issues/572. + +```groovy +plugins { + id 'org.graalvm.buildtools.native' version '0.10.2' +} + +dependencies { + implementation 'org.apache.shardingsphere.elasticjob:elasticjob-bootstrap:${elasticjob.version}' + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') +} + +graalvmNative { + metadataRepository { + enabled.set(false) + } +} +``` + +## For build tools such as sbt that are not supported by GraalVM Native Build Tools + +Such requirements require opening additional issues at https://github.com/graalvm/native-build-tools and providing plugin implementations for the corresponding build tools. + +## Usage restrictions + +1. Users still need to configure GraalVM Reachability Metadata in separate files in the `src/main/resources/META-INF/native-image` folder or the `src/test/resources/META-INF/native-image` folder. +Users can quickly collect GraalVM Reachability Metadata through the GraalVM Tracing Agent of GraalVM Native Build Tools. + +2. For `org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap` with `elasticJobType` as `SCRIPT` under Linux, +if `script.command.line` is set to the relative path of a `.sh` file in the private project's classpath under the GraalVM Native Image when building the GraalVM Native Image, +then the `.sh` file must at least have the POSIX file permission of `rwxr-xr-x` set in advance. +This is because `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` obviously does not support `java.nio.file.attribute.PosixFileAttributeView`. + +3. The Spring namespace integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` of ElasticJob is not yet available under GraalVM Native Image. + +4. The Spring Boot Starter integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` for ElasticJob is not yet available under GraalVM Native Image. + +## Contribute GraalVM Reachability Metadata + +ElasticJob's usability verification under GraalVM Native Image is done by the Maven Plugin subproject of GraalVM Native Build Tools. + +Unit test coverage under GraalVM Native Image is tested by running unit tests under JVM, +tagging unit tests with `junit-platform-unique-ids*`, and then building GraalVM Native Image for nativeTest. +Contributors are requested not to use test libraries such as `io.kotest:kotest-runner-junit5-jvm:5.5.4` that failed to discover tests in `test listener` mode. + +ElasticJob defines the `elasticjob-test-native` Maven Module to provide a small subset of unit tests for native Test, +which avoids the use of third-party libraries such as Mockito that cannot be used under native Test. + +ElasticJob defines the `nativeTestInElasticJob` Maven profile to execute nativeTest for the `elasticjob-test-native` module. + +Assuming the contributor is on a fresh Ubuntu 22.04.4 LTS instance, he can use SDKMAN! to manage JDK and toolchains with the following bash command, +and execute nativeTest for the `elasticjob-test-native` submodule. + +Contributors must install Docker Engine to execute the `testcontainers-java` related unit tests. + +```bash +sudo apt install unzip zip curl sed -y +curl -s "https://get.sdkman.io" | bash +source "$HOME/.sdkman/bin/sdkman-init.sh" +sdk install java 22.0.2-graalce +sdk use java 22.0.2-graalce +sudo apt-get install build-essential zlib1g-dev -y + +git clone git@github.com:apache/shardingsphere-elasticjob.git +cd ./shardingsphere-elasticjob/ +./mvnw -PnativeTestInElasticJob -T1C -e clean test +``` + +When contributors find that GraalVM Reachability Metadata for third-party libraries not related to ElasticJob is missing, +they should open a new issue at https://github.com/oracle/graalvm-reachability-metadata, +and submit a PR with missing GraalVM Reachability Metadata for dependent third-party libraries. +ElasticJob proactively hosts GraalVM Reachability Metadata for some third-party libraries in the `elasticjob-reachability-metadata` submodule. + +If nativeTest fails, generate preliminary GraalVM Reachability Metadata for unit tests, +and manually adjust the contents of the `META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/` folder in the classpath of the `elasticjob-reachability-metadata` submodule to fix nativeTest. +If necessary, +use the `org.junit.jupiter.api.condition.DisabledInNativeImage` annotation or the `org.graalvm.nativeimage.imagecode` System Property to shield some unit tests from running under the GraalVM Native Image. + +ElasticJob defines the `generateMetadata` Maven Profile to execute unit tests with the GraalVM Tracing Agent under the GraalVM JIT Compiler, +and generates or overwrites the existing GraalVM Reachability Metadata file in the `META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/` folder in the classpath of the `elasticjob-reachability-metadata` submodule. +This process can be easily handled by the following bash command. +Contributors may still need to manually adjust specific JSON entries and adjust the filter chain of the Maven Profile and GraalVM Tracing Agent as appropriate. +For the `elasticjob-reachability-metadata` submodule, +manually added, deleted, and modified JSON entries should be located in the `META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/` folder, +while the entries in `META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/` should only be generated by the `generateMetadata` Maven Profile. + +The following command is just an example of generating Conditional GraalVM Reachability Metadata for `elasticjob-test-native`. +The generated GraalVM Reachability Metadata is located in the `elasticjob-reachability-metadata` submodule. + +For GraalVM Reachability Metadata used independently by test classes and test files, +contributors should place it in the classpath of the shardingsphere-test-native submodule under `META-INF/native-image/elasticjob-test-native-test-metadata/`. + +```bash +git clone git@github.com:apache/shardingsphere.git +cd ./shardingsphere/ +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy +``` diff --git a/pom.xml b/pom.xml index dee0a8d466..15a3aa9ca4 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ test distribution + reachability-metadata @@ -83,7 +84,7 @@ 1.18.30 - 5.10.0 + 5.10.3 2.2 4.11.0 4.2.0 @@ -126,6 +127,8 @@ 1.0.0 3.4 1.10 + + 0.10.2 @@ -815,6 +818,8 @@ **/package-lock.json /examples/** + + **/META-INF/native-image/**/*.json **/AdminLTE/** **/bootstrap/** @@ -920,6 +925,100 @@ + + generateMetadata + + + + + maven-surefire-plugin + + + org.apache.shardingsphere.elasticjob.test.natived.** + + + + + org.graalvm.buildtools + native-maven-plugin + ${native-maven-plugin.version} + true + + + true + Conditional + + + ${user.dir}/test/native/native-image-filter/user-code-filter.json + ${user.dir}/test/native/native-image-filter/extra-filter.json + true + + + + + main + + false + ${user.dir}/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/ + + + + + + build-native + + compile-no-fork + + package + + + test-native + + test + + test + + + + + + + + + nativeTestInElasticJob + + + + + maven-surefire-plugin + + + org.apache.shardingsphere.elasticjob.test.natived.** + + + + + org.graalvm.buildtools + native-maven-plugin + ${native-maven-plugin.version} + true + + true + + + + test-native + + test + + test + + + + + + + diff --git a/reachability-metadata/pom.xml b/reachability-metadata/pom.xml new file mode 100644 index 0000000000..29ddf18b66 --- /dev/null +++ b/reachability-metadata/pom.xml @@ -0,0 +1,29 @@ + + + + + 4.0.0 + + org.apache.shardingsphere.elasticjob + elasticjob + 3.1.0-SNAPSHOT + + elasticjob-reachability-metadata + ${project.artifactId} + + diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json new file mode 100644 index 0000000000..cb28c8e584 --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json @@ -0,0 +1,7 @@ +[ +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", + "allPublicMethods":true +} +] diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/resource-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/resource-config.json new file mode 100644 index 0000000000..8003abbbba --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/resource-config.json @@ -0,0 +1,11 @@ +{ + "resources":{ + "includes":[{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader"}, + "pattern":".*META-INF/services/org\\.apache\\.shardingsphere\\.elasticjob\\..+" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.SQLPropertiesFactory"}, + "pattern":".*META-INF/sql/.+\\.properties$" + }]}, + "bundles":[] +} diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/jni-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/jni-config.json new file mode 100644 index 0000000000..32960f8ced --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/jni-config.json @@ -0,0 +1,2 @@ +[ +] \ No newline at end of file diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/predefined-classes-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/predefined-classes-config.json new file mode 100644 index 0000000000..847895071f --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/predefined-classes-config.json @@ -0,0 +1,7 @@ +[ + { + "type":"agent-extracted", + "classes":[ + ] + } +] diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json new file mode 100644 index 0000000000..fd2d4325f4 --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json @@ -0,0 +1,6 @@ +[ + { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConfigurationConverter"}, + "interfaces":["java.sql.Connection"] + } +] \ No newline at end of file diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json new file mode 100644 index 0000000000..b934e85204 --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json @@ -0,0 +1,253 @@ +[ +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConfigurationConverter"}, + "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"java.util.Properties", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "name":"java.util.Properties", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager"}, + "name":"java.util.Properties", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.reconcile.ReconcileService"}, + "name":"java.util.Properties", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ShardingTotalCountChangedJobListener"}, + "name":"java.util.Properties", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.item.JobItemExecutorFactory"}, + "name":"org.apache.shardingsphere.elasticjob.dataflow.executor.DataflowJobExecutor" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerReloader"}, + "name":"org.apache.shardingsphere.elasticjob.error.handler.normal.IgnoreJobErrorHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerReloader"}, + "name":"org.apache.shardingsphere.elasticjob.error.handler.normal.LogJobErrorHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.error.handler.JobErrorHandlerReloader"}, + "name":"org.apache.shardingsphere.elasticjob.error.handler.normal.ThrowJobErrorHandler", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "name":"org.apache.shardingsphere.elasticjob.http.executor.HttpJobExecutor" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type.CPUUsageJobExecutorThreadPoolSizeProvider" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "queryAllPublicMethods":true, + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDescription","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setJobParameter","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "allDeclaredFields":true, + "methods":[{"name":"getCron","parameterTypes":[] }, {"name":"getDescription","parameterTypes":[] }, {"name":"getJobErrorHandlerType","parameterTypes":[] }, {"name":"getJobExecutorThreadPoolSizeProviderType","parameterTypes":[] }, {"name":"getJobExtraConfigurations","parameterTypes":[] }, {"name":"getJobListenerTypes","parameterTypes":[] }, {"name":"getJobName","parameterTypes":[] }, {"name":"getJobParameter","parameterTypes":[] }, {"name":"getJobShardingStrategyType","parameterTypes":[] }, {"name":"getLabel","parameterTypes":[] }, {"name":"getMaxTimeDiffSeconds","parameterTypes":[] }, {"name":"getProps","parameterTypes":[] }, {"name":"getReconcileIntervalMinutes","parameterTypes":[] }, {"name":"getShardingItemParameters","parameterTypes":[] }, {"name":"getShardingTotalCount","parameterTypes":[] }, {"name":"getTimeZone","parameterTypes":[] }, {"name":"isDisabled","parameterTypes":[] }, {"name":"isFailover","parameterTypes":[] }, {"name":"isMisfire","parameterTypes":[] }, {"name":"isMonitorExecution","parameterTypes":[] }, {"name":"isOverwrite","parameterTypes":[] }, {"name":"isStaticSharding","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.reconcile.ReconcileService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ShardingTotalCountChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJOBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJOCustomizer" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin", + "queryAllPublicMethods":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setCleanShutdown","parameterTypes":["boolean"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPluginBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPluginCustomizer" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "allDeclaredFields":true, + "methods":[{"name":"getJobInstanceId","parameterTypes":[] }, {"name":"getLabels","parameterTypes":[] }, {"name":"getServerIp","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.setup.SetUpFacade"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstanceBeanInfo" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstanceCustomizer" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setTracingStorageConfiguration","parameterTypes":["org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfigurationConverter" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler"}, + "name":"org.apache.shardingsphere.elasticjob.reg.zookeeper.exception.ZookeeperCuratorIgnoredExceptionProvider" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "name":"org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.item.JobItemExecutorFactory"}, + "name":"org.apache.shardingsphere.elasticjob.simple.executor.SimpleJobExecutor" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "name":"org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListener", + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListener", + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerFactory" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConfigurationConverter" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.DB2TracingStorageDatabaseType" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.H2TracingStorageDatabaseType" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.MySQLTracingStorageDatabaseType" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.OracleTracingStorageDatabaseType" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.PostgreSQLTracingStorageDatabaseType" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.SQLServerTracingStorageDatabaseType" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Map"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfigurationConverter" +} +] \ No newline at end of file diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json new file mode 100644 index 0000000000..101e57e2fc --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json @@ -0,0 +1,41 @@ +{ + "resources":{ + "includes":[{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.item.JobItemExecutorFactory"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.storage.TracingStorageConfigurationConverter\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.yaml.YamlConfigurationConverter\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.TracingStorageDatabaseType\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.SQLPropertiesFactory"}, + "pattern":"\\QMETA-INF/sql/H2.properties\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "pattern":"\\Qorg/quartz/core/quartz-build.properties\\E" + }]}, + "bundles":[] +} \ No newline at end of file diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/serialization-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/serialization-config.json new file mode 100644 index 0000000000..d0304f2a1c --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/serialization-config.json @@ -0,0 +1,8 @@ +{ + "types":[ + ], + "lambdaCapturingTypes":[ + ], + "proxies":[ + ] +} \ No newline at end of file diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.zookeeper/zookeeper/3.9.2/reflect-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.zookeeper/zookeeper/3.9.2/reflect-config.json new file mode 100644 index 0000000000..a6e52201ca --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.zookeeper/zookeeper/3.9.2/reflect-config.json @@ -0,0 +1,56 @@ +[ +{ + "condition":{"typeReachable":"org.apache.zookeeper.ZooKeeper"}, + "name":"org.apache.zookeeper.ClientCnxnSocketNIO", + "methods":[{"name":"","parameterTypes":["org.apache.zookeeper.client.ZKClientConfig"] }] +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.metrics.impl.MetricsProviderBootstrap"}, + "name":"org.apache.zookeeper.metrics.impl.DefaultMetricsProvider", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.quorum.QuorumPeerConfig"}, + "name":"org.apache.zookeeper.metrics.impl.DefaultMetricsProvider" +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.ServerCnxnFactory"}, + "name":"org.apache.zookeeper.server.ConnectionBean", + "queryAllPublicConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.ServerCnxnFactory"}, + "name":"org.apache.zookeeper.server.ConnectionMXBean", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.ZooKeeperServer"}, + "name":"org.apache.zookeeper.server.DataTreeBean", + "queryAllPublicConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.ZooKeeperServer"}, + "name":"org.apache.zookeeper.server.DataTreeMXBean", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.ServerCnxnFactory"}, + "name":"org.apache.zookeeper.server.NIOServerCnxnFactory", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.ZooKeeperServer"}, + "name":"org.apache.zookeeper.server.ZooKeeperServerBean", + "queryAllPublicConstructors":true +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.ZooKeeperServer"}, + "name":"org.apache.zookeeper.server.ZooKeeperServerMXBean", + "queryAllPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.zookeeper.server.watch.WatchManagerFactory"}, + "name":"org.apache.zookeeper.server.watch.WatchManager", + "methods":[{"name":"","parameterTypes":[] }] +} +] diff --git a/spring/core/pom.xml b/spring/core/pom.xml index 1d59320696..dbc3b8c1b5 100644 --- a/spring/core/pom.xml +++ b/spring/core/pom.xml @@ -42,15 +42,18 @@ org.springframework spring-context + provided org.springframework spring-context-support + provided org.springframework spring-test + test diff --git a/spring/namespace/pom.xml b/spring/namespace/pom.xml index 62d842f237..83a3a8ae40 100644 --- a/spring/namespace/pom.xml +++ b/spring/namespace/pom.xml @@ -62,10 +62,12 @@ org.springframework spring-context + provided org.springframework spring-context-support + provided @@ -75,6 +77,7 @@ org.springframework spring-test + test com.h2database diff --git a/test/native/native-image-filter/extra-filter.json b/test/native/native-image-filter/extra-filter.json new file mode 100644 index 0000000000..9e706a39d4 --- /dev/null +++ b/test/native/native-image-filter/extra-filter.json @@ -0,0 +1,17 @@ +{ + "rules": [ + {"includeClasses": "**"}, + + {"excludeClasses": "com.google.common.util.concurrent.**"}, + {"excludeClasses": "com.zaxxer.hikari.**"}, + {"excludeClasses": "java.**"}, + {"includeClasses": "java.util.Properties"}, + {"excludeClasses": "org.apache.zookeeper.**"}, + {"excludeClasses": "org.quartz.**"}, + {"excludeClasses": "sun.misc.**"}, + + {"excludeClasses": "org.apache.shardingsphere.elasticjob.test.natived.**"} + ], + "regexRules": [ + ] +} diff --git a/test/native/native-image-filter/user-code-filter.json b/test/native/native-image-filter/user-code-filter.json new file mode 100644 index 0000000000..926a991968 --- /dev/null +++ b/test/native/native-image-filter/user-code-filter.json @@ -0,0 +1,7 @@ +{ + "rules": [ + {"excludeClasses": "**"}, + {"includeClasses": "org.apache.shardingsphere.elasticjob.**"}, + {"excludeClasses": "org.apache.shardingsphere.elasticjob.test.natived.**"} + ] +} diff --git a/test/native/pom.xml b/test/native/pom.xml new file mode 100644 index 0000000000..459222a528 --- /dev/null +++ b/test/native/pom.xml @@ -0,0 +1,67 @@ + + + + + 4.0.0 + + org.apache.shardingsphere.elasticjob + elasticjob-test + 3.1.0-SNAPSHOT + + elasticjob-test-native + ${project.artifactId} + + + true + + + + + org.apache.shardingsphere.elasticjob + elasticjob-bootstrap + ${project.version} + test + + + + org.awaitility + awaitility + test + + + com.h2database + h2 + test + + + org.apache.curator + curator-test + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + ${native-maven-plugin.version} + + + + diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java new file mode 100644 index 0000000000..1abcead7ef --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java @@ -0,0 +1,168 @@ +/* + * 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.elasticjob.test.natived; + +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import org.apache.curator.CuratorZookeeperClient; +import org.apache.curator.retry.ExponentialBackoffRetry; +import org.apache.curator.test.TestingServer; +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.dataflow.props.DataflowJobProperties; +import org.apache.shardingsphere.elasticjob.http.props.HttpJobProperties; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import org.apache.shardingsphere.elasticjob.script.props.ScriptJobProperties; +import org.apache.shardingsphere.elasticjob.test.natived.commons.job.dataflow.JavaDataflowJob; +import org.apache.shardingsphere.elasticjob.test.natived.commons.job.simple.JavaSimpleJob; +import org.awaitility.Awaitility; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledInNativeImage; +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; + +import javax.sql.DataSource; +import java.io.IOException; +import java.nio.file.Paths; +import java.time.Duration; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + +@EnabledInNativeImage +class JavaTest { + + private static TestingServer testingServer; + + private static CoordinatorRegistryCenter regCenter; + + private static TracingConfiguration tracingConfig; + + /** + * TODO Internally in {@link org.apache.curator.test.TestingServer}, + * {@code Files.createTempDirectory(DirectoryUtils.class.getSimpleName()).toFile())} calls {@link java.nio.file.Path#toFile()}, + * which is undesirable in both JAR and GraalVM Native Image, + * see oracle/graal#7804. + * ElasticJob believe this requires changes on the apache/curator side. + * + * @throws Exception errors + */ + @BeforeAll + static void beforeAll() throws Exception { + testingServer = new TestingServer(); + try ( + CuratorZookeeperClient client = new CuratorZookeeperClient(testingServer.getConnectString(), + 60 * 1000, 500, null, + new ExponentialBackoffRetry(500, 3, 500 * 3))) { + client.start(); + Awaitility.await().atMost(Duration.ofMillis(500 * 60)).until(client::isConnected); + } + regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); + regCenter.init(); + HikariConfig config = new HikariConfig(); + config.setDriverClassName("org.h2.Driver"); + config.setJdbcUrl("jdbc:h2:mem:job_event_storage"); + config.setUsername("sa"); + config.setPassword(""); + tracingConfig = new TracingConfiguration<>("RDB", new HikariDataSource(config)); + } + + @AfterAll + static void afterAll() throws IOException { + regCenter.close(); + testingServer.close(); + } + + @Test + void testHttpJob() { + ScheduleJobBootstrap jobBootstrap = new ScheduleJobBootstrap(regCenter, "HTTP", + JobConfiguration.newBuilder("testJavaHttpJob", 3) + .setProperty(HttpJobProperties.URI_KEY, "https://www.apache.org") + .setProperty(HttpJobProperties.METHOD_KEY, "GET") + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + assertDoesNotThrow(() -> { + jobBootstrap.schedule(); + jobBootstrap.shutdown(); + }); + } + + @Test + void testSimpleJob() { + ScheduleJobBootstrap jobBootstrap = new ScheduleJobBootstrap(regCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder("testJavaSimpleJob", 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + assertDoesNotThrow(() -> { + jobBootstrap.schedule(); + jobBootstrap.shutdown(); + }); + } + + @Test + void testDataflowJob() { + ScheduleJobBootstrap jobBootstrap = new ScheduleJobBootstrap(regCenter, new JavaDataflowJob(), + JobConfiguration.newBuilder("testJavaDataflowElasticJob", 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, Boolean.TRUE.toString()) + .addExtraConfigurations(tracingConfig) + .build()); + assertDoesNotThrow(() -> { + jobBootstrap.schedule(); + jobBootstrap.shutdown(); + }); + } + + @Test + void testOneOffJob() { + OneOffJobBootstrap jobBootstrap = new OneOffJobBootstrap(regCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder("testJavaOneOffSimpleJob", 3) + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + assertDoesNotThrow(() -> { + jobBootstrap.execute(); + jobBootstrap.shutdown(); + }); + } + + @Test + @EnabledOnOs(OS.LINUX) + void testScriptJob() { + ScheduleJobBootstrap jobBootstrap = new ScheduleJobBootstrap(regCenter, "SCRIPT", + JobConfiguration.newBuilder("scriptElasticJob", 3) + .cron("0/5 * * * * ?") + .setProperty(ScriptJobProperties.SCRIPT_KEY, Paths.get("src/test/resources/script/demo.sh").toString()) + .addExtraConfigurations(tracingConfig) + .build()); + assertDoesNotThrow(() -> { + jobBootstrap.schedule(); + jobBootstrap.shutdown(); + }); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java new file mode 100644 index 0000000000..7fb818cd65 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java @@ -0,0 +1,45 @@ +/* + * 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.elasticjob.test.natived.commons.entity; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +@Getter +@ToString +@AllArgsConstructor +public final class Foo implements Serializable { + + private static final long serialVersionUID = 2706842871078949451L; + + private final long id; + + private final String location; + + @Setter + private Status status; + + public enum Status { + TODO, + COMPLETED + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.java new file mode 100644 index 0000000000..7c87dffacc --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.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.elasticjob.test.natived.commons.job.dataflow; + +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; +import org.apache.shardingsphere.elasticjob.test.natived.commons.entity.Foo; +import org.apache.shardingsphere.elasticjob.test.natived.commons.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.test.natived.commons.repository.FooRepositoryFactory; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +public class JavaDataflowJob implements DataflowJob { + + private final FooRepository fooRepository = FooRepositoryFactory.getFOO_REPOSITORY(); + + @Override + public List fetchData(final ShardingContext shardingContext) { + System.out.printf( + "Item: %s | Time: %s | Thread: %s | %s%n", + shardingContext.getShardingItem(), + new SimpleDateFormat("HH:mm:ss").format(new Date()), + Thread.currentThread().getId(), + "DATAFLOW FETCH"); + return fooRepository.findTodoData(shardingContext.getShardingParameter(), 10); + } + + @Override + public void processData(final ShardingContext shardingContext, final List data) { + System.out.printf( + "Item: %s | Time: %s | Thread: %s | %s%n", + shardingContext.getShardingItem(), + new SimpleDateFormat("HH:mm:ss").format(new Date()), + Thread.currentThread().getId(), + "DATAFLOW PROCESS"); + data.stream().mapToLong(Foo::getId).forEach(fooRepository::setCompleted); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java new file mode 100644 index 0000000000..0932a700bc --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java @@ -0,0 +1,45 @@ +/* + * 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.elasticjob.test.natived.commons.job.simple; + +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; +import org.apache.shardingsphere.elasticjob.test.natived.commons.entity.Foo; +import org.apache.shardingsphere.elasticjob.test.natived.commons.repository.FooRepository; +import org.apache.shardingsphere.elasticjob.test.natived.commons.repository.FooRepositoryFactory; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +public class JavaSimpleJob implements SimpleJob { + + private final FooRepository fooRepository = FooRepositoryFactory.getFOO_REPOSITORY(); + + @Override + public void execute(final ShardingContext shardingContext) { + System.out.printf( + "Item: %s | Time: %s | Thread: %s | %s%n", + shardingContext.getShardingItem(), + new SimpleDateFormat("HH:mm:ss").format(new Date()), + Thread.currentThread().getId(), + "SIMPLE"); + List data = fooRepository.findTodoData(shardingContext.getShardingParameter(), 10); + data.stream().mapToLong(Foo::getId).forEach(fooRepository::setCompleted); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java new file mode 100644 index 0000000000..e6abaf1b10 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java @@ -0,0 +1,72 @@ +/* + * 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.elasticjob.test.natived.commons.repository; + +import org.apache.shardingsphere.elasticjob.test.natived.commons.entity.Foo; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.LongStream; + +public class FooRepository { + + private final Map data = new ConcurrentHashMap<>(300, 1); + + public FooRepository() { + addData(0L, 100L, "Norddorf"); + addData(100L, 200L, "Bordeaux"); + addData(200L, 300L, "Somerset"); + } + + private void addData(final long idFrom, final long idTo, final String location) { + LongStream.range(idFrom, idTo) + .forEachOrdered(i -> data.put(i, new Foo(i, location, Foo.Status.TODO))); + } + + /** + * Find todoData. + * @param location location + * @param limit limit + * @return An ordered collection, where the user has precise control over where in the list each element is inserted. + */ + public List findTodoData(final String location, final int limit) { + List result = new ArrayList<>(limit); + int count = 0; + for (Map.Entry each : data.entrySet()) { + Foo foo = each.getValue(); + if (foo.getLocation().equals(location) && foo.getStatus() == Foo.Status.TODO) { + result.add(foo); + count++; + if (count == limit) { + break; + } + } + } + return result; + } + + /** + * Set completed. + * @param id id + */ + public void setCompleted(final long id) { + data.get(id).setStatus(Foo.Status.COMPLETED); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepositoryFactory.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepositoryFactory.java new file mode 100644 index 0000000000..8ce70c48f6 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepositoryFactory.java @@ -0,0 +1,27 @@ +/* + * 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.elasticjob.test.natived.commons.repository; + +import lombok.Getter; + +public final class FooRepositoryFactory { + + @Getter + private static final FooRepository FOO_REPOSITORY = new FooRepository(); + +} diff --git a/test/native/src/test/resources/script/demo.sh b/test/native/src/test/resources/script/demo.sh new file mode 100644 index 0000000000..a3f5b00278 --- /dev/null +++ b/test/native/src/test/resources/script/demo.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# 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. +# + +# shellcheck disable=SC2048 +# shellcheck disable=SC2086 +echo Sharding Context: $* diff --git a/test/pom.xml b/test/pom.xml index 5c11d880af..4d6d5e326f 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -30,5 +30,6 @@ e2e util + native From 6758126078d5a75fcf020955fbf09cc630714d05 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Mon, 29 Jul 2024 16:33:15 +0800 Subject: [PATCH 172/178] Removes non-existent `elasticjob-tracing-api` and `elasticjob-error-handler-spi` module --- .github/workflows/maven.yml | 7 +++++-- kernel/pom.xml | 10 ---------- .../impl/DefaultJsonRequestBodyDeserializer.java | 2 +- .../impl/DefaultJsonResponseBodySerializer.java | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 1f9a05c46d..8bc9771b26 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -44,16 +44,19 @@ jobs: with: distribution: 'zulu' java-version: ${{ matrix.java }} + cache: 'maven' - name: Build with Maven in Windows if: matrix.os == 'windows-latest' run: | - ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install + ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install -T1C - name: Build with Maven in Linux or macOS if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' run: | - ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install -Pcheck + ./mvnw --batch-mode --no-transfer-progress '-Dmaven.javadoc.skip=true' clean install -Pcheck -T1C - name: Upload coverage to Codecov if: matrix.os == 'ubuntu-latest' && matrix.java == '8' uses: codecov/codecov-action@v3 with: file: '**/target/site/jacoco/jacoco.xml' + - name: Build Examples with Maven + run: ./mvnw clean package -B -f examples/pom.xml -T1C diff --git a/kernel/pom.xml b/kernel/pom.xml index ae63a8371e..c507ec7e3d 100644 --- a/kernel/pom.xml +++ b/kernel/pom.xml @@ -32,21 +32,11 @@ elasticjob-api ${project.parent.version} - - org.apache.shardingsphere.elasticjob - elasticjob-error-handler-spi - ${project.parent.version} - org.apache.shardingsphere.elasticjob elasticjob-registry-center-zookeeper-curator ${project.parent.version} - - org.apache.shardingsphere.elasticjob - elasticjob-tracing-api - ${project.parent.version} - org.apache.shardingsphere.elasticjob diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java index 0491ed2ce0..03235f22f3 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/deserializer/impl/DefaultJsonRequestBodyDeserializer.java @@ -19,7 +19,7 @@ import com.google.gson.Gson; import io.netty.handler.codec.http.HttpHeaderValues; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.restful.deserializer.RequestBodyDeserializer; import java.nio.charset.StandardCharsets; diff --git a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java index 3baef7854b..bb03871719 100644 --- a/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java +++ b/restful/src/main/java/org/apache/shardingsphere/elasticjob/restful/serializer/impl/DefaultJsonResponseBodySerializer.java @@ -19,7 +19,7 @@ import com.google.gson.Gson; import io.netty.handler.codec.http.HttpHeaderValues; -import org.apache.shardingsphere.elasticjob.infra.json.GsonFactory; +import org.apache.shardingsphere.elasticjob.kernel.infra.json.GsonFactory; import org.apache.shardingsphere.elasticjob.restful.serializer.ResponseBodySerializer; import java.nio.charset.StandardCharsets; From e240fbb565613e1a605c9d2aa97f236924c5fe6c Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sat, 10 Aug 2024 15:22:56 +0800 Subject: [PATCH 173/178] Bump Maven Wrapper and actions/checkout (#2419) --- .github/workflows/graalvm.yml | 3 +- .mvn/wrapper/maven-wrapper.properties | 8 +- mvnw | 434 ++++++++++++-------------- mvnw.cmd | 286 ++++++++--------- 4 files changed, 333 insertions(+), 398 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index fcff1f14e3..1216b9307f 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -34,7 +34,7 @@ jobs: os: [ 'ubuntu-latest' ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up GraalVM CE ${{ matrix.java }} uses: graalvm/setup-graalvm@v1 with: @@ -42,6 +42,7 @@ jobs: distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} cache: 'maven' + native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} continue-on-error: true run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 24f62b570c..f95f1ee807 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -6,7 +6,7 @@ # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # -# https://www.apache.org/licenses/LICENSE-2.0 +# 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 @@ -14,6 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip -wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar +wrapperVersion=3.3.2 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip diff --git a/mvnw b/mvnw index b7f064624f..19529ddf8c 100755 --- a/mvnw +++ b/mvnw @@ -19,269 +19,241 @@ # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# Apache Maven Wrapper startup batch script, version 3.1.1 -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir +# Apache Maven Wrapper startup batch script, version 3.3.2 # # Optional ENV vars # ----------------- -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output # ---------------------------------------------------------------------------- -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /usr/local/etc/mavenrc ] ; then - . /usr/local/etc/mavenrc - fi - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - JAVA_HOME="`/usr/libexec/java_home`"; export JAVA_HOME - else - JAVA_HOME="/Library/Java/Home"; export JAVA_HOME - fi - fi - ;; +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; esac -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" else JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi fi else - JAVACMD="`\\unset -f command; \\command -v java`" + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi fi -fi +} -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi +die() { + printf %s\\n "$1" >&2 + exit 1 +} - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - printf '%s' "$(cd "$basedir"; pwd)" +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' } -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" } -BASE_DIR=$(find_maven_basedir "$(dirname $0)") -if [ -z "$BASE_DIR" ]; then - exit 1; +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" fi -MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" - else - wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) wrapperUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $wrapperUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi + die "cannot create temp dir" +fi - if command -v wget > /dev/null; then - QUIET="--quiet" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - QUIET="" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" - else - wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" - fi - [ $? -eq 0 ] || rm -f "$wrapperJarPath" - elif command -v curl > /dev/null; then - QUIET="--silent" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - QUIET="" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L - else - curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L - fi - [ $? -eq 0 ] || rm -f "$wrapperJarPath" - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaSource="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaSource=`cygpath --path --windows "$javaSource"` - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaSource" ]; then - if [ ! -e "$javaClass" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaSource") - fi - if [ -e "$javaClass" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" fi -########################################################################################## -# End of extension -########################################################################################## -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" fi -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" -exec "$JAVACMD" \ - $MAVEN_OPTS \ - $MAVEN_DEBUG_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" +clean || : +exec_maven "$@" diff --git a/mvnw.cmd b/mvnw.cmd index 474c9d6b74..249bdf3822 100644 --- a/mvnw.cmd +++ b/mvnw.cmd @@ -1,3 +1,4 @@ +<# : batch portion @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @@ -18,170 +19,131 @@ @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- -@REM Apache Maven Wrapper startup batch script, version 3.1.1 -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir +@REM Apache Maven Wrapper startup batch script, version 3.3.2 @REM @REM Optional ENV vars -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output @REM ---------------------------------------------------------------------------- -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* -if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" - -FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %WRAPPER_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) ) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% ^ - %JVM_CONFIG_MAVEN_PROPS% ^ - %MAVEN_OPTS% ^ - %MAVEN_DEBUG_OPTS% ^ - -classpath %WRAPPER_JAR% ^ - "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ - %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" -if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%"=="on" pause - -if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% - -cmd /C exit /B %ERROR_CODE% +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" From 5b406f436d6a774d4e7d2888fe0bf262c713842e Mon Sep 17 00:00:00 2001 From: linghengqian Date: Sat, 10 Aug 2024 15:22:04 +0800 Subject: [PATCH 174/178] Block `elasticjob-spring-boot-starter` from passing `spring-boot-starter` test scope dependencies --- .../configuration/graalvm-native-image.cn.md | 25 +++++++++++++++++-- .../configuration/graalvm-native-image.en.md | 25 +++++++++++++++++-- spring/boot-starter/pom.xml | 1 + .../elasticjob/test/natived/JavaTest.java | 2 +- .../{script => test-native/sh}/demo.sh | 0 5 files changed, 48 insertions(+), 5 deletions(-) rename test/native/src/test/resources/{script => test-native/sh}/demo.sh (100%) diff --git a/docs/content/user-manual/configuration/graalvm-native-image.cn.md b/docs/content/user-manual/configuration/graalvm-native-image.cn.md index 8a892fa376..e0e65f97ae 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.cn.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.cn.md @@ -104,10 +104,31 @@ graalvmNative { 若 `script.command.line` 设置为构建 GraalVM Native Image 时, 私有项目的 classpath 下的某个 `.sh` 文件在 GraalVM Native Image 下的相对路径, 则此 `.sh` 文件至少提前设置 `rwxr-xr-x` 的 POSIX 文件权限。 因为 `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` 显然不支持 `java.nio.file.attribute.PosixFileAttributeView`。 +长话短说,用户应该避免在作业内包含类似如下的逻辑, + +```java +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.PosixFilePermissions; + +public class ExampleUtils { + public void setPosixFilePermissions() throws IOException { + URL resource = ExampleUtils.class.getResource("/script/demo.sh"); + assert resource != null; + Path path = Paths.get(resource.getPath()); + Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("rwxr-xr-x")); + } +} +``` + +3. `企业微信通知策略`,`钉钉通知策略`,`邮件通知策略`尚未在 GraalVM Native Image 下可用。 -3. ElasticJob 的 Spring 命名空间集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` 尚未在 GraalVM Native Image 下可用。 +4. ElasticJob 的 Spring 命名空间集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` 尚未在 GraalVM Native Image 下可用。 -4. ElasticJob 的 Spring Boot Starter 集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` 尚未在 GraalVM Native Image 下可用。 +5. ElasticJob 的 Spring Boot Starter 集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` 尚未在 GraalVM Native Image 下可用。 ## 贡献 GraalVM Reachability Metadata diff --git a/docs/content/user-manual/configuration/graalvm-native-image.en.md b/docs/content/user-manual/configuration/graalvm-native-image.en.md index 5b9018c8c5..513a58a851 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.en.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.en.md @@ -106,10 +106,31 @@ Users can quickly collect GraalVM Reachability Metadata through the GraalVM Trac if `script.command.line` is set to the relative path of a `.sh` file in the private project's classpath under the GraalVM Native Image when building the GraalVM Native Image, then the `.sh` file must at least have the POSIX file permission of `rwxr-xr-x` set in advance. This is because `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` obviously does not support `java.nio.file.attribute.PosixFileAttributeView`. +Long story short, users should avoid including logic like the following in their jobs, + +```java +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.PosixFilePermissions; + +public class ExampleUtils { + public void setPosixFilePermissions() throws IOException { + URL resource = ExampleUtils.class.getResource("/script/demo.sh"); + assert resource != null; + Path path = Paths.get(resource.getPath()); + Files.setPosixFilePermissions(path, PosixFilePermissions.fromString("rwxr-xr-x")); + } +} +``` + +3. `WeCom Notification Policy`, `DingTalk Notification Policy`, and `Email Notification Policy` are not yet available under GraalVM Native Image. -3. The Spring namespace integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` of ElasticJob is not yet available under GraalVM Native Image. +4. The Spring namespace integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` of ElasticJob is not yet available under GraalVM Native Image. -4. The Spring Boot Starter integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` for ElasticJob is not yet available under GraalVM Native Image. +5. The Spring Boot Starter integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` for ElasticJob is not yet available under GraalVM Native Image. ## Contribute GraalVM Reachability Metadata diff --git a/spring/boot-starter/pom.xml b/spring/boot-starter/pom.xml index 7fa77d5704..f685104a77 100644 --- a/spring/boot-starter/pom.xml +++ b/spring/boot-starter/pom.xml @@ -42,6 +42,7 @@ org.springframework.boot spring-boot-starter + true org.springframework.boot diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java index 1abcead7ef..8b8212854c 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java @@ -157,7 +157,7 @@ void testScriptJob() { ScheduleJobBootstrap jobBootstrap = new ScheduleJobBootstrap(regCenter, "SCRIPT", JobConfiguration.newBuilder("scriptElasticJob", 3) .cron("0/5 * * * * ?") - .setProperty(ScriptJobProperties.SCRIPT_KEY, Paths.get("src/test/resources/script/demo.sh").toString()) + .setProperty(ScriptJobProperties.SCRIPT_KEY, Paths.get("src/test/resources/test-native/sh/demo.sh").toString()) .addExtraConfigurations(tracingConfig) .build()); assertDoesNotThrow(() -> { diff --git a/test/native/src/test/resources/script/demo.sh b/test/native/src/test/resources/test-native/sh/demo.sh similarity index 100% rename from test/native/src/test/resources/script/demo.sh rename to test/native/src/test/resources/test-native/sh/demo.sh From d9e2cdbcb3ea0d2de67213e45649cdffb0f15c5d Mon Sep 17 00:00:00 2001 From: linghengqian Date: Sat, 10 Aug 2024 15:37:59 +0800 Subject: [PATCH 175/178] Fixes the issue that OneOffJobBootstrap cannot be used under ElasticJob Spring Boot Starter --- .../bootstrap/type/OneOffJobBootstrap.java | 2 +- docs/content/user-manual/operation/dump.cn.md | 5 ++- docs/content/user-manual/operation/dump.en.md | 5 ++- .../usage/job-api/spring-boot-starter.cn.md | 38 +++++++++++------- .../usage/job-api/spring-boot-starter.en.md | 40 +++++++++++-------- 5 files changed, 54 insertions(+), 36 deletions(-) diff --git a/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java index dc0599ccdd..31cfe784d1 100644 --- a/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java +++ b/bootstrap/src/main/java/org/apache/shardingsphere/elasticjob/bootstrap/type/OneOffJobBootstrap.java @@ -30,7 +30,7 @@ /** * One off job bootstrap. */ -public final class OneOffJobBootstrap implements JobBootstrap { +public class OneOffJobBootstrap implements JobBootstrap { private final JobScheduler jobScheduler; diff --git a/docs/content/user-manual/operation/dump.cn.md b/docs/content/user-manual/operation/dump.cn.md index 75c2c1515d..0f103fec2f 100644 --- a/docs/content/user-manual/operation/dump.cn.md +++ b/docs/content/user-manual/operation/dump.cn.md @@ -11,8 +11,9 @@ chapter = true ## 开启监听端口 -使用 Java 开启导出端口配置请参见[Java API 使用指南](/cn/user-manual/elasticjob/usage/job-api/java-api)。 -使用 Spring 开启导出端口配置请参见[Spring 使用指南](/cn/user-manual/elasticjob/usage/job-api/spring-namespace)。 +使用 Java API 开启导出端口配置请参见[Java API 作业信息导出配置](/cn/user-manual/elasticjob/configuration/java-api)。 +使用 Spring Boot Starter 开启导出端口配置请参见[Spring Boot Starter 作业信息导出配置](/cn/user-manual/elasticjob/configuration/java-api)。 +使用 Spring 命名空间 开启导出端口配置请参见[Spring 命名空间 作业信息导出配置](/cn/user-manual/elasticjob/configuration/spring-namespace)。 ## 执行导出命令 diff --git a/docs/content/user-manual/operation/dump.en.md b/docs/content/user-manual/operation/dump.en.md index 23458b90ff..95ebbaa9b7 100644 --- a/docs/content/user-manual/operation/dump.en.md +++ b/docs/content/user-manual/operation/dump.en.md @@ -12,8 +12,9 @@ For security reason, the information dumped had already mask sensitive informati ## Open Listener Port -Using Java API please refer to [Java API usage](/en/user-manual/elasticjob/usage/job-api/java-api) for more details. -Using Spring please refer to [Spring usage](/en/user-manual/elasticjob/usage/job-api/spring-namespace) for more details. +To open listener port using Java, refer to [Java API job information export configuration](/en/user-manual/elasticjob/configuration/java-api). +To open listener port using Spring Boot Starter, refer to [Spring Boot Starter job information export configuration](/en/user-manual/elasticjob/configuration/java-api). +To open listener port using Spring Namespace, refer to [Spring namespace job information export configuration](/en/user-manual/elasticjob/configuration/spring-namespace). ## Execute Dump diff --git a/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md b/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md index e21e6f849d..73576879bb 100644 --- a/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md +++ b/docs/content/user-manual/usage/job-api/spring-boot-starter.cn.md @@ -8,6 +8,9 @@ ElasticJob 提供自定义的 Spring Boot Starter,可以与 Spring Boot 配合 基于 ElasticJob Spring Boot Starter 使用 ElasticJob ,用户无需手动创建 CoordinatorRegistryCenter、JobBootstrap 等实例, 只需实现核心作业逻辑并辅以少量配置,即可利用轻量、无中心化的 ElasticJob 解决分布式调度问题。 +以下内容仅通过 Spring Boot 3 作为演示。 +相关内容在 Spring Boot 2 上仍可能有效,但由于 Spring Boot 2 已经结束维护,不对 Spring Boot 2 做任何可用性假设。 + ## 作业配置 ### 实现作业逻辑 @@ -74,6 +77,8 @@ elasticjob: 一次性调度的作业的执行权在开发者手中,开发者可以在需要调用作业的位置注入 `OneOffJobBootstrap`, 通过 `execute()` 方法执行作业。 +用户不应该使用 `jakarta.annotation.Resource` 等部分违反 Spring Boot 最佳实践的注解来注入定义的一次性任务的 Spring Bean。 + `OneOffJobBootstrap` bean 的名称通过属性 jobBootstrapBeanName 配置,注入时需要指定依赖的 bean 名称。 具体配置请参考[配置文档](/cn/user-manual/elasticjob/configuration/spring-boot-starter)。 @@ -81,32 +86,35 @@ elasticjob: elasticjob: jobs: myOneOffJob: + elasticJobType: SCRIPT jobBootstrapBeanName: myOneOffJobBean - .... + shardingTotalCount: 9 + props: + script.command.line: "echo Manual SCRIPT Job: " ``` ```java -@RestController -public class OneOffJobController { +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; - // 通过 "@Resource" 注入 - @Resource(name = "myOneOffJobBean") - private OneOffJobBootstrap myOneOffJob; - - @GetMapping("/execute") - public String executeOneOffJob() { - myOneOffJob.execute(); - return "{\"msg\":\"OK\"}"; - } +import java.util.Objects; +@RestController +public class OneOffJobController { // 通过 "@Autowired" 注入 @Autowired - @Qualifier(name = "myOneOffJobBean") - private OneOffJobBootstrap myOneOffJob2; + @Qualifier("myOneOffJobBean") + private ObjectProvider myOneOffJobProvider; @GetMapping("/execute2") public String executeOneOffJob2() { - myOneOffJob2.execute(); + OneOffJobBootstrap myOneOffJob = myOneOffJobProvider.getIfAvailable(); + Objects.requireNonNull(myOneOffJob); + myOneOffJob.execute(); return "{\"msg\":\"OK\"}"; } } diff --git a/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md b/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md index 2592c27092..901389477b 100644 --- a/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md +++ b/docs/content/user-manual/usage/job-api/spring-boot-starter.en.md @@ -8,6 +8,9 @@ ElasticJob provides a customized Spring Boot Starter, which can be used in conju Developers are free from configuring CoordinatorRegistryCenter, JobBootstrap by using ElasticJob Spring Boot Starter. What developers need to solve distributed scheduling problem are job implementations with a little configuration. +The following content is only demonstrated through Spring Boot 3. +The relevant content may still be valid on Spring Boot 2, but since Spring Boot 2 has ended maintenance, no availability assumptions are made for Spring Boot 2. + ## Job configuration ### Implements ElasticJob @@ -76,6 +79,8 @@ When to execute OneOffJob is up to you. Developers can inject the `OneOffJobBootstrap` bean into where they plan to invoke. Trigger the job by invoking `execute()` method manually. +Users should not use annotations such as `jakarta.annotation.Resource` which partially violate Spring Boot best practices to inject Spring beans that define one-time tasks. + The bean name of `OneOffJobBootstrap` is specified by property "jobBootstrapBeanName", Please refer to [Spring Boot Starter Configuration](/en/user-manual/elasticjob/configuration/spring-boot-starter). @@ -83,32 +88,35 @@ Please refer to [Spring Boot Starter Configuration](/en/user-manual/elasticjob/c elasticjob: jobs: myOneOffJob: + elasticJobType: SCRIPT jobBootstrapBeanName: myOneOffJobBean - .... + shardingTotalCount: 9 + props: + script.command.line: "echo Manual SCRIPT Job: " ``` ```java -@RestController -public class OneOffJobController { +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; - // Inject via "@Resource" - @Resource(name = "myOneOffJobBean") - private OneOffJobBootstrap myOneOffJob; - - @GetMapping("/execute") - public String executeOneOffJob() { - myOneOffJob.execute(); - return "{\"msg\":\"OK\"}"; - } +import java.util.Objects; - // Inject via "@Autowired" +@RestController +public class OneOffJobController { + // 通过 "@Autowired" 注入 @Autowired - @Qualifier(name = "myOneOffJobBean") - private OneOffJobBootstrap myOneOffJob2; + @Qualifier("myOneOffJobBean") + private ObjectProvider myOneOffJobProvider; @GetMapping("/execute2") public String executeOneOffJob2() { - myOneOffJob2.execute(); + OneOffJobBootstrap myOneOffJob = myOneOffJobProvider.getIfAvailable(); + Objects.requireNonNull(myOneOffJob); + myOneOffJob.execute(); return "{\"msg\":\"OK\"}"; } } From cfe00895155ccab7c588f55049339a19be874edf Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sun, 11 Aug 2024 09:48:32 +0800 Subject: [PATCH 176/178] Provides built-in GraalVM Reachability Metadata and nativeTest on Elasticjob Spring Boot Starter under Spring Boot 3.3.2 (#2417) --- .github/workflows/graalvm.yml | 2 +- .../configuration/graalvm-native-image.cn.md | 107 +++++++++++++++++- .../configuration/graalvm-native-image.en.md | 107 +++++++++++++++++- pom.xml | 20 +++- .../proxy-config.json | 2 +- .../reflect-config.json | 75 ++++++------ .../resource-config.json | 14 ++- spring/pom.xml | 3 +- .../native-image-filter/extra-filter.json | 10 +- test/native/pom.xml | 28 ++++- .../elasticjob/test/natived/TestMain.java | 31 +++++ .../controller/OneOffJobController.java | 50 ++++++++ .../job/dataflow/SpringBootDataflowJob.java | 62 ++++++++++ .../job/simple/SpringBootSimpleJob.java | 51 +++++++++ .../repository/SpringBootFooRepository.java | 74 ++++++++++++ .../natived/{ => it/staticd}/JavaTest.java | 4 +- .../natived/it/staticd/SpirngBootTest.java | 106 +++++++++++++++++ .../native/src/test/resources/application.yml | 52 +++++++++ 18 files changed, 731 insertions(+), 67 deletions(-) create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/controller/OneOffJobController.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java rename test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/{ => it/staticd}/JavaTest.java (98%) create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/SpirngBootTest.java create mode 100644 test/native/src/test/resources/application.yml diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index 1216b9307f..b396737ff6 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -45,4 +45,4 @@ jobs: native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} continue-on-error: true - run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test + run: ./mvnw -PnativeTestInElasticJob -T1C -B -e -Dspring-boot-dependencies.version=3.3.2 clean test diff --git a/docs/content/user-manual/configuration/graalvm-native-image.cn.md b/docs/content/user-manual/configuration/graalvm-native-image.cn.md index e0e65f97ae..79ca6f43bc 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.cn.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.cn.md @@ -91,6 +91,107 @@ graalvmNative { } ``` +## 使用 ElasticJob 的 Spring Boot Starter + +### Maven 生态 + +使用者需要主动使用 GraalVM Reachability Metadata 中央仓库。 +如下配置可供参考,以配置项目额外的 Maven Profiles,以 GraalVM Native Build Tools 的文档为准。 + +```xml + + + + org.apache.shardingsphere.elasticjob + elasticjob-spring-boot-starter + ${elasticjob.version} + test + + + org.springframework.boot + spring-boot-starter-jdbc + 3.3.2 + test + + + org.springframework.boot + spring-boot-starter-web + 3.3.2 + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + 0.10.2 + true + + + build-native + + compile-no-fork + + package + + + test-native + + test + + test + + + + + org.springframework.boot + spring-boot-maven-plugin + 3.3.2 + + + process-test-aot + + process-test-aot + + + + + + + +``` + +### Gradle 生态 + +使用者需要主动使用 GraalVM Reachability Metadata 中央仓库。 +如下配置可供参考,以配置项目额外的 Gradle Tasks,以 GraalVM Native Build Tools 的文档为准。 +由于 https://github.com/gradle/gradle/issues/17559 的限制,用户需要通过 Maven 依赖的形式引入 Metadata Repository 的 JSON 文件。 +参考 https://github.com/graalvm/native-build-tools/issues/572 。 + +```groovy +plugins { + id 'org.springframework.boot' version '3.3.2' + id 'io.spring.dependency-management' version '1.1.6' + id 'org.graalvm.buildtools.native' version '0.10.2' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-jdbc' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter:${elasticjob.version}' + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') +} + +graalvmNative { + metadataRepository { + enabled.set(false) + } +} +``` + + ## 对于 sbt 等不被 GraalVM Native Build Tools 支持的构建工具 此类需求需要在 https://github.com/graalvm/native-build-tools 打开额外的 issue 并提供对应构建工具的 Plugin 实现。 @@ -128,8 +229,6 @@ public class ExampleUtils { 4. ElasticJob 的 Spring 命名空间集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` 尚未在 GraalVM Native Image 下可用。 -5. ElasticJob 的 Spring Boot Starter 集成模块 `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` 尚未在 GraalVM Native Image 下可用。 - ## 贡献 GraalVM Reachability Metadata ElasticJob 对在 GraalVM Native Image 下的可用性的验证,是通过 GraalVM Native Build Tools 的 Maven Plugin 子项目来完成的。 @@ -157,7 +256,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere-elasticjob.git cd ./shardingsphere-elasticjob/ -./mvnw -PnativeTestInElasticJob -T1C -e clean test +./mvnw -PnativeTestInElasticJob -T1C -e -Dspring-boot-dependencies.version=3.3.2 clean test ``` 当贡献者发现缺少与 ElasticJob 无关的第三方库的 GraalVM Reachability Metadata 时,应当在 @@ -186,5 +285,5 @@ ElasticJob 定义了 `generateMetadata` 的 Maven Profile 用于在 GraalVM JIT ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C -Dspring-boot-dependencies.version=3.3.2 clean test native:metadata-copy ``` diff --git a/docs/content/user-manual/configuration/graalvm-native-image.en.md b/docs/content/user-manual/configuration/graalvm-native-image.en.md index 513a58a851..fb86d608e0 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.en.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.en.md @@ -93,6 +93,107 @@ graalvmNative { } ``` +## Using ElasticJob's Spring Boot Starter + +### Maven Ecosystem + +Users need to actively use the GraalVM Reachability Metadata Central Repository. +The following configuration is for reference. +To configure additional Maven Profiles for the project, refer to the documentation of GraalVM Native Build Tools. + +```xml + + + + org.apache.shardingsphere.elasticjob + elasticjob-spring-boot-starter + ${elasticjob.version} + test + + + org.springframework.boot + spring-boot-starter-jdbc + 3.3.2 + test + + + org.springframework.boot + spring-boot-starter-web + 3.3.2 + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + 0.10.2 + true + + + build-native + + compile-no-fork + + package + + + test-native + + test + + test + + + + + org.springframework.boot + spring-boot-maven-plugin + 3.3.2 + + + process-test-aot + + process-test-aot + + + + + + + +``` + +### Gradle Ecosystem + +Users need to actively use the GraalVM Reachability Metadata Central Repository. +The following configuration is for reference. To configure additional Gradle Tasks for the project, refer to the documentation of GraalVM Native Build Tools. +Due to the limitations of https://github.com/gradle/gradle/issues/17559, users need to introduce the Metadata Repository JSON file in the form of Maven dependencies. +Refer to https://github.com/graalvm/native-build-tools/issues/572 . + +```groovy +plugins { + id 'org.springframework.boot' version '3.3.2' + id 'io.spring.dependency-management' version '1.1.6' + id 'org.graalvm.buildtools.native' version '0.10.2' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-jdbc' + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter:${elasticjob.version}' + implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.2', classifier: 'repository', ext: 'zip') +} + +graalvmNative { + metadataRepository { + enabled.set(false) + } +} +``` + ## For build tools such as sbt that are not supported by GraalVM Native Build Tools Such requirements require opening additional issues at https://github.com/graalvm/native-build-tools and providing plugin implementations for the corresponding build tools. @@ -130,8 +231,6 @@ public class ExampleUtils { 4. The Spring namespace integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-namespace` of ElasticJob is not yet available under GraalVM Native Image. -5. The Spring Boot Starter integration module `org.apache.shardingsphere.elasticjob:elasticjob-spring-boot-starter` for ElasticJob is not yet available under GraalVM Native Image. - ## Contribute GraalVM Reachability Metadata ElasticJob's usability verification under GraalVM Native Image is done by the Maven Plugin subproject of GraalVM Native Build Tools. @@ -160,7 +259,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere-elasticjob.git cd ./shardingsphere-elasticjob/ -./mvnw -PnativeTestInElasticJob -T1C -e clean test +./mvnw -PnativeTestInElasticJob -T1C -e -Dspring-boot-dependencies.version=3.3.2 clean test ``` When contributors find that GraalVM Reachability Metadata for third-party libraries not related to ElasticJob is missing, @@ -190,5 +289,5 @@ contributors should place it in the classpath of the shardingsphere-test-native ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C -Dspring-boot-dependencies.version=3.3.2 clean test native:metadata-copy ``` diff --git a/pom.xml b/pom.xml index 15a3aa9ca4..4bc966d9de 100644 --- a/pom.xml +++ b/pom.xml @@ -93,6 +93,8 @@ 2.2.224 4.0.3 + 2.7.18 + 3.2.1 3.11.0 @@ -755,13 +757,16 @@ [11,) + + 8 + maven-surefire-plugin - @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED + @{argLine} --add-opens java.base/java.lang.reflect=ALL-UNNAMED @@ -1015,6 +1020,19 @@ + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot-dependencies.version} + + + process-test-aot + + process-test-aot + + + + diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json index fd2d4325f4..25cf820544 100644 --- a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/proxy-config.json @@ -1,6 +1,6 @@ [ { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConfigurationConverter"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.tracing.ElasticJobTracingConfiguration$RDBTracingConfiguration"}, "interfaces":["java.sql.Connection"] } ] \ No newline at end of file diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json index b934e85204..5dfc6c97c4 100644 --- a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json @@ -4,9 +4,8 @@ "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, - "name":"java.util.Properties", - "methods":[{"name":"","parameterTypes":[] }] + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.tracing.ElasticJobTracingConfiguration$RDBTracingConfiguration"}, + "name":"[Ljava.sql.Statement;" }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, @@ -23,6 +22,11 @@ "name":"java.util.Properties", "methods":[{"name":"","parameterTypes":[] }] }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ListenServersChangedJobListener"}, + "name":"java.util.Properties", + "methods":[{"name":"","parameterTypes":[] }] +}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ShardingTotalCountChangedJobListener"}, "name":"java.util.Properties", @@ -48,7 +52,7 @@ "methods":[{"name":"","parameterTypes":[] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.http.executor.HttpJobExecutor" }, { @@ -59,21 +63,15 @@ "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader"}, "name":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.type.SingleThreadJobExecutorThreadPoolSizeProvider" }, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap"}, - "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", - "queryAllPublicMethods":true -}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", - "queryAllPublicMethods":true, - "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }] }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", - "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] + "methods":[{"name":"setProps","parameterTypes":["java.util.Properties"] }] }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine"}, @@ -98,15 +96,20 @@ "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ListenServersChangedJobListener"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", - "queryAllPublicMethods":true + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ShardingTotalCountChangedJobListener"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "queryAllPublicMethods":true +}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJOBeanInfo" @@ -115,22 +118,20 @@ "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJOCustomizer" }, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap"}, - "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin", - "queryAllPublicMethods":true -}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, - "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin", - "queryAllPublicMethods":true + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin" }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin", - "queryAllPublicMethods":true, "methods":[{"name":"","parameterTypes":[] }, {"name":"setCleanShutdown","parameterTypes":["boolean"] }] }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPlugin", + "queryAllPublicMethods":true +}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPluginBeanInfo" @@ -139,15 +140,9 @@ "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobShutdownHookPluginCustomizer" }, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap"}, - "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", - "queryAllPublicMethods":true -}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, - "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", - "queryAllPublicMethods":true + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance" }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceNode"}, @@ -156,18 +151,10 @@ "methods":[{"name":"getJobInstanceId","parameterTypes":[] }, {"name":"getLabels","parameterTypes":[] }, {"name":"getServerIp","parameterTypes":[] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService"}, - "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance" -}, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.JobScheduler"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", "queryAllPublicMethods":true }, -{ - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.setup.SetUpFacade"}, - "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance" -}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstanceBeanInfo" @@ -191,7 +178,7 @@ "name":"org.apache.shardingsphere.elasticjob.reg.zookeeper.exception.ZookeeperCuratorIgnoredExceptionProvider" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.script.executor.ScriptJobExecutor" }, { @@ -199,17 +186,21 @@ "name":"org.apache.shardingsphere.elasticjob.simple.executor.SimpleJobExecutor" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListener", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory"}, + "name":"org.apache.shardingsphere.elasticjob.spring.core.setup.SpringProxyJobClassNameProvider" +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListener", "queryAllDeclaredMethods":true }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerFactory" }, { diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json index 101e57e2fc..07292ac065 100644 --- a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json @@ -1,6 +1,9 @@ { "resources":{ "includes":[{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.tracing.ElasticJobTracingConfiguration$RDBTracingConfiguration"}, + "pattern":"\\QMETA-INF/services/java.sql.Driver\\E" + }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.ExecutorServiceReloader"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.kernel.executor.threadpool.JobExecutorThreadPoolSizeProvider\\E" }, { @@ -10,16 +13,16 @@ "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider\\E" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.error.handler.JobErrorHandler\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.item.JobItemExecutorFactory"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.ClassedJobItemExecutor\\E" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.executor.item.type.TypedJobItemExecutor\\E" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.event.JobTracingEventBus"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.spi.tracing.listener.TracingListenerFactory\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.storage.TracingStorageConverterFactory"}, @@ -34,7 +37,10 @@ "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.sql.SQLPropertiesFactory"}, "pattern":"\\QMETA-INF/sql/H2.properties\\E" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.tracing.ElasticJobTracingConfiguration$RDBTracingConfiguration"}, + "pattern":"\\Qorg/h2/util/data.zip\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "pattern":"\\Qorg/quartz/core/quartz-build.properties\\E" }]}, "bundles":[] diff --git a/spring/pom.xml b/spring/pom.xml index 6198458281..1ffaaa3039 100644 --- a/spring/pom.xml +++ b/spring/pom.xml @@ -34,7 +34,6 @@ - 2.7.18 1.9.22.1 @@ -43,7 +42,7 @@ org.springframework.boot spring-boot-dependencies - ${springboot.version} + ${spring-boot-dependencies.version} pom import diff --git a/test/native/native-image-filter/extra-filter.json b/test/native/native-image-filter/extra-filter.json index 9e706a39d4..dacbc34689 100644 --- a/test/native/native-image-filter/extra-filter.json +++ b/test/native/native-image-filter/extra-filter.json @@ -2,13 +2,13 @@ "rules": [ {"includeClasses": "**"}, - {"excludeClasses": "com.google.common.util.concurrent.**"}, - {"excludeClasses": "com.zaxxer.hikari.**"}, + {"excludeClasses": "com.**"}, {"excludeClasses": "java.**"}, {"includeClasses": "java.util.Properties"}, - {"excludeClasses": "org.apache.zookeeper.**"}, - {"excludeClasses": "org.quartz.**"}, - {"excludeClasses": "sun.misc.**"}, + {"excludeClasses": "javax.**"}, + {"excludeClasses": "org.**"}, + {"includeClasses": "org.apache.shardingsphere.elasticjob.**"}, + {"excludeClasses": "sun.**"}, {"excludeClasses": "org.apache.shardingsphere.elasticjob.test.natived.**"} ], diff --git a/test/native/pom.xml b/test/native/pom.xml index 459222a528..00cca3bddd 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -28,12 +28,15 @@ true + + 2.0.13 + 1.5.6 org.apache.shardingsphere.elasticjob - elasticjob-bootstrap + elasticjob-spring-boot-starter ${project.version} test @@ -53,6 +56,24 @@ curator-test test + + org.springframework.boot + spring-boot-starter-jdbc + ${spring-boot-dependencies.version} + test + + + org.springframework.boot + spring-boot-starter-web + ${spring-boot-dependencies.version} + test + + + org.springframework.boot + spring-boot-starter-test + ${spring-boot-dependencies.version} + test + @@ -62,6 +83,11 @@ native-maven-plugin ${native-maven-plugin.version} + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot-dependencies.version} + diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java new file mode 100644 index 0000000000..b704787964 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/TestMain.java @@ -0,0 +1,31 @@ +/* + * 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.elasticjob.test.natived; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class TestMain { + + // CHECKSTYLE:OFF + public static void main(final String[] args) { + // CHECKSTYLE:ON + SpringApplication.run(TestMain.class, args); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/controller/OneOffJobController.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/controller/OneOffJobController.java new file mode 100644 index 0000000000..64db2f93a0 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/controller/OneOffJobController.java @@ -0,0 +1,50 @@ +/* + * 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.elasticjob.test.natived.commons.controller; + +import org.apache.shardingsphere.elasticjob.bootstrap.type.OneOffJobBootstrap; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Objects; + +@RestController +public class OneOffJobController { + + @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") + @Autowired + @Qualifier("manualScriptJobBean") + private ObjectProvider manualScriptJobProvider; + + /** + * Execute manual script job. + * + * @return a String + */ + @GetMapping("/execute/manualScriptJob") + public String executeManualScriptJob() { + OneOffJobBootstrap manualScriptJob = manualScriptJobProvider.getIfAvailable(); + Objects.requireNonNull(manualScriptJob); + manualScriptJob.execute(); + manualScriptJob.shutdown(); + return "{\"msg\":\"OK\"}"; + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java new file mode 100644 index 0000000000..992ca14dca --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java @@ -0,0 +1,62 @@ +/* + * 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.elasticjob.test.natived.commons.job.dataflow; + +import org.apache.shardingsphere.elasticjob.dataflow.job.DataflowJob; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.test.natived.commons.entity.Foo; +import org.apache.shardingsphere.elasticjob.test.natived.commons.repository.SpringBootFooRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.lang.invoke.MethodHandles; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +@SuppressWarnings("LoggingSimilarMessage") +@Component +public class SpringBootDataflowJob implements DataflowJob { + + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + @Autowired + private SpringBootFooRepository springBootFooRepository; + + @Override + public List fetchData(final ShardingContext shardingContext) { + logger.info("Item: {} | Time: {} | Thread: {} | {}", + shardingContext.getShardingItem(), + new SimpleDateFormat("HH:mm:ss").format(new Date()), + Thread.currentThread().getId(), + "DATAFLOW FETCH"); + return springBootFooRepository.findTodoData(shardingContext.getShardingParameter(), 10); + } + + @Override + public void processData(final ShardingContext shardingContext, final List data) { + logger.info("Item: {} | Time: {} | Thread: {} | {}", + shardingContext.getShardingItem(), + new SimpleDateFormat("HH:mm:ss").format(new Date()), + Thread.currentThread().getId(), + "DATAFLOW PROCESS"); + data.forEach(each -> springBootFooRepository.setCompleted(each.getId())); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java new file mode 100644 index 0000000000..1185636d26 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java @@ -0,0 +1,51 @@ +/* + * 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.elasticjob.test.natived.commons.job.simple; + +import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob; +import org.apache.shardingsphere.elasticjob.spi.executor.item.param.ShardingContext; +import org.apache.shardingsphere.elasticjob.test.natived.commons.repository.SpringBootFooRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.lang.invoke.MethodHandles; +import java.text.SimpleDateFormat; +import java.util.Date; + +@Component +public class SpringBootSimpleJob implements SimpleJob { + + private final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + + @Autowired + private SpringBootFooRepository springBootFooRepository; + + @Override + public void execute(final ShardingContext shardingContext) { + logger.info( + "Item: {} | Time: {} | Thread: {} | {}", + shardingContext.getShardingItem(), + new SimpleDateFormat("HH:mm:ss").format(new Date()), + Thread.currentThread().getId(), + "SIMPLE"); + springBootFooRepository.findTodoData(shardingContext.getShardingParameter(), 10) + .forEach(each -> springBootFooRepository.setCompleted(each.getId())); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java new file mode 100644 index 0000000000..cafe2bb023 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java @@ -0,0 +1,74 @@ +/* + * 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.elasticjob.test.natived.commons.repository; + +import org.apache.shardingsphere.elasticjob.test.natived.commons.entity.Foo; +import org.springframework.stereotype.Repository; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.LongStream; + +@Repository +public class SpringBootFooRepository { + + private final Map data = new ConcurrentHashMap<>(300, 1); + + public SpringBootFooRepository() { + addData(0L, 100L, "Beijing"); + addData(100L, 200L, "Shanghai"); + addData(200L, 300L, "Guangzhou"); + } + + private void addData(final long idFrom, final long idTo, final String location) { + LongStream.range(idFrom, idTo) + .forEachOrdered(i -> data.put(i, new Foo(i, location, Foo.Status.TODO))); + } + + /** + * Find todoData. + * @param location location + * @param limit limit + * @return An ordered collection, where the user has precise control over where in the list each element is inserted. + */ + public List findTodoData(final String location, final int limit) { + List result = new ArrayList<>(limit); + int count = 0; + for (Map.Entry each : data.entrySet()) { + Foo foo = each.getValue(); + if (foo.getLocation().equals(location) && foo.getStatus() == Foo.Status.TODO) { + result.add(foo); + count++; + if (count == limit) { + break; + } + } + } + return result; + } + + /** + * Set completed. + * @param id id + */ + public void setCompleted(final long id) { + data.get(id).setStatus(Foo.Status.COMPLETED); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/JavaTest.java similarity index 98% rename from test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java rename to test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/JavaTest.java index 8b8212854c..bb4e91163d 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/JavaTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/JavaTest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.shardingsphere.elasticjob.test.natived; +package org.apache.shardingsphere.elasticjob.test.natived.it.staticd; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; @@ -75,7 +75,7 @@ static void beforeAll() throws Exception { 60 * 1000, 500, null, new ExponentialBackoffRetry(500, 3, 500 * 3))) { client.start(); - Awaitility.await().atMost(Duration.ofMillis(500 * 60)).until(client::isConnected); + Awaitility.await().atMost(Duration.ofMillis(500 * 60)).ignoreExceptions().until(client::isConnected); } regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); regCenter.init(); diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/SpirngBootTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/SpirngBootTest.java new file mode 100644 index 0000000000..c07a635ea7 --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/SpirngBootTest.java @@ -0,0 +1,106 @@ +/* + * 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.elasticjob.test.natived.it.staticd; + +import org.apache.curator.CuratorZookeeperClient; +import org.apache.curator.retry.ExponentialBackoffRetry; +import org.apache.curator.test.InstanceSpec; +import org.apache.curator.test.TestingServer; +import org.awaitility.Awaitility; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledInNativeImage; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.DynamicPropertyRegistry; +import org.springframework.test.context.DynamicPropertySource; +import org.springframework.test.web.servlet.MockMvc; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import org.springframework.test.web.servlet.result.MockMvcResultHandlers; +import org.springframework.test.web.servlet.result.MockMvcResultMatchers; +import org.springframework.test.web.servlet.setup.MockMvcBuilders; +import org.springframework.web.context.WebApplicationContext; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.Duration; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@EnabledInNativeImage +class SpirngBootTest { + + private static TestingServer testingServer; + + private MockMvc mockMvc; + + @DynamicPropertySource + static void elasticjobProperties(final DynamicPropertyRegistry registry) { + registry.add("elasticjob.regCenter.serverLists", () -> testingServer.getConnectString()); + registry.add("elasticjob.dump.port", InstanceSpec::getRandomPort); + } + + @BeforeAll + static void beforeAll() throws Exception { + testingServer = new TestingServer(6181); + try ( + CuratorZookeeperClient client = new CuratorZookeeperClient(testingServer.getConnectString(), + 60 * 1000, 500, null, + new ExponentialBackoffRetry(500, 3, 500 * 3))) { + client.start(); + Awaitility.await().atMost(Duration.ofMillis(500 * 60)).ignoreExceptions().until(client::isConnected); + } + } + + @AfterAll + static void afterAll() throws IOException { + testingServer.close(); + } + + @BeforeEach + void setup(final WebApplicationContext webApplicationContext) { + this.mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext) + .defaultResponseCharacterEncoding(StandardCharsets.UTF_8) + .build(); + } + + /** + * ElasticJob Spring Boot Starter requires that all Spring Boot Applications be shut down before shutting down Zookeeper Server. + * That's why this unit test uses {@link DirtiesContext}. + * Refer to spring-projects/spring-framework#26196 . + */ + @DirtiesContext + @Test + public void testOneOffJob() throws Exception { + String contentAsString = mockMvc.perform( + MockMvcRequestBuilders.get("/execute/manualScriptJob") + .characterEncoding(StandardCharsets.UTF_8)) + .andDo(MockMvcResultHandlers.print()) + .andExpectAll( + MockMvcResultMatchers.status().isOk(), + MockMvcResultMatchers.content().encoding(StandardCharsets.UTF_8)) + .andReturn() + .getResponse() + .getContentAsString(); + assertThat(contentAsString, is("{\"msg\":\"OK\"}")); + } +} diff --git a/test/native/src/test/resources/application.yml b/test/native/src/test/resources/application.yml new file mode 100644 index 0000000000..60e9626158 --- /dev/null +++ b/test/native/src/test/resources/application.yml @@ -0,0 +1,52 @@ +# +# 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. +# + +# `elasticjob.regCenter.serverLists` is dynamically defined in `org.apache.shardingsphere.elasticjob.test.natived.SpirngBootTest` +# `elasticjob.dump.port` is dynamically defined in `org.apache.shardingsphere.elasticjob.test.natived.SpirngBootTest` +elasticjob: + tracing: + type: RDB + data-source: + url: jdbc:h2:mem:job_event_storage + driver-class-name: org.h2.Driver + username: sa + password: + regCenter: + namespace: elasticjob-springboot + jobs: + simpleJob: + elasticJobClass: org.apache.shardingsphere.elasticjob.test.natived.commons.job.simple.SpringBootSimpleJob + cron: 0/5 * * * * ? + shardingTotalCount: 3 + shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou + dataflowJob: + elasticJobClass: org.apache.shardingsphere.elasticjob.test.natived.commons.job.dataflow.SpringBootDataflowJob + cron: 0/5 * * * * ? + shardingTotalCount: 3 + shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou + scriptJob: + elasticJobType: SCRIPT + cron: 0/10 * * * * ? + shardingTotalCount: 3 + props: + script.command.line: "echo SCRIPT Job: " + manualScriptJob: + elasticJobType: SCRIPT + jobBootstrapBeanName: manualScriptJobBean + shardingTotalCount: 9 + props: + script.command.line: "echo Manual SCRIPT Job: " From 08031cd7b47e9cc3b067d2bcf98318335d8cafe5 Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Sun, 11 Aug 2024 18:17:09 +0800 Subject: [PATCH 177/178] Add nativeTest for dynamically configuring jobs through Operation API in GraalVM Native Image (#2426) --- .../usage/operation-api/_index.cn.md | 22 +- .../usage/operation-api/_index.en.md | 22 +- .../reflect-config.json | 6 + .../reflect-config.json | 170 +++++++++- .../resource-config.json | 3 + .../hamcrest/2.2/reflect-config.json | 12 + test/native/pom.xml | 7 +- .../test/natived/commons/entity/Foo.java | 2 +- .../commons/job/dataflow/JavaDataflowJob.java | 2 +- .../job/dataflow/SpringBootDataflowJob.java | 2 +- .../commons/job/simple/JavaSimpleJob.java | 2 +- .../job/simple/SpringBootSimpleJob.java | 2 +- .../commons/repository/FooRepository.java | 8 +- .../repository/SpringBootFooRepository.java | 14 +- .../test/natived/it/operation/JavaTest.java | 306 ++++++++++++++++++ .../test/natived/it/staticd/JavaTest.java | 9 - .../native/src/test/resources/application.yml | 10 +- 17 files changed, 554 insertions(+), 45 deletions(-) create mode 100644 reachability-metadata/src/main/resources/META-INF/native-image/org.hamcrest/hamcrest/2.2/reflect-config.json create mode 100644 test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java diff --git a/docs/content/user-manual/usage/operation-api/_index.cn.md b/docs/content/user-manual/usage/operation-api/_index.cn.md index 4cae0e2d22..c74e94b3d7 100644 --- a/docs/content/user-manual/usage/operation-api/_index.cn.md +++ b/docs/content/user-manual/usage/operation-api/_index.cn.md @@ -6,7 +6,15 @@ chapter = true ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的方式控制作业在分布式环境下的生命周期。 -该模块目前仍处于孵化状态。 +该模块目前仍处于孵化状态。可能的依赖配置如下, + +```xml + + org.apache.shardingsphere.elasticjob + elasticjob-lifecycle + ${elasticjob.version} + +``` ## 配置类 API @@ -43,11 +51,10 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 作业在不与当前运行中作业冲突的情况下才会触发执行,并在启动后自动清理此标记。 -方法签名:void trigger(Optional jobName, Optional serverIp) +方法签名:void trigger(Optional jobName) * **Parameters:** * jobName — 作业名称 - * serverIp — 作业服务器IP地址 ### 禁用作业 @@ -83,6 +90,15 @@ ElasticJob 提供了 Java API,可以通过直接对注册中心进行操作的 * jobName — 作业名称 * serverIp — 作业服务器IP地址 +### Dump 作业 + +方法签名:String dump(String jobName, String instanceIp, int dumpPort) + +* **Parameters:** + * jobName — 作业名称 + * serverIp — 作业服务器IP地址 + * dumpPort — Dump port + ## 操作分片的 API 类名称:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI` diff --git a/docs/content/user-manual/usage/operation-api/_index.en.md b/docs/content/user-manual/usage/operation-api/_index.en.md index 846fe21379..3919ac9bbd 100644 --- a/docs/content/user-manual/usage/operation-api/_index.en.md +++ b/docs/content/user-manual/usage/operation-api/_index.en.md @@ -6,7 +6,15 @@ chapter = true ElasticJob provides a Java API, which can control the life cycle of jobs in a distributed environment by directly operating the registry. -The module is still in incubation. +The module is still in incubation. Possible dependency configurations are as follows, + +```xml + + org.apache.shardingsphere.elasticjob + elasticjob-lifecycle + ${elasticjob.version} + +``` ## Configuration API @@ -43,11 +51,10 @@ Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI` The job will only trigger execution if it does not conflict with the currently running job, and this flag will be automatically cleared after it is started. -Method signature:void trigger(Optional jobName, Optional serverIp) +Method signature:void trigger(Optional jobName) * **Parameters:** * jobName — Job name - * serverIp — IP address of the job server ### Disable job @@ -83,6 +90,15 @@ Method signature:void remove(Optional jobName, Optional server * jobName — Job name * serverIp — IP address of the job server +### Dump job + +Method signature:String dump(String jobName, String instanceIp, int dumpPort) + +* **Parameters:** + * jobName — Job name + * serverIp — IP address of the job server + * dumpPort — Dump port + ## Operate sharding API Class name:`org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI` diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json index cb28c8e584..33aa26038b 100644 --- a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/elasticjob-reachability-metadata/reflect-config.json @@ -3,5 +3,11 @@ "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", "allPublicMethods":true +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.LiteJob"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.schedule.LiteJob", + "allDeclaredMethods": true, + "allDeclaredConstructors": true } ] diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json index 5dfc6c97c4..5681355f1c 100644 --- a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/reflect-config.json @@ -3,6 +3,10 @@ "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.converter.RDBTracingStorageConfigurationConverter"}, "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.repository.RDBJobEventRepository"}, + "name":"[Lcom.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry;" +}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.tracing.ElasticJobTracingConfiguration$RDBTracingConfiguration"}, "name":"[Ljava.sql.Statement;" @@ -71,30 +75,51 @@ { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.ElasticJobExecutor"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", - "methods":[{"name":"setProps","parameterTypes":["java.util.Properties"] }] + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.executor.facade.JobFacade"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", - "allDeclaredFields":true, - "methods":[{"name":"","parameterTypes":[] }, {"name":"setDescription","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setJobParameter","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }] }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", "allDeclaredFields":true, - "methods":[{"name":"getCron","parameterTypes":[] }, {"name":"getDescription","parameterTypes":[] }, {"name":"getJobErrorHandlerType","parameterTypes":[] }, {"name":"getJobExecutorThreadPoolSizeProviderType","parameterTypes":[] }, {"name":"getJobExtraConfigurations","parameterTypes":[] }, {"name":"getJobListenerTypes","parameterTypes":[] }, {"name":"getJobName","parameterTypes":[] }, {"name":"getJobParameter","parameterTypes":[] }, {"name":"getJobShardingStrategyType","parameterTypes":[] }, {"name":"getLabel","parameterTypes":[] }, {"name":"getMaxTimeDiffSeconds","parameterTypes":[] }, {"name":"getProps","parameterTypes":[] }, {"name":"getReconcileIntervalMinutes","parameterTypes":[] }, {"name":"getShardingItemParameters","parameterTypes":[] }, {"name":"getShardingTotalCount","parameterTypes":[] }, {"name":"getTimeZone","parameterTypes":[] }, {"name":"isDisabled","parameterTypes":[] }, {"name":"isFailover","parameterTypes":[] }, {"name":"isMisfire","parameterTypes":[] }, {"name":"isMonitorExecution","parameterTypes":[] }, {"name":"isOverwrite","parameterTypes":[] }, {"name":"isStaticSharding","parameterTypes":[] }] + "methods":[{"name":"","parameterTypes":[] }, {"name":"getCron","parameterTypes":[] }, {"name":"getDescription","parameterTypes":[] }, {"name":"getJobErrorHandlerType","parameterTypes":[] }, {"name":"getJobExecutorThreadPoolSizeProviderType","parameterTypes":[] }, {"name":"getJobExtraConfigurations","parameterTypes":[] }, {"name":"getJobListenerTypes","parameterTypes":[] }, {"name":"getJobName","parameterTypes":[] }, {"name":"getJobParameter","parameterTypes":[] }, {"name":"getJobShardingStrategyType","parameterTypes":[] }, {"name":"getLabel","parameterTypes":[] }, {"name":"getMaxTimeDiffSeconds","parameterTypes":[] }, {"name":"getProps","parameterTypes":[] }, {"name":"getReconcileIntervalMinutes","parameterTypes":[] }, {"name":"getShardingItemParameters","parameterTypes":[] }, {"name":"getShardingTotalCount","parameterTypes":[] }, {"name":"getTimeZone","parameterTypes":[] }, {"name":"isDisabled","parameterTypes":[] }, {"name":"isFailover","parameterTypes":[] }, {"name":"isMisfire","parameterTypes":[] }, {"name":"isMonitorExecution","parameterTypes":[] }, {"name":"isOverwrite","parameterTypes":[] }, {"name":"isStaticSharding","parameterTypes":[] }, {"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setDescription","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setJobParameter","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager$FailoverSettingsChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] +}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.reconcile.ReconcileService"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionContextService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ExecutionService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.MonitorExecutionListenerManager$MonitorExecutionSettingsChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] +}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ListenServersChangedJobListener"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", @@ -103,7 +128,25 @@ { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ShardingTotalCountChangedJobListener"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", - "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }] + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setDescription","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setJobParameter","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setProps","parameterTypes":["java.util.Properties"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "methods":[{"name":"setCron","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.settings.JobConfigurationAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"getCron","parameterTypes":[] }, {"name":"getDescription","parameterTypes":[] }, {"name":"getJobErrorHandlerType","parameterTypes":[] }, {"name":"getJobExecutorThreadPoolSizeProviderType","parameterTypes":[] }, {"name":"getJobExtraConfigurations","parameterTypes":[] }, {"name":"getJobListenerTypes","parameterTypes":[] }, {"name":"getJobName","parameterTypes":[] }, {"name":"getJobParameter","parameterTypes":[] }, {"name":"getJobShardingStrategyType","parameterTypes":[] }, {"name":"getLabel","parameterTypes":[] }, {"name":"getMaxTimeDiffSeconds","parameterTypes":[] }, {"name":"getProps","parameterTypes":[] }, {"name":"getReconcileIntervalMinutes","parameterTypes":[] }, {"name":"getShardingItemParameters","parameterTypes":[] }, {"name":"getShardingTotalCount","parameterTypes":[] }, {"name":"getTimeZone","parameterTypes":[] }, {"name":"isDisabled","parameterTypes":[] }, {"name":"isFailover","parameterTypes":[] }, {"name":"isMisfire","parameterTypes":[] }, {"name":"isMonitorExecution","parameterTypes":[] }, {"name":"isOverwrite","parameterTypes":[] }, {"name":"isStaticSharding","parameterTypes":[] }, {"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setDescription","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setJobParameter","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.JobStatisticsAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setCron","parameterTypes":["java.lang.String"] }, {"name":"setDescription","parameterTypes":["java.lang.String"] }, {"name":"setDisabled","parameterTypes":["boolean"] }, {"name":"setFailover","parameterTypes":["boolean"] }, {"name":"setJobExtraConfigurations","parameterTypes":["java.util.Collection"] }, {"name":"setJobName","parameterTypes":["java.lang.String"] }, {"name":"setJobParameter","parameterTypes":["java.lang.String"] }, {"name":"setMaxTimeDiffSeconds","parameterTypes":["int"] }, {"name":"setMisfire","parameterTypes":["boolean"] }, {"name":"setMonitorExecution","parameterTypes":["boolean"] }, {"name":"setOverwrite","parameterTypes":["boolean"] }, {"name":"setReconcileIntervalMinutes","parameterTypes":["int"] }, {"name":"setShardingItemParameters","parameterTypes":["java.lang.String"] }, {"name":"setShardingTotalCount","parameterTypes":["int"] }, {"name":"setStaticSharding","parameterTypes":["boolean"] }] }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, @@ -150,6 +193,42 @@ "allDeclaredFields":true, "methods":[{"name":"getJobInstanceId","parameterTypes":[] }, {"name":"getLabels","parameterTypes":[] }, {"name":"getServerIp","parameterTypes":[] }] }, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.instance.InstanceService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setJobInstanceId","parameterTypes":["java.lang.String"] }, {"name":"setServerIp","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setJobInstanceId","parameterTypes":["java.lang.String"] }, {"name":"setServerIp","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.operate.JobOperateAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setJobInstanceId","parameterTypes":["java.lang.String"] }, {"name":"setServerIp","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.JobStatisticsAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setJobInstanceId","parameterTypes":["java.lang.String"] }, {"name":"setServerIp","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.ServerStatisticsAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setJobInstanceId","parameterTypes":["java.lang.String"] }, {"name":"setServerIp","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.ShardingStatisticsAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setJobInstanceId","parameterTypes":["java.lang.String"] }, {"name":"setServerIp","parameterTypes":["java.lang.String"] }] +}, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.spring.boot.job.ElasticJobBootstrapConfiguration"}, "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstance", @@ -164,7 +243,52 @@ "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.JobInstanceCustomizer" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type.AverageAllocationJobShardingStrategy", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type.OdevitySortByNameJobShardingStrategy", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.type.RoundRobinByNameJobShardingStrategy", + "methods":[{"name":"","parameterTypes":[] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setTracingStorageConfiguration","parameterTypes":["org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager$FailoverSettingsChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setTracingStorageConfiguration","parameterTypes":["org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.MonitorExecutionListenerManager$MonitorExecutionSettingsChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setTracingStorageConfiguration","parameterTypes":["org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ShardingTotalCountChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setTracingStorageConfiguration","parameterTypes":["org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.settings.JobConfigurationAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setTracingStorageConfiguration","parameterTypes":["org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.JobStatisticsAPIImpl"}, "name":"org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingConfiguration", "allDeclaredFields":true, "methods":[{"name":"","parameterTypes":[] }, {"name":"setTracingStorageConfiguration","parameterTypes":["org.apache.shardingsphere.elasticjob.kernel.tracing.yaml.YamlTracingStorageConfiguration"] }, {"name":"setType","parameterTypes":["java.lang.String"] }] @@ -232,7 +356,37 @@ "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.storage.type.impl.SQLServerTracingStorageDatabaseType" }, { - "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.infra.yaml.YamlEngine"}, + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.config.ConfigurationService"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Map"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.failover.FailoverListenerManager$FailoverSettingsChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Map"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.MonitorExecutionListenerManager$MonitorExecutionSettingsChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Map"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingListenerManager$ShardingTotalCountChangedJobListener"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Map"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.settings.JobConfigurationAPIImpl"}, + "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration", + "allDeclaredFields":true, + "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Map"] }] +}, +{ + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.JobStatisticsAPIImpl"}, "name":"org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration", "allDeclaredFields":true, "methods":[{"name":"","parameterTypes":[] }, {"name":"setDataSourceClassName","parameterTypes":["java.lang.String"] }, {"name":"setProps","parameterTypes":["java.util.Map"] }] diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json index 07292ac065..7fe2417552 100644 --- a/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere.elasticjob/generated-reachability-metadata/resource-config.json @@ -9,6 +9,9 @@ }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProviderFactory"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.setup.JobClassNameProvider\\E" + }, { + "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.kernel.internal.sharding.ShardingService"}, + "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.kernel.internal.sharding.strategy.JobShardingStrategy\\E" }, { "condition":{"typeReachable":"org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler"}, "pattern":"\\QMETA-INF/services/org.apache.shardingsphere.elasticjob.reg.exception.IgnoredExceptionProvider\\E" diff --git a/reachability-metadata/src/main/resources/META-INF/native-image/org.hamcrest/hamcrest/2.2/reflect-config.json b/reachability-metadata/src/main/resources/META-INF/native-image/org.hamcrest/hamcrest/2.2/reflect-config.json new file mode 100644 index 0000000000..0f9e3726d5 --- /dev/null +++ b/reachability-metadata/src/main/resources/META-INF/native-image/org.hamcrest/hamcrest/2.2/reflect-config.json @@ -0,0 +1,12 @@ +[ +{ + "condition":{"typeReachable":"org.hamcrest.internal.ReflectiveTypeFinder"}, + "name":"org.hamcrest.core.StringStartsWith", + "queryAllDeclaredMethods":true +}, +{ + "condition":{"typeReachable":"org.hamcrest.internal.ReflectiveTypeFinder"}, + "name":"org.hamcrest.core.SubstringMatcher", + "queryAllDeclaredMethods":true +} +] diff --git a/test/native/pom.xml b/test/native/pom.xml index 00cca3bddd..1370b8b48b 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -40,7 +40,12 @@ ${project.version} test - + + org.apache.shardingsphere.elasticjob + elasticjob-lifecycle + ${project.version} + test + org.awaitility awaitility diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java index 7fb818cd65..b498f1e158 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/entity/Foo.java @@ -39,7 +39,7 @@ public final class Foo implements Serializable { private Status status; public enum Status { - TODO, + UNFINISHED, COMPLETED } } diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.java index 7c87dffacc..1b3a69431a 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/JavaDataflowJob.java @@ -39,7 +39,7 @@ public List fetchData(final ShardingContext shardingContext) { new SimpleDateFormat("HH:mm:ss").format(new Date()), Thread.currentThread().getId(), "DATAFLOW FETCH"); - return fooRepository.findTodoData(shardingContext.getShardingParameter(), 10); + return fooRepository.findUnfinishedData(shardingContext.getShardingParameter(), 10); } @Override diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java index 992ca14dca..1f77bba898 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/dataflow/SpringBootDataflowJob.java @@ -47,7 +47,7 @@ public List fetchData(final ShardingContext shardingContext) { new SimpleDateFormat("HH:mm:ss").format(new Date()), Thread.currentThread().getId(), "DATAFLOW FETCH"); - return springBootFooRepository.findTodoData(shardingContext.getShardingParameter(), 10); + return springBootFooRepository.findUnfinishedData(shardingContext.getShardingParameter(), 10); } @Override diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java index 0932a700bc..58978416c3 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/JavaSimpleJob.java @@ -39,7 +39,7 @@ public void execute(final ShardingContext shardingContext) { new SimpleDateFormat("HH:mm:ss").format(new Date()), Thread.currentThread().getId(), "SIMPLE"); - List data = fooRepository.findTodoData(shardingContext.getShardingParameter(), 10); + List data = fooRepository.findUnfinishedData(shardingContext.getShardingParameter(), 10); data.stream().mapToLong(Foo::getId).forEach(fooRepository::setCompleted); } } diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java index 1185636d26..e76f53f92f 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/job/simple/SpringBootSimpleJob.java @@ -45,7 +45,7 @@ public void execute(final ShardingContext shardingContext) { new SimpleDateFormat("HH:mm:ss").format(new Date()), Thread.currentThread().getId(), "SIMPLE"); - springBootFooRepository.findTodoData(shardingContext.getShardingParameter(), 10) + springBootFooRepository.findUnfinishedData(shardingContext.getShardingParameter(), 10) .forEach(each -> springBootFooRepository.setCompleted(each.getId())); } } diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java index e6abaf1b10..f0ea27a58f 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/FooRepository.java @@ -37,21 +37,21 @@ public FooRepository() { private void addData(final long idFrom, final long idTo, final String location) { LongStream.range(idFrom, idTo) - .forEachOrdered(i -> data.put(i, new Foo(i, location, Foo.Status.TODO))); + .forEachOrdered(i -> data.put(i, new Foo(i, location, Foo.Status.UNFINISHED))); } /** - * Find todoData. + * Find Unfinished Data. * @param location location * @param limit limit * @return An ordered collection, where the user has precise control over where in the list each element is inserted. */ - public List findTodoData(final String location, final int limit) { + public List findUnfinishedData(final String location, final int limit) { List result = new ArrayList<>(limit); int count = 0; for (Map.Entry each : data.entrySet()) { Foo foo = each.getValue(); - if (foo.getLocation().equals(location) && foo.getStatus() == Foo.Status.TODO) { + if (foo.getLocation().equals(location) && foo.getStatus() == Foo.Status.UNFINISHED) { result.add(foo); count++; if (count == limit) { diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java index cafe2bb023..b9587171f2 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/commons/repository/SpringBootFooRepository.java @@ -32,28 +32,28 @@ public class SpringBootFooRepository { private final Map data = new ConcurrentHashMap<>(300, 1); public SpringBootFooRepository() { - addData(0L, 100L, "Beijing"); - addData(100L, 200L, "Shanghai"); - addData(200L, 300L, "Guangzhou"); + addData(0L, 100L, "Norddorf"); + addData(100L, 200L, "Bordeaux"); + addData(200L, 300L, "Somerset"); } private void addData(final long idFrom, final long idTo, final String location) { LongStream.range(idFrom, idTo) - .forEachOrdered(i -> data.put(i, new Foo(i, location, Foo.Status.TODO))); + .forEachOrdered(i -> data.put(i, new Foo(i, location, Foo.Status.UNFINISHED))); } /** - * Find todoData. + * Find Unfinished Data. * @param location location * @param limit limit * @return An ordered collection, where the user has precise control over where in the list each element is inserted. */ - public List findTodoData(final String location, final int limit) { + public List findUnfinishedData(final String location, final int limit) { List result = new ArrayList<>(limit); int count = 0; for (Map.Entry each : data.entrySet()) { Foo foo = each.getValue(); - if (foo.getLocation().equals(location) && foo.getStatus() == Foo.Status.TODO) { + if (foo.getLocation().equals(location) && foo.getStatus() == Foo.Status.UNFINISHED) { result.add(foo); count++; if (count == limit) { diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java new file mode 100644 index 0000000000..72305f2afa --- /dev/null +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/operation/JavaTest.java @@ -0,0 +1,306 @@ +/* + * 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.elasticjob.test.natived.it.operation; + +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import org.apache.curator.CuratorZookeeperClient; +import org.apache.curator.retry.ExponentialBackoffRetry; +import org.apache.curator.test.TestingServer; +import org.apache.shardingsphere.elasticjob.api.JobConfiguration; +import org.apache.shardingsphere.elasticjob.bootstrap.type.ScheduleJobBootstrap; +import org.apache.shardingsphere.elasticjob.kernel.internal.config.JobConfigurationPOJO; +import org.apache.shardingsphere.elasticjob.kernel.tracing.config.TracingConfiguration; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobConfigurationAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobOperateAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.JobStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ServerStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingOperateAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.api.ShardingStatisticsAPI; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.JobBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ServerBriefInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.domain.ShardingInfo; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.operate.JobOperateAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.operate.ShardingOperateAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.settings.JobConfigurationAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.JobStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.ServerStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.lifecycle.internal.statistics.ShardingStatisticsAPIImpl; +import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration; +import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter; +import org.apache.shardingsphere.elasticjob.test.natived.commons.job.simple.JavaSimpleJob; +import org.awaitility.Awaitility; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledInNativeImage; +import org.junit.jupiter.api.function.Executable; + +import javax.sql.DataSource; +import java.io.IOException; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.nullValue; +import static org.hamcrest.Matchers.startsWith; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; + +@EnabledInNativeImage +class JavaTest { + + private static TestingServer testingServer; + + private static CoordinatorRegistryCenter firstRegCenter; + + private static CoordinatorRegistryCenter secondRegCenter; + + private static TracingConfiguration tracingConfig; + + @BeforeAll + static void beforeAll() throws Exception { + testingServer = new TestingServer(); + try ( + CuratorZookeeperClient client = new CuratorZookeeperClient(testingServer.getConnectString(), + 60 * 1000, 500, null, + new ExponentialBackoffRetry(500, 3, 500 * 3))) { + client.start(); + Awaitility.await().atMost(Duration.ofMillis(500 * 60)).ignoreExceptions().until(client::isConnected); + } + firstRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); + firstRegCenter.init(); + secondRegCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration(testingServer.getConnectString(), "elasticjob-test-native-java")); + secondRegCenter.init(); + HikariConfig config = new HikariConfig(); + config.setDriverClassName("org.h2.Driver"); + config.setJdbcUrl("jdbc:h2:mem:job_event_storage"); + config.setUsername("sa"); + config.setPassword(""); + tracingConfig = new TracingConfiguration<>("RDB", new HikariDataSource(config)); + } + + @AfterAll + static void afterAll() throws IOException { + firstRegCenter.close(); + secondRegCenter.close(); + testingServer.close(); + } + + /** + * TODO Executing {@link JobConfigurationAPI#removeJobConfiguration(String)} will always cause the listener + * to throw an exception similar to {@code Caused by: java.lang.IllegalStateException: Expected state [STARTED] was [STOPPED]} . + * This is not acceptable behavior. + */ + @Test + void testJobConfigurationAPI() { + String jobName = "testJobConfigurationAPI"; + ScheduleJobBootstrap job = new ScheduleJobBootstrap(firstRegCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder(jobName, 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + job.schedule(); + JobConfigurationAPI jobConfigAPI = new JobConfigurationAPIImpl(secondRegCenter); + JobConfigurationPOJO jobConfig = jobConfigAPI.getJobConfiguration(jobName); + assertThat(jobConfig, notNullValue()); + assertThat(jobConfig.getJobName(), is(jobName)); + assertThat(jobConfig.getCron(), is("0/5 * * * * ?")); + assertThat(jobConfig.getShardingItemParameters(), is("0=Norddorf,1=Bordeaux,2=Somerset")); + JobConfigurationPOJO newJobConfig = new JobConfigurationPOJO(); + newJobConfig.setJobName(jobConfig.getJobName()); + newJobConfig.setShardingTotalCount(jobConfig.getShardingTotalCount()); + newJobConfig.setCron("0/10 * * * * ?"); + newJobConfig.setShardingItemParameters(jobConfig.getShardingItemParameters()); + newJobConfig.setJobExtraConfigurations(jobConfig.getJobExtraConfigurations()); + jobConfigAPI.updateJobConfiguration(newJobConfig); + JobConfigurationPOJO newTestJavaSimpleJob = jobConfigAPI.getJobConfiguration(jobName); + assertThat(newTestJavaSimpleJob, notNullValue()); + assertThat(newTestJavaSimpleJob.getCron(), is("0/10 * * * * ?")); + jobConfigAPI.removeJobConfiguration(jobName); + assertThat(jobConfigAPI.getJobConfiguration(jobName), nullValue()); + job.shutdown(); + } + + /** + * TODO The most embarrassing thing is that there seems to be no simple logic to + * test {@link JobOperateAPI#trigger(String)} and {@link JobOperateAPI#dump(String, String, int)}. + */ + @Test + void testJobOperateAPI() { + String jobName = "testJobOperateAPI"; + ScheduleJobBootstrap job = new ScheduleJobBootstrap(firstRegCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder(jobName, 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + job.schedule(); + List serverBriefInfos = new ArrayList<>(new ServerStatisticsAPIImpl(secondRegCenter).getAllServersBriefInfo()); + assertThat(serverBriefInfos.size(), is(1)); + String serverIp = serverBriefInfos.get(0).getServerIp(); + JobOperateAPI jobOperateAPI = new JobOperateAPIImpl(secondRegCenter); + jobOperateAPI.disable(jobName, serverIp); + JobStatisticsAPIImpl jobStatisticsAPI = new JobStatisticsAPIImpl(secondRegCenter); + JobBriefInfo firstJobBriefInfo = jobStatisticsAPI.getJobBriefInfo(jobName); + assertThat(firstJobBriefInfo, notNullValue()); + assertThat(firstJobBriefInfo.getStatus(), is(JobBriefInfo.JobStatus.DISABLED)); + jobOperateAPI.enable(jobName, serverIp); + JobBriefInfo secondJobBriefInfo = jobStatisticsAPI.getJobBriefInfo(jobName); + assertThat(secondJobBriefInfo, notNullValue()); + assertThat(secondJobBriefInfo.getStatus(), is(JobBriefInfo.JobStatus.SHARDING_FLAG)); + jobOperateAPI.remove(jobName, serverIp); + JobBriefInfo thirdJobBriefInfo = jobStatisticsAPI.getJobBriefInfo(jobName); + assertThat(thirdJobBriefInfo, notNullValue()); + assertThat(thirdJobBriefInfo.getStatus(), is(JobBriefInfo.JobStatus.CRASHED)); + job.shutdown(); + } + + @Test + void testShardingOperateAPI() { + String jobName = "testShardingOperateAPI"; + ScheduleJobBootstrap job = new ScheduleJobBootstrap(firstRegCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder(jobName, 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + job.schedule(); + ShardingOperateAPI shardingOperateAPI = new ShardingOperateAPIImpl(secondRegCenter); + shardingOperateAPI.disable(jobName, "0"); + ShardingStatisticsAPI shardingStatisticsAPI = new ShardingStatisticsAPIImpl(secondRegCenter); + List firstShardingInfos = shardingStatisticsAPI.getShardingInfo(jobName) + .stream() + .filter(shardingInfo -> 0 == shardingInfo.getItem()) + .collect(Collectors.toList()); + assertThat(firstShardingInfos.size(), is(1)); + assertThat(firstShardingInfos.get(0).getStatus(), is(ShardingInfo.ShardingStatus.DISABLED)); + shardingOperateAPI.enable(jobName, "0"); + List secondShardingInfos = shardingStatisticsAPI.getShardingInfo(jobName) + .stream() + .filter(shardingInfo -> 0 == shardingInfo.getItem()) + .collect(Collectors.toList()); + assertThat(secondShardingInfos.size(), is(1)); + assertThat(secondShardingInfos.get(0).getStatus(), is(ShardingInfo.ShardingStatus.SHARDING_FLAG)); + job.shutdown(); + } + + @Test + void testJobStatisticsAPI() { + String jobName = "testJobStatisticsAPI"; + ScheduleJobBootstrap job = new ScheduleJobBootstrap(firstRegCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder(jobName, 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + job.schedule(); + JobStatisticsAPI jobStatisticsAPI = new JobStatisticsAPIImpl(secondRegCenter); + assertThat(jobStatisticsAPI.getJobsTotalCount(), is(1)); + JobBriefInfo jobBriefInfo = jobStatisticsAPI.getJobBriefInfo(jobName); + assertThat(jobBriefInfo, notNullValue()); + assertThat(jobBriefInfo.getJobName(), is(jobName)); + assertThat(jobBriefInfo.getStatus(), is(JobBriefInfo.JobStatus.SHARDING_FLAG)); + assertThat(jobBriefInfo.getDescription(), is("")); + assertThat(jobBriefInfo.getCron(), is("0/5 * * * * ?")); + assertThat(jobBriefInfo.getInstanceCount(), is(1)); + assertThat(jobBriefInfo.getShardingTotalCount(), is(3)); + assertThat(jobStatisticsAPI.getAllJobsBriefInfo().size(), is(1)); + assertDoesNotThrow(() -> { + List ipList = secondRegCenter.getChildrenKeys("/" + jobName + "/servers"); + assertThat(ipList.size(), is(1)); + assertThat(jobStatisticsAPI.getJobsBriefInfo(ipList.get(0)).size(), is(1)); + }); + job.shutdown(); + } + + /** + * TODO The logic inside {@link org.junit.jupiter.api.Assertions#assertDoesNotThrow(Executable)} should be removed. + */ + @Test + void testServerStatisticsAPI() { + String jobName = "testServerStatisticsAPI"; + ScheduleJobBootstrap job = new ScheduleJobBootstrap(firstRegCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder(jobName, 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + job.schedule(); + ServerStatisticsAPI serverStatisticsAPI = new ServerStatisticsAPIImpl(secondRegCenter); + assertThat(serverStatisticsAPI.getServersTotalCount(), is(1)); + Collection allServersBriefInfo = serverStatisticsAPI.getAllServersBriefInfo(); + assertThat(allServersBriefInfo.size(), is(1)); + allServersBriefInfo.stream().findFirst().ifPresent(serverBriefInfo -> { + String serverIp = serverBriefInfo.getServerIp(); + assertThat(serverIp, notNullValue()); + Set instances = serverBriefInfo.getInstances(); + assertThat(instances.size(), is(1)); + assertThat(instances.stream().findFirst().isPresent(), is(true)); + assertThat(instances.stream().findFirst().get(), startsWith(serverIp + "@-@")); + Set jobNames = serverBriefInfo.getJobNames(); + assertThat(jobNames.size(), is(1)); + assertThat(jobNames.stream().findFirst().isPresent(), is(true)); + assertThat(jobNames.stream().findFirst().get(), is(jobName)); + assertThat(serverBriefInfo.getInstancesNum(), is(1)); + assertThat(serverBriefInfo.getJobsNum(), is(1)); + assertThat(serverBriefInfo.getDisabledJobsNum().intValue(), is(0)); + }); + job.shutdown(); + assertDoesNotThrow(() -> { + JobConfigurationAPI jobConfigAPI = new JobConfigurationAPIImpl(secondRegCenter); + jobConfigAPI.removeJobConfiguration(jobName); + }); + } + + @Test + void testShardingStatisticsAPI() { + String jobName = "testShardingStatisticsAPI"; + ScheduleJobBootstrap job = new ScheduleJobBootstrap(firstRegCenter, new JavaSimpleJob(), + JobConfiguration.newBuilder(jobName, 3) + .cron("0/5 * * * * ?") + .shardingItemParameters("0=Norddorf,1=Bordeaux,2=Somerset") + .addExtraConfigurations(tracingConfig) + .build()); + job.schedule(); + ShardingStatisticsAPI shardingStatisticsAPI = new ShardingStatisticsAPIImpl(secondRegCenter); + Awaitility.await() + .atMost(1L, TimeUnit.MINUTES) + .ignoreExceptions() + .until(() -> 3 == shardingStatisticsAPI.getShardingInfo(jobName).size()); + shardingStatisticsAPI.getShardingInfo(jobName).forEach(shardingInfo -> { + String serverIp = shardingInfo.getServerIp(); + assertThat(serverIp, notNullValue()); + assertThat(shardingInfo.getInstanceId(), startsWith(serverIp + "@-@")); + ShardingInfo.ShardingStatus status = shardingInfo.getStatus(); + assertThat(status, not(ShardingInfo.ShardingStatus.SHARDING_FLAG)); + assertThat(status, not(ShardingInfo.ShardingStatus.DISABLED)); + assertThat(shardingInfo.isFailover(), is(false)); + }); + job.shutdown(); + } +} diff --git a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/JavaTest.java b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/JavaTest.java index bb4e91163d..1e35c29234 100644 --- a/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/JavaTest.java +++ b/test/native/src/test/java/org/apache/shardingsphere/elasticjob/test/natived/it/staticd/JavaTest.java @@ -58,15 +58,6 @@ class JavaTest { private static TracingConfiguration tracingConfig; - /** - * TODO Internally in {@link org.apache.curator.test.TestingServer}, - * {@code Files.createTempDirectory(DirectoryUtils.class.getSimpleName()).toFile())} calls {@link java.nio.file.Path#toFile()}, - * which is undesirable in both JAR and GraalVM Native Image, - * see oracle/graal#7804. - * ElasticJob believe this requires changes on the apache/curator side. - * - * @throws Exception errors - */ @BeforeAll static void beforeAll() throws Exception { testingServer = new TestingServer(); diff --git a/test/native/src/test/resources/application.yml b/test/native/src/test/resources/application.yml index 60e9626158..f1c82ddfa7 100644 --- a/test/native/src/test/resources/application.yml +++ b/test/native/src/test/resources/application.yml @@ -15,8 +15,8 @@ # limitations under the License. # -# `elasticjob.regCenter.serverLists` is dynamically defined in `org.apache.shardingsphere.elasticjob.test.natived.SpirngBootTest` -# `elasticjob.dump.port` is dynamically defined in `org.apache.shardingsphere.elasticjob.test.natived.SpirngBootTest` +# `elasticjob.regCenter.serverLists` is dynamically defined in `org.springframework.test.context.DynamicPropertySource` +# `elasticjob.dump.port` is dynamically defined in `org.springframework.test.context.DynamicPropertySource` elasticjob: tracing: type: RDB @@ -26,18 +26,18 @@ elasticjob: username: sa password: regCenter: - namespace: elasticjob-springboot + namespace: elasticjob-test-native-springboot jobs: simpleJob: elasticJobClass: org.apache.shardingsphere.elasticjob.test.natived.commons.job.simple.SpringBootSimpleJob cron: 0/5 * * * * ? shardingTotalCount: 3 - shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou + shardingItemParameters: 0=Norddorf,1=Bordeaux,2=Somerset dataflowJob: elasticJobClass: org.apache.shardingsphere.elasticjob.test.natived.commons.job.dataflow.SpringBootDataflowJob cron: 0/5 * * * * ? shardingTotalCount: 3 - shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou + shardingItemParameters: 0=Norddorf,1=Bordeaux,2=Somerset scriptJob: elasticJobType: SCRIPT cron: 0/10 * * * * ? From 756de29e677ce897c6e965715f6a2f3be3ebffea Mon Sep 17 00:00:00 2001 From: Ling Hengqian Date: Mon, 12 Aug 2024 14:27:39 +0800 Subject: [PATCH 178/178] Block `elasticjob-test-native` module from compiling on JDK 8 to JDK16 (#2427) --- .github/workflows/graalvm.yml | 3 ++- .github/workflows/maven.yml | 7 +++---- .github/workflows/required-check.yml | 3 +++ .../configuration/graalvm-native-image.cn.md | 4 ++-- .../configuration/graalvm-native-image.en.md | 4 ++-- pom.xml | 3 --- test/native/pom.xml | 3 ++- test/pom.xml | 14 +++++++++++++- 8 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index b396737ff6..f57cd810d4 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -28,6 +28,7 @@ on: jobs: build: + if: github.repository == 'apache/shardingsphere-elasticjob' strategy: matrix: java: [ '22.0.2' ] @@ -45,4 +46,4 @@ jobs: native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} continue-on-error: true - run: ./mvnw -PnativeTestInElasticJob -T1C -B -e -Dspring-boot-dependencies.version=3.3.2 clean test + run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8bc9771b26..9f1c5bbfb3 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,21 +26,20 @@ on: jobs: build: + if: github.repository == 'apache/shardingsphere-elasticjob' strategy: matrix: java: [ 8, 17, 21, 22 ] os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ] - runs-on: ${{ matrix.os }} - steps: - name: Configure Git if: matrix.os == 'windows-latest' run: | git config --global core.longpaths true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: ${{ matrix.java }} diff --git a/.github/workflows/required-check.yml b/.github/workflows/required-check.yml index 229dc8df41..4abcc4acfc 100644 --- a/.github/workflows/required-check.yml +++ b/.github/workflows/required-check.yml @@ -29,6 +29,7 @@ concurrency: jobs: check-checkstyle: name: Check - CheckStyle + if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -38,6 +39,7 @@ jobs: check-spotless: name: Check - Spotless + if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -47,6 +49,7 @@ jobs: check-license: name: Check - License + if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: diff --git a/docs/content/user-manual/configuration/graalvm-native-image.cn.md b/docs/content/user-manual/configuration/graalvm-native-image.cn.md index 79ca6f43bc..560c0f2123 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.cn.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.cn.md @@ -256,7 +256,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere-elasticjob.git cd ./shardingsphere-elasticjob/ -./mvnw -PnativeTestInElasticJob -T1C -e -Dspring-boot-dependencies.version=3.3.2 clean test +./mvnw -PnativeTestInElasticJob -T1C -e clean test ``` 当贡献者发现缺少与 ElasticJob 无关的第三方库的 GraalVM Reachability Metadata 时,应当在 @@ -285,5 +285,5 @@ ElasticJob 定义了 `generateMetadata` 的 Maven Profile 用于在 GraalVM JIT ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C -Dspring-boot-dependencies.version=3.3.2 clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy ``` diff --git a/docs/content/user-manual/configuration/graalvm-native-image.en.md b/docs/content/user-manual/configuration/graalvm-native-image.en.md index fb86d608e0..4353929cb2 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.en.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.en.md @@ -259,7 +259,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere-elasticjob.git cd ./shardingsphere-elasticjob/ -./mvnw -PnativeTestInElasticJob -T1C -e -Dspring-boot-dependencies.version=3.3.2 clean test +./mvnw -PnativeTestInElasticJob -T1C -e clean test ``` When contributors find that GraalVM Reachability Metadata for third-party libraries not related to ElasticJob is missing, @@ -289,5 +289,5 @@ contributors should place it in the classpath of the shardingsphere-test-native ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C -Dspring-boot-dependencies.version=3.3.2 clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy ``` diff --git a/pom.xml b/pom.xml index 4bc966d9de..9231ff2dc8 100644 --- a/pom.xml +++ b/pom.xml @@ -757,9 +757,6 @@ [11,) - - 8 - diff --git a/test/native/pom.xml b/test/native/pom.xml index 1370b8b48b..d031f4f768 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -28,7 +28,8 @@ true - + + 3.3.2 2.0.13 1.5.6 diff --git a/test/pom.xml b/test/pom.xml index 4d6d5e326f..460ae982d4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -30,6 +30,18 @@ e2e util - native + + + + + jdk17+ + + [17,) + + + native + + +