You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/07/10 09:48:58 UTC
[shardingsphere-elasticjob-lite] branch master updated: Move
elasticjob-tracing to common module (#1018)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob-lite.git
The following commit(s) were added to refs/heads/master by this push:
new 3590e70 Move elasticjob-tracing to common module (#1018)
3590e70 is described below
commit 3590e7064d31f37ad88546ee2fe05fd36c8f707d
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri Jul 10 17:48:48 2020 +0800
Move elasticjob-tracing to common module (#1018)
* Reuse tracing module for cloud
* Move elasticjob-lite-tracing to common module
* Remove usage of cloud JobEventBus
* Remove cloud.event package
---
elasticjob-cloud/elasticjob-cloud-common/pom.xml | 6 +
.../elasticjob/cloud/event/JobEvent.java | 31 --
.../elasticjob/cloud/event/JobEventBus.java | 71 ----
.../cloud/event/JobEventConfiguration.java | 32 --
.../elasticjob/cloud/event/JobEventIdentity.java | 31 --
.../elasticjob/cloud/event/JobEventListener.java | 47 ---
.../JobEventListenerConfigurationException.java | 30 --
.../elasticjob/cloud/event/rdb/DatabaseType.java | 58 ----
.../cloud/event/rdb/JobEventRdbConfiguration.java | 49 ---
.../cloud/event/rdb/JobEventRdbIdentity.java | 31 --
.../cloud/event/rdb/JobEventRdbListener.java | 47 ---
.../cloud/event/rdb/JobEventRdbStorage.java | 364 ---------------------
.../cloud/event/type/JobExecutionEvent.java | 104 ------
.../event/type/JobExecutionEventThrowable.java | 37 ---
.../cloud/event/type/JobStatusTraceEvent.java | 68 ----
.../cloud/executor/AbstractElasticJobExecutor.java | 59 ++--
.../elasticjob/cloud/executor/JobFacade.java | 4 +-
.../elasticjob/cloud/AllCoreTests.java | 49 ---
.../elasticjob/cloud/api/AllApiTests.java | 27 --
.../elasticjob/cloud/config/AllConfigTests.java | 27 --
.../elasticjob/cloud/context/AllContextTests.java | 26 --
.../elasticjob/cloud/event/AllEventTests.java | 39 ---
.../elasticjob/cloud/event/JobEventBusTest.java | 76 -----
.../cloud/event/JobExecutionEventTest.java | 57 ----
.../event/fixture/TestJobEventConfiguration.java | 34 --
.../fixture/TestJobEventFailureConfiguration.java | 30 --
.../cloud/event/fixture/TestJobEventIdentity.java | 28 --
.../cloud/event/fixture/TestJobEventListener.java | 51 ---
.../event/rdb/JobEventRdbConfigurationTest.java | 53 ---
.../cloud/event/rdb/JobEventRdbIdentityTest.java | 30 --
.../cloud/event/rdb/JobEventRdbListenerTest.java | 79 -----
.../cloud/event/rdb/JobEventRdbSearchTest.java | 241 --------------
.../cloud/event/rdb/JobEventRdbStorageTest.java | 136 --------
.../cloud/exception/AllExceptionTests.java | 33 --
.../cloud/executor/AllExecutorTests.java | 43 ---
.../impl/DefaultJobExceptionHandlerTest.java | 1 -
.../handler/impl}/JobEventCaller.java | 4 +-
.../cloud/executor/type/ElasticJobVerify.java | 10 +-
.../cloud/executor/type/SimpleJobExecutorTest.java | 36 +-
.../cloud/executor/type/WrongJobExecutorTest.java | 10 +-
.../elasticjob/cloud/reg/AllRegTests.java | 49 ---
.../cloud/statistics/AllStatisticsTests.java | 31 --
.../elasticjob/cloud/util/AllUtilTests.java | 49 ---
.../src/test/resources/logback-test.xml | 4 +-
.../elasticjob/cloud/executor/CloudJobFacade.java | 24 +-
.../elasticjob/cloud/executor/TaskExecutor.java | 17 +-
.../cloud/executor/local/LocalTaskExecutor.java | 12 +-
.../cloud/executor/AllCloudExecutorTests.java | 38 ---
.../cloud/executor/CloudJobFacadeTest.java | 13 +-
.../executor/local/AllLocalExecutorTests.java | 29 --
.../cloud/scheduler/env/BootstrapEnvironment.java | 13 +-
.../cloud/scheduler/mesos/SchedulerEngine.java | 14 +-
.../cloud/scheduler/mesos/SchedulerService.java | 40 +--
.../mesos/TaskLaunchScheduledService.java | 47 ++-
.../scheduler/restful/CloudJobRestfulApi.java | 38 +--
.../restful/search}/JobEventRdbSearch.java | 15 +-
.../scheduler/statistics/StatisticManager.java | 19 +-
.../shardingsphere/elasticjob/cloud/AllTests.java | 35 --
.../elasticjob/cloud/restful/AllRestfulTests.java | 33 --
.../cloud/scheduler/AllCloudSchedulerTests.java | 45 ---
.../cloud/scheduler/config/AllConfigTests.java | 31 --
.../cloud/scheduler/context/AllContextTests.java | 26 --
.../cloud/scheduler/env/AllEnvTests.java | 26 --
.../scheduler/env/BootstrapEnvironmentTest.java | 16 +-
.../elasticjob/cloud/scheduler/ha/AllHATests.java | 26 --
.../cloud/scheduler/mesos/AllMesosTests.java | 41 ---
.../cloud/scheduler/mesos/SchedulerEngineTest.java | 18 +-
.../mesos/TaskLaunchScheduledServiceTest.java | 44 ++-
.../cloud/scheduler/producer/AllProducerTests.java | 31 --
.../restful/AbstractCloudRestfulApiTest.java | 8 +-
.../cloud/scheduler/restful/AllRestfulTests.java | 30 --
.../scheduler/restful/CloudJobRestfulApiTest.java | 29 +-
.../cloud/scheduler/state/AllStateTests.java | 47 ---
.../scheduler/statistics/AllStatisticTests.java | 40 ---
.../scheduler/statistics/StatisticManagerTest.java | 14 +-
.../elasticjob-tracing-api}/pom.xml | 4 +-
.../elasticjob}/tracing/JobEventBus.java | 12 +-
.../tracing/api/TracingConfiguration.java | 4 +-
.../elasticjob}/tracing/event/JobEvent.java | 4 +-
.../tracing/event/JobExecutionEvent.java | 2 +-
.../tracing/event/JobStatusTraceEvent.java | 2 +-
.../exception/TracingConfigurationException.java | 4 +-
.../tracing/listener/TracingListener.java | 8 +-
.../listener/TracingListenerConfiguration.java | 4 +-
.../tracing/listener/TracingListenerFactory.java | 6 +-
.../elasticjob}/tracing/JobEventBusTest.java | 14 +-
.../tracing/event/JobExecutionEventTest.java | 7 +-
.../tracing/fixture/JobEventCaller.java | 4 +-
.../fixture/TestTracingFailureConfiguration.java | 10 +-
.../tracing/fixture/TestTracingListener.java | 10 +-
.../fixture/TestTracingListenerConfiguration.java | 8 +-
.../listener/TracingListenerFactoryTest.java | 8 +-
...b.tracing.listener.TracingListenerConfiguration | 4 +-
.../src/test/resources/logback-test.xml | 4 +-
.../elasticjob-tracing-rdb}/pom.xml | 6 +-
.../tracing/rdb/listener/RDBTracingListener.java | 12 +-
.../listener/RDBTracingListenerConfiguration.java | 10 +-
.../tracing/rdb/storage/RDBJobEventStorage.java | 14 +-
.../tracing/rdb/storage/RDBStorageSQLMapper.java | 2 +-
.../elasticjob}/tracing/rdb/type/DatabaseType.java | 2 +-
.../tracing/rdb/type/impl/DB2DatabaseType.java | 4 +-
.../tracing/rdb/type/impl/H2DatabaseType.java | 4 +-
.../tracing/rdb/type/impl/MySQLDatabaseType.java | 4 +-
.../tracing/rdb/type/impl/OracleDatabaseType.java | 4 +-
.../rdb/type/impl/PostgreSQLDatabaseType.java | 4 +-
.../rdb/type/impl/SQLServerDatabaseType.java | 4 +-
...b.tracing.listener.TracingListenerConfiguration | 2 +-
...sphere.elasticjob.tracing.rdb.type.DatabaseType | 12 +-
.../src/main/resources/META-INF/sql/db2.properties | 0
.../src/main/resources/META-INF/sql/h2.properties | 0
.../main/resources/META-INF/sql/mysql.properties | 0
.../main/resources/META-INF/sql/oracle.properties | 0
.../resources/META-INF/sql/postgresQL.properties | 0
.../main/resources/META-INF/sql/sql92.properties | 0
.../resources/META-INF/sql/sqlserver.properties | 0
.../RDBTracingListenerConfigurationTest.java | 6 +-
.../rdb/listener/RDBTracingListenerTest.java | 18 +-
.../rdb/storage/RDBJobEventStorageTest.java | 12 +-
.../src/test/resources/logback-test.xml | 0
.../elasticjob-tracing}/pom.xml | 6 +-
.../pom.xml | 9 +-
.../controller/EventTraceHistoryController.java | 4 +-
.../lite/console/domain/JobExecutionLog.java | 2 +-
.../lite/console/domain/JobStatusTraceLog.java | 2 +-
.../console/service/EventTraceHistoryService.java | 4 +-
.../service/impl/EventTraceHistoryServiceImpl.java | 4 +-
.../console/dao/search/RDBJobEventSearchTest.java | 4 +-
.../search/RDBJobEventSearchTestConfiguration.java | 6 +-
elasticjob-lite/elasticjob-lite-core/pom.xml | 2 +-
.../api/bootstrap/impl/OneOffJobBootstrap.java | 2 +-
.../api/bootstrap/impl/ScheduleJobBootstrap.java | 2 +-
.../lite/executor/ElasticJobExecutor.java | 8 +-
.../elasticjob/lite/executor/JobFacade.java | 4 +-
.../lite/internal/schedule/JobScheduler.java | 2 +-
.../elasticjob/lite/internal/schedule/LiteJob.java | 2 +-
.../lite/internal/schedule/LiteJobFacade.java | 12 +-
.../lite/executor/ElasticJobExecutorTest.java | 2 +-
.../lite/internal/schedule/LiteJobFacadeTest.java | 2 +-
.../parser/TracingBeanDefinitionParser.java | 2 +-
elasticjob-lite/pom.xml | 3 +-
.../elasticjob/lite/example/JavaMain.java | 2 +-
.../lite/example/config/DataflowJobConfig.java | 2 +-
.../lite/example/config/SimpleJobConfig.java | 2 +-
.../lite/example/config/TracingConfig.java | 2 +-
pom.xml | 1 +
145 files changed, 418 insertions(+), 3095 deletions(-)
diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml
index 1c913b3..c4644dc 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml
+++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml
@@ -30,6 +30,12 @@
<dependencies>
<dependency>
+ <groupId>org.apache.shardingsphere.elasticjob</groupId>
+ <artifactId>elasticjob-tracing-rdb</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEvent.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEvent.java
deleted file mode 100755
index 95223b6..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEvent.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.event;
-
-/**
- * Job event.
- */
-public interface JobEvent {
-
- /**
- * Get job name.
- *
- * @return job name
- */
- String getJobName();
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventBus.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventBus.java
deleted file mode 100755
index 4bffc03..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventBus.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.event;
-
-import com.google.common.eventbus.AsyncEventBus;
-import com.google.common.eventbus.EventBus;
-import org.apache.shardingsphere.elasticjob.cloud.util.concurrent.ExecutorServiceObject;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * Job event bus.
- */
-@Slf4j
-public final class JobEventBus {
-
- private final JobEventConfiguration jobEventConfig;
-
- private final ExecutorServiceObject executorServiceObject;
-
- private final EventBus eventBus;
-
- private boolean isRegistered;
-
- public JobEventBus() {
- jobEventConfig = null;
- executorServiceObject = null;
- eventBus = null;
- }
-
- public JobEventBus(final JobEventConfiguration jobEventConfig) {
- this.jobEventConfig = jobEventConfig;
- executorServiceObject = new ExecutorServiceObject("job-event", Runtime.getRuntime().availableProcessors() * 2);
- eventBus = new AsyncEventBus(executorServiceObject.createExecutorService());
- register();
- }
-
- private void register() {
- try {
- eventBus.register(jobEventConfig.createJobEventListener());
- isRegistered = true;
- } catch (final JobEventListenerConfigurationException ex) {
- log.error("Elastic job: create JobEventListener failure, error is: ", ex);
- }
- }
-
- /**
- * Post event.
- *
- * @param event job event
- */
- public void post(final JobEvent event) {
- if (isRegistered && !executorServiceObject.isShutdown()) {
- eventBus.post(event);
- }
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventConfiguration.java
deleted file mode 100755
index 8de6952..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventConfiguration.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.event;
-
-/**
- * Job event configuration.
- */
-public interface JobEventConfiguration extends JobEventIdentity {
-
- /**
- * Create job event listener.
- *
- * @return Job event listener
- * @throws JobEventListenerConfigurationException job event listener configuration exception
- */
- JobEventListener createJobEventListener() throws JobEventListenerConfigurationException;
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventIdentity.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventIdentity.java
deleted file mode 100755
index a3367fb..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventIdentity.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.event;
-
-/**
- * Job event identity.
- */
-public interface JobEventIdentity {
-
- /**
- * Get identity.
- *
- * @return identity
- */
- String getIdentity();
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventListener.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventListener.java
deleted file mode 100755
index 36a2111..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventListener.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.event;
-
-import com.google.common.eventbus.AllowConcurrentEvents;
-import com.google.common.eventbus.Subscribe;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-
-/**
- * Job event listener.
- */
-public interface JobEventListener extends JobEventIdentity {
-
- /**
- * Listen job execution event.
- *
- * @param jobExecutionEvent job execution event
- */
- @Subscribe
- @AllowConcurrentEvents
- void listen(JobExecutionEvent jobExecutionEvent);
-
- /**
- * Listen job status trace event.
- *
- * @param jobStatusTraceEvent job status trace event
- */
- @Subscribe
- @AllowConcurrentEvents
- void listen(JobStatusTraceEvent jobStatusTraceEvent);
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventListenerConfigurationException.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventListenerConfigurationException.java
deleted file mode 100755
index ac33ae6..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventListenerConfigurationException.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.event;
-
-/**
- * Job event listener configuration exception.
- */
-public final class JobEventListenerConfigurationException extends Exception {
-
- private static final long serialVersionUID = 4069519372148227761L;
-
- public JobEventListenerConfigurationException(final Exception ex) {
- super(ex);
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/DatabaseType.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/DatabaseType.java
deleted file mode 100755
index 126ebdf..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/DatabaseType.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.event.rdb;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterators;
-
-import java.util.Arrays;
-
-/**
- * Database type.
- */
-public enum DatabaseType {
-
- H2("H2"), MySQL("MySQL"), Oracle("Oracle"), SQLServer("Microsoft SQL Server"), DB2("DB2"), PostgreSQL("PostgreSQL");
-
- private final String productName;
-
- DatabaseType(final String productName) {
- this.productName = productName;
- }
-
- /**
- * Get database type.
- *
- * @param databaseProductName database product name
- * @return database type
- */
- public static DatabaseType valueFrom(final String databaseProductName) {
- Optional<DatabaseType> databaseTypeOptional = Iterators.tryFind(Arrays.asList(DatabaseType.values()).iterator(), new Predicate<DatabaseType>() {
- @Override
- public boolean apply(final DatabaseType input) {
- return input.productName.equals(databaseProductName);
- }
- });
- if (databaseTypeOptional.isPresent()) {
- return databaseTypeOptional.get();
- } else {
- throw new RuntimeException("Unsupported database:" + databaseProductName);
- }
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbConfiguration.java
deleted file mode 100755
index f608caf..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbConfiguration.java
+++ /dev/null
@@ -1,49 +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.event.rdb;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListener;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListenerConfigurationException;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-import javax.sql.DataSource;
-import java.io.Serializable;
-import java.sql.SQLException;
-
-/**
- * Job event RDB configuration.
- */
-@RequiredArgsConstructor
-@Getter
-public final class JobEventRdbConfiguration extends JobEventRdbIdentity implements JobEventConfiguration, Serializable {
-
- private static final long serialVersionUID = 3344410699286435226L;
-
- private final transient DataSource dataSource;
-
- @Override
- public JobEventListener createJobEventListener() throws JobEventListenerConfigurationException {
- try {
- return new JobEventRdbListener(dataSource);
- } catch (final SQLException ex) {
- throw new JobEventListenerConfigurationException(ex);
- }
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentity.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentity.java
deleted file mode 100755
index 1857f44..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentity.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.event.rdb;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventIdentity;
-
-/**
- * Job event RDB identity.
- */
-public class JobEventRdbIdentity implements JobEventIdentity {
-
- @Override
- public String getIdentity() {
- return "rdb";
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbListener.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbListener.java
deleted file mode 100755
index 9027db0..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbListener.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.event.rdb;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListener;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-
-import javax.sql.DataSource;
-import java.sql.SQLException;
-
-/**
- * Job event RDB listener.
- */
-public final class JobEventRdbListener extends JobEventRdbIdentity implements JobEventListener {
-
- private final JobEventRdbStorage repository;
-
- public JobEventRdbListener(final DataSource dataSource) throws SQLException {
- repository = new JobEventRdbStorage(dataSource);
- }
-
- @Override
- public void listen(final JobExecutionEvent executionEvent) {
- repository.addJobExecutionEvent(executionEvent);
- }
-
- @Override
- public void listen(final JobStatusTraceEvent jobStatusTraceEvent) {
- repository.addJobStatusTraceEvent(jobStatusTraceEvent);
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbStorage.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbStorage.java
deleted file mode 100755
index 7dd30ce..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbStorage.java
+++ /dev/null
@@ -1,364 +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.event.rdb;
-
-import com.google.common.base.Strings;
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import lombok.extern.slf4j.Slf4j;
-
-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.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-
-/**
- * Job event RDB storage.
- */
-@Slf4j
-final class JobEventRdbStorage {
-
- 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 String TASK_ID_STATE_INDEX = "TASK_ID_STATE_INDEX";
-
- private final DataSource dataSource;
-
- private DatabaseType databaseType;
-
- JobEventRdbStorage(final DataSource dataSource) throws SQLException {
- this.dataSource = dataSource;
- initTablesAndIndexes();
- }
-
- private void initTablesAndIndexes() throws SQLException {
- try (Connection conn = dataSource.getConnection()) {
- createJobExecutionTableAndIndexIfNeeded(conn);
- createJobStatusTraceTableAndIndexIfNeeded(conn);
- databaseType = DatabaseType.valueFrom(conn.getMetaData().getDatabaseProductName());
- }
- }
-
- private void createJobExecutionTableAndIndexIfNeeded(final Connection conn) throws SQLException {
- DatabaseMetaData dbMetaData = conn.getMetaData();
- try (ResultSet resultSet = dbMetaData.getTables(null, null, TABLE_JOB_EXECUTION_LOG, new String[]{"TABLE"})) {
- if (!resultSet.next()) {
- createJobExecutionTable(conn);
- }
- }
- }
-
- private void createJobStatusTraceTableAndIndexIfNeeded(final Connection conn) throws SQLException {
- DatabaseMetaData dbMetaData = conn.getMetaData();
- try (ResultSet resultSet = dbMetaData.getTables(null, null, TABLE_JOB_STATUS_TRACE_LOG, new String[]{"TABLE"})) {
- if (!resultSet.next()) {
- createJobStatusTraceTable(conn);
- }
- }
- createTaskIdIndexIfNeeded(conn, TABLE_JOB_STATUS_TRACE_LOG, TASK_ID_STATE_INDEX);
- }
-
- private void createTaskIdIndexIfNeeded(final Connection conn, final String tableName, final String indexName) throws SQLException {
- DatabaseMetaData dbMetaData = conn.getMetaData();
- try (ResultSet resultSet = dbMetaData.getIndexInfo(null, null, tableName, false, false)) {
- boolean hasTaskIdIndex = false;
- while (resultSet.next()) {
- if (indexName.equals(resultSet.getString("INDEX_NAME"))) {
- hasTaskIdIndex = true;
- }
- }
- if (!hasTaskIdIndex) {
- createTaskIdAndStateIndex(conn, tableName);
- }
- }
- }
-
- private void createJobExecutionTable(final Connection conn) throws SQLException {
- String dbSchema = "CREATE TABLE `" + TABLE_JOB_EXECUTION_LOG + "` ("
- + "`id` VARCHAR(40) NOT NULL, "
- + "`job_name` VARCHAR(100) NOT NULL, "
- + "`task_id` VARCHAR(255) NOT NULL, "
- + "`hostname` VARCHAR(255) NOT NULL, "
- + "`ip` VARCHAR(50) NOT NULL, "
- + "`sharding_item` INT NOT NULL, "
- + "`execution_source` VARCHAR(20) NOT NULL, "
- + "`failure_cause` VARCHAR(4000) NULL, "
- + "`is_success` INT NOT NULL, "
- + "`start_time` TIMESTAMP NULL, "
- + "`complete_time` TIMESTAMP NULL, "
- + "PRIMARY KEY (`id`));";
- try (PreparedStatement preparedStatement = conn.prepareStatement(dbSchema)) {
- preparedStatement.execute();
- }
- }
-
- private void createJobStatusTraceTable(final Connection conn) throws SQLException {
- String dbSchema = "CREATE TABLE `" + 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`));";
- try (PreparedStatement preparedStatement = conn.prepareStatement(dbSchema)) {
- preparedStatement.execute();
- }
- }
-
- private void createTaskIdAndStateIndex(final Connection conn, final String tableName) throws SQLException {
- String sql = "CREATE INDEX " + TASK_ID_STATE_INDEX + " ON " + tableName + " (`task_id`, `state`);";
- try (PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
- preparedStatement.execute();
- }
- }
-
- boolean addJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) {
- if (null == jobExecutionEvent.getCompleteTime()) {
- return insertJobExecutionEvent(jobExecutionEvent);
- } else {
- if (jobExecutionEvent.isSuccess()) {
- return updateJobExecutionEventWhenSuccess(jobExecutionEvent);
- } else {
- return updateJobExecutionEventFailure(jobExecutionEvent);
- }
- }
- }
-
- private boolean insertJobExecutionEvent(final JobExecutionEvent jobExecutionEvent) {
- boolean result = false;
- String sql = "INSERT INTO `" + TABLE_JOB_EXECUTION_LOG + "` (`id`, `job_name`, `task_id`, `hostname`, `ip`, `sharding_item`, `execution_source`, `is_success`, `start_time`) "
- + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);";
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
- 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.execute();
- result = true;
- } catch (final SQLException ex) {
- if (!isDuplicateRecord(ex)) {
- // TODO log failure directly to output log, consider to be configurable in the future
- log.error(ex.getMessage());
- }
- }
- return result;
- }
-
- private boolean isDuplicateRecord(final SQLException ex) {
- return DatabaseType.MySQL.equals(databaseType) && 1062 == ex.getErrorCode() || DatabaseType.H2.equals(databaseType) && 23505 == ex.getErrorCode()
- || DatabaseType.SQLServer.equals(databaseType) && 1 == ex.getErrorCode() || DatabaseType.DB2.equals(databaseType) && -803 == ex.getErrorCode()
- || DatabaseType.PostgreSQL.equals(databaseType) && 0 == ex.getErrorCode() || DatabaseType.Oracle.equals(databaseType) && 1 == ex.getErrorCode();
- }
-
- private boolean updateJobExecutionEventWhenSuccess(final JobExecutionEvent jobExecutionEvent) {
- boolean result = false;
- String sql = "UPDATE `" + TABLE_JOB_EXECUTION_LOG + "` SET `is_success` = ?, `complete_time` = ? WHERE id = ?";
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
- preparedStatement.setBoolean(1, jobExecutionEvent.isSuccess());
- preparedStatement.setTimestamp(2, new Timestamp(jobExecutionEvent.getCompleteTime().getTime()));
- preparedStatement.setString(3, jobExecutionEvent.getId());
- if (0 == preparedStatement.executeUpdate()) {
- return insertJobExecutionEventWhenSuccess(jobExecutionEvent);
- }
- result = true;
- } catch (final SQLException ex) {
- // TODO log failure directly to output log, consider to be configurable in the future
- log.error(ex.getMessage());
- }
- return result;
- }
-
- private boolean insertJobExecutionEventWhenSuccess(final JobExecutionEvent jobExecutionEvent) {
- boolean result = false;
- String sql = "INSERT INTO `" + TABLE_JOB_EXECUTION_LOG + "` (`id`, `job_name`, `task_id`, `hostname`, `ip`, `sharding_item`, `execution_source`, `is_success`, `start_time`, `complete_time`) "
- + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
- 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.execute();
- result = true;
- } catch (final SQLException ex) {
- if (isDuplicateRecord(ex)) {
- return updateJobExecutionEventWhenSuccess(jobExecutionEvent);
- }
- // TODO log failure directly to output log, consider to be configurable in the future
- log.error(ex.getMessage());
- }
- return result;
- }
-
- private boolean updateJobExecutionEventFailure(final JobExecutionEvent jobExecutionEvent) {
- boolean result = false;
- String sql = "UPDATE `" + TABLE_JOB_EXECUTION_LOG + "` SET `is_success` = ?, `complete_time` = ?, `failure_cause` = ? WHERE id = ?";
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
- preparedStatement.setBoolean(1, jobExecutionEvent.isSuccess());
- preparedStatement.setTimestamp(2, new Timestamp(jobExecutionEvent.getCompleteTime().getTime()));
- preparedStatement.setString(3, truncateString(jobExecutionEvent.getFailureCause()));
- preparedStatement.setString(4, jobExecutionEvent.getId());
- if (0 == preparedStatement.executeUpdate()) {
- return insertJobExecutionEventWhenFailure(jobExecutionEvent);
- }
- result = true;
- } catch (final SQLException ex) {
- // TODO log failure directly to output log, consider to be configurable in the future
- log.error(ex.getMessage());
- }
- return result;
- }
-
- private boolean insertJobExecutionEventWhenFailure(final JobExecutionEvent jobExecutionEvent) {
- boolean result = false;
- String sql = "INSERT INTO `" + TABLE_JOB_EXECUTION_LOG + "` (`id`, `job_name`, `task_id`, `hostname`, `ip`, `sharding_item`, `execution_source`, `failure_cause`, `is_success`, `start_time`) "
- + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
- 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.execute();
- result = true;
- } catch (final SQLException ex) {
- if (isDuplicateRecord(ex)) {
- return updateJobExecutionEventFailure(jobExecutionEvent);
- }
- // TODO log failure directly to output log, consider to be configurable in the future
- log.error(ex.getMessage());
- }
- return result;
- }
-
- boolean addJobStatusTraceEvent(final JobStatusTraceEvent jobStatusTraceEvent) {
- String originalTaskId = jobStatusTraceEvent.getOriginalTaskId();
- if (JobStatusTraceEvent.State.TASK_STAGING != jobStatusTraceEvent.getState()) {
- originalTaskId = getOriginalTaskId(jobStatusTraceEvent.getTaskId());
- }
- boolean result = false;
- String sql = "INSERT INTO `" + TABLE_JOB_STATUS_TRACE_LOG + "` (`id`, `job_name`, `original_task_id`, `task_id`, `slave_id`, `source`, `execution_type`, `sharding_item`, "
- + "`state`, `message`, `creation_time`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);";
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql)) {
- preparedStatement.setString(1, UUID.randomUUID().toString());
- preparedStatement.setString(2, jobStatusTraceEvent.getJobName());
- 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().name());
- 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.execute();
- result = true;
- } catch (final SQLException ex) {
- // TODO log failure directly to output log, consider to be configurable in the future
- log.error(ex.getMessage());
- }
- return result;
- }
-
- private String getOriginalTaskId(final String taskId) {
- String sql = String.format("SELECT original_task_id FROM %s WHERE task_id = '%s' and state='%s' LIMIT 1", TABLE_JOB_STATUS_TRACE_LOG, taskId, JobStatusTraceEvent.State.TASK_STAGING);
- String result = "";
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql);
- ResultSet resultSet = preparedStatement.executeQuery()
- ) {
- if (resultSet.next()) {
- return resultSet.getString("original_task_id");
- }
- } catch (final SQLException ex) {
- // TODO log failure directly to output log, consider to be configurable in the future
- log.error(ex.getMessage());
- }
- return result;
- }
-
- private String truncateString(final String str) {
- return !Strings.isNullOrEmpty(str) && str.length() > 4000 ? str.substring(0, 4000) : str;
- }
-
- List<JobStatusTraceEvent> getJobStatusTraceEvents(final String taskId) {
- String sql = String.format("SELECT * FROM %s WHERE task_id = '%s'", TABLE_JOB_STATUS_TRACE_LOG, taskId);
- List<JobStatusTraceEvent> result = new ArrayList<>();
- try (
- Connection conn = dataSource.getConnection();
- PreparedStatement preparedStatement = conn.prepareStatement(sql);
- 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)), ExecutionType.valueOf(resultSet.getString(7)), resultSet.getString(8),
- JobStatusTraceEvent.State.valueOf(resultSet.getString(9)), resultSet.getString(10), new SimpleDateFormat("yyyy-mm-dd HH:MM:SS").parse(resultSet.getString(11)));
- 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/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobExecutionEvent.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobExecutionEvent.java
deleted file mode 100755
index 931c656..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobExecutionEvent.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.event.type;
-
-import org.apache.shardingsphere.elasticjob.cloud.exception.ExceptionUtil;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEvent;
-import org.apache.shardingsphere.elasticjob.cloud.util.env.IpUtils;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import lombok.Setter;
-
-import java.util.Date;
-import java.util.UUID;
-
-/**
- * Job execution event.
- */
-@RequiredArgsConstructor
-@AllArgsConstructor
-@Getter
-public final class JobExecutionEvent implements JobEvent {
-
- private String id = UUID.randomUUID().toString();
-
- private String hostname = IpUtils.getHostName();
-
- private String ip = IpUtils.getIp();
-
- private final String taskId;
-
- private final String jobName;
-
- private final ExecutionSource source;
-
- private final int shardingItem;
-
- private Date startTime = new Date();
-
- @Setter
- private Date completeTime;
-
- @Setter
- private boolean success;
-
- @Setter
- private JobExecutionEventThrowable failureCause;
-
- /**
- * Execution success.
- *
- * @return job execution event
- */
- public JobExecutionEvent executionSuccess() {
- JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, failureCause);
- result.setCompleteTime(new Date());
- result.setSuccess(true);
- return result;
- }
-
- /**
- * execution failure.
- *
- * @param failureCause failure cause
- * @return job execution event
- */
- public JobExecutionEvent executionFailure(final Throwable failureCause) {
- JobExecutionEvent result = new JobExecutionEvent(id, hostname, ip, taskId, jobName, source, shardingItem, startTime, completeTime, success, new JobExecutionEventThrowable(failureCause));
- result.setCompleteTime(new Date());
- result.setSuccess(false);
- return result;
- }
-
- /**
- * Get failure cause.
- *
- * @return failure cause
- */
- public String getFailureCause() {
- return ExceptionUtil.transform(failureCause == null ? null : failureCause.getThrowable());
- }
-
- /**
- * Execution source.
- */
- public enum ExecutionSource {
- NORMAL_TRIGGER, MISFIRE, FAILOVER
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobExecutionEventThrowable.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobExecutionEventThrowable.java
deleted file mode 100755
index a0d0a17..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobExecutionEventThrowable.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.event.type;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import lombok.ToString;
-
-/**
- * Job execution event throwable.
- */
-@RequiredArgsConstructor
-@AllArgsConstructor
-@Getter
-@ToString(of = "plainText")
-public final class JobExecutionEventThrowable {
-
- private final Throwable throwable;
-
- private String plainText;
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobStatusTraceEvent.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobStatusTraceEvent.java
deleted file mode 100755
index 70f1229..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/type/JobStatusTraceEvent.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.event.type;
-
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEvent;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-import lombok.Setter;
-
-import java.util.Date;
-import java.util.UUID;
-
-/**
- * Job status trace event.
- */
-@RequiredArgsConstructor
-@AllArgsConstructor
-@Getter
-public final class JobStatusTraceEvent implements JobEvent {
-
- private String id = UUID.randomUUID().toString();
-
- private final String jobName;
-
- @Setter
- private String originalTaskId = "";
-
- private final String taskId;
-
- private final String slaveId;
-
- private final Source source;
-
- private final ExecutionType executionType;
-
- private final String shardingItems;
-
- private final State state;
-
- private final String message;
-
- private Date creationTime = new Date();
-
- 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-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/AbstractElasticJobExecutor.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/AbstractElasticJobExecutor.java
index 8e0d2a3..8d6b5f2 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/AbstractElasticJobExecutor.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/AbstractElasticJobExecutor.java
@@ -17,20 +17,22 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.cloud.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.cloud.exception.ExceptionUtil;
-import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobExceptionHandler;
import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.cloud.exception.ExceptionUtil;
import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.executor.handler.ExecutorServiceHandler;
import org.apache.shardingsphere.elasticjob.cloud.executor.handler.ExecutorServiceHandlerRegistry;
+import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobExceptionHandler;
import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobProperties;
-import lombok.AccessLevel;
-import lombok.Getter;
-import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.elasticjob.cloud.util.env.IpUtils;
+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 java.util.Collection;
import java.util.Map;
@@ -100,11 +102,11 @@ public abstract class AbstractElasticJobExecutor {
}
ShardingContexts shardingContexts = jobFacade.getShardingContexts();
if (shardingContexts.isAllowSendJobEvent()) {
- jobFacade.postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_STAGING, String.format("Job '%s' execute begin.", jobName));
+ jobFacade.postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, String.format("Job '%s' execute begin.", jobName));
}
if (jobFacade.misfireIfRunning(shardingContexts.getShardingItemParameters().keySet())) {
if (shardingContexts.isAllowSendJobEvent()) {
- jobFacade.postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_FINISHED, String.format(
+ jobFacade.postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, String.format(
"Previous job '%s' - shardingItems '%s' is still running, misfired job will start after previous job completed.", jobName,
shardingContexts.getShardingItemParameters().keySet()));
}
@@ -117,10 +119,10 @@ public abstract class AbstractElasticJobExecutor {
//CHECKSTYLE:ON
jobExceptionHandler.handleException(jobName, cause);
}
- execute(shardingContexts, JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER);
+ execute(shardingContexts, ExecutionSource.NORMAL_TRIGGER);
while (jobFacade.isExecuteMisfired(shardingContexts.getShardingItemParameters().keySet())) {
jobFacade.clearMisfire(shardingContexts.getShardingItemParameters().keySet());
- execute(shardingContexts, JobExecutionEvent.ExecutionSource.MISFIRE);
+ execute(shardingContexts, ExecutionSource.MISFIRE);
}
jobFacade.failoverIfNecessary();
try {
@@ -132,17 +134,17 @@ public abstract class AbstractElasticJobExecutor {
}
}
- private void execute(final ShardingContexts shardingContexts, final JobExecutionEvent.ExecutionSource executionSource) {
+ private void execute(final ShardingContexts shardingContexts, final ExecutionSource executionSource) {
if (shardingContexts.getShardingItemParameters().isEmpty()) {
if (shardingContexts.isAllowSendJobEvent()) {
- jobFacade.postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_FINISHED, String.format("Sharding item for job '%s' is empty.", jobName));
+ jobFacade.postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, String.format("Sharding item for job '%s' is empty.", jobName));
}
return;
}
jobFacade.registerJobBegin(shardingContexts);
String taskId = shardingContexts.getTaskId();
if (shardingContexts.isAllowSendJobEvent()) {
- jobFacade.postJobStatusTraceEvent(taskId, JobStatusTraceEvent.State.TASK_RUNNING, "");
+ jobFacade.postJobStatusTraceEvent(taskId, State.TASK_RUNNING, "");
}
try {
process(shardingContexts, executionSource);
@@ -151,39 +153,35 @@ public abstract class AbstractElasticJobExecutor {
jobFacade.registerJobCompleted(shardingContexts);
if (itemErrorMessages.isEmpty()) {
if (shardingContexts.isAllowSendJobEvent()) {
- jobFacade.postJobStatusTraceEvent(taskId, JobStatusTraceEvent.State.TASK_FINISHED, "");
+ jobFacade.postJobStatusTraceEvent(taskId, State.TASK_FINISHED, "");
}
} else {
if (shardingContexts.isAllowSendJobEvent()) {
- jobFacade.postJobStatusTraceEvent(taskId, JobStatusTraceEvent.State.TASK_ERROR, itemErrorMessages.toString());
+ jobFacade.postJobStatusTraceEvent(taskId, State.TASK_ERROR, itemErrorMessages.toString());
}
}
}
}
- private void process(final ShardingContexts shardingContexts, final JobExecutionEvent.ExecutionSource executionSource) {
+ private void process(final ShardingContexts shardingContexts, final ExecutionSource executionSource) {
Collection<Integer> items = shardingContexts.getShardingItemParameters().keySet();
if (1 == items.size()) {
int item = shardingContexts.getShardingItemParameters().keySet().iterator().next();
- JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(shardingContexts.getTaskId(), jobName, executionSource, item);
+ JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(IpUtils.getHostName(), IpUtils.getIp(), shardingContexts.getTaskId(), jobName, executionSource, item);
process(shardingContexts, item, jobExecutionEvent);
return;
}
final CountDownLatch latch = new CountDownLatch(items.size());
for (final int each : items) {
- final JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(shardingContexts.getTaskId(), jobName, executionSource, each);
+ final JobExecutionEvent jobExecutionEvent = new JobExecutionEvent(IpUtils.getHostName(), IpUtils.getIp(), shardingContexts.getTaskId(), jobName, executionSource, each);
if (executorService.isShutdown()) {
return;
}
- executorService.submit(new Runnable() {
-
- @Override
- public void run() {
- try {
- process(shardingContexts, each, jobExecutionEvent);
- } finally {
- latch.countDown();
- }
+ executorService.submit(() -> {
+ try {
+ process(shardingContexts, each, jobExecutionEvent);
+ } finally {
+ latch.countDown();
}
});
}
@@ -210,9 +208,10 @@ public abstract class AbstractElasticJobExecutor {
// CHECKSTYLE:OFF
} catch (final Throwable cause) {
// CHECKSTYLE:ON
- completeEvent = startEvent.executionFailure(cause);
+ String errorMessage = ExceptionUtil.transform(cause);
+ completeEvent = startEvent.executionFailure(errorMessage);
jobFacade.postJobExecutionEvent(completeEvent);
- itemErrorMessages.put(item, ExceptionUtil.transform(cause));
+ itemErrorMessages.put(item, errorMessage);
jobExceptionHandler.handleException(jobName, cause);
}
}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobFacade.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobFacade.java
index 8f00324..424fb7f 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobFacade.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobFacade.java
@@ -18,9 +18,9 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent.State;
import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import java.util.Collection;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/AllCoreTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/AllCoreTests.java
deleted file mode 100755
index 4251621..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/AllCoreTests.java
+++ /dev/null
@@ -1,49 +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 org.apache.shardingsphere.elasticjob.cloud.api.AllApiTests;
-import org.apache.shardingsphere.elasticjob.cloud.executor.AllExecutorTests;
-import org.apache.shardingsphere.elasticjob.cloud.statistics.AllStatisticsTests;
-import org.apache.shardingsphere.elasticjob.cloud.config.AllConfigTests;
-import org.apache.shardingsphere.elasticjob.cloud.context.AllContextTests;
-import org.apache.shardingsphere.elasticjob.cloud.event.AllEventTests;
-import org.apache.shardingsphere.elasticjob.cloud.exception.AllExceptionTests;
-import org.apache.shardingsphere.elasticjob.cloud.reg.AllRegTests;
-import org.apache.shardingsphere.elasticjob.cloud.util.AllUtilTests;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- AllRegTests.class,
- AllContextTests.class,
- AllApiTests.class,
- AllConfigTests.class,
- AllExecutorTests.class,
- AllEventTests.class,
- AllExceptionTests.class,
- AllStatisticsTests.class,
- AllUtilTests.class
- })
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllCoreTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/api/AllApiTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/api/AllApiTests.java
deleted file mode 100755
index 312f511..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/api/AllApiTests.java
+++ /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.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.api;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses(ShardingContextTest.class)
-public final class AllApiTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/AllConfigTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/AllConfigTests.java
deleted file mode 100755
index 6044682..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/config/AllConfigTests.java
+++ /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.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.config;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses(JobCoreConfigurationTest.class)
-public final class AllConfigTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/context/AllContextTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/context/AllContextTests.java
deleted file mode 100755
index aeaabed..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/context/AllContextTests.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.context;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(TaskContextTest.class)
-public final class AllContextTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/AllEventTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/AllEventTests.java
deleted file mode 100755
index d50c85c..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/AllEventTests.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.event;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfigurationTest;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbIdentityTest;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbListenerTest;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbSearchTest;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbStorageTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- JobExecutionEventTest.class,
- JobEventBusTest.class,
- JobEventRdbIdentityTest.class,
- JobEventRdbConfigurationTest.class,
- JobEventRdbListenerTest.class,
- JobEventRdbStorageTest.class,
- JobEventRdbSearchTest.class
- })
-public final class AllEventTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventBusTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventBusTest.java
deleted file mode 100755
index a45ca39..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/JobEventBusTest.java
+++ /dev/null
@@ -1,76 +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.event;
-
-import com.google.common.eventbus.EventBus;
-import org.apache.shardingsphere.elasticjob.cloud.event.fixture.JobEventCaller;
-import org.apache.shardingsphere.elasticjob.cloud.event.fixture.TestJobEventConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.fixture.TestJobEventListener;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.fixture.TestJobEventFailureConfiguration;
-import org.hamcrest.core.Is;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentMatchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.unitils.util.ReflectionUtils;
-
-@RunWith(MockitoJUnitRunner.class)
-public final class JobEventBusTest {
-
- @Mock
- private JobEventCaller jobEventCaller;
-
- @Mock
- private EventBus eventBus;
-
- private JobEventBus jobEventBus;
-
- @Test
- public void assertRegisterFailure() throws NoSuchFieldException {
- jobEventBus = new JobEventBus(new TestJobEventFailureConfiguration());
- assertIsRegistered(false);
- }
-
- @Test
- public void assertPost() throws InterruptedException, NoSuchFieldException {
- jobEventBus = new JobEventBus(new TestJobEventConfiguration(jobEventCaller));
- assertIsRegistered(true);
- jobEventBus.post(new JobExecutionEvent("fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0));
- while (!TestJobEventListener.isExecutionEventCalled()) {
- Thread.sleep(100L);
- }
- Mockito.verify(jobEventCaller).call();
- }
-
- @Test
- public void assertPostWithoutListener() throws NoSuchFieldException {
- jobEventBus = new JobEventBus();
- assertIsRegistered(false);
- ReflectionUtils.setFieldValue(jobEventBus, "eventBus", eventBus);
- jobEventBus.post(new JobExecutionEvent("fake_task_id", "test_event_bus_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0));
- Mockito.verify(eventBus, Mockito.times(0)).post(ArgumentMatchers.<JobEvent>any());
- }
-
- private void assertIsRegistered(final boolean actual) throws NoSuchFieldException {
- Assert.assertThat((boolean) ReflectionUtils.getFieldValue(jobEventBus, JobEventBus.class.getDeclaredField("isRegistered")), Is.is(actual));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/JobExecutionEventTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/JobExecutionEventTest.java
deleted file mode 100755
index f5284c6..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/JobExecutionEventTest.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.cloud.event;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.hamcrest.CoreMatchers;
-import org.hamcrest.core.Is;
-import org.junit.Assert;
-import org.junit.Test;
-
-public final class JobExecutionEventTest {
-
- @Test
- public void assertNewJobExecutionEvent() {
- JobExecutionEvent actual = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- Assert.assertThat(actual.getJobName(), Is.is("test_job"));
- Assert.assertThat(actual.getSource(), Is.is(JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER));
- Assert.assertThat(actual.getShardingItem(), Is.is(0));
- Assert.assertNotNull(actual.getHostname());
- Assert.assertNotNull(actual.getStartTime());
- Assert.assertNull(actual.getCompleteTime());
- Assert.assertFalse(actual.isSuccess());
- Assert.assertThat(actual.getFailureCause(), Is.is(""));
- }
-
- @Test
- public void assertExecutionSuccess() {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- JobExecutionEvent successEvent = startEvent.executionSuccess();
- Assert.assertNotNull(successEvent.getCompleteTime());
- Assert.assertTrue(successEvent.isSuccess());
- }
-
- @Test
- public void assertExecutionFailure() {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- JobExecutionEvent failureEvent = startEvent.executionFailure(new RuntimeException("failure"));
- Assert.assertNotNull(failureEvent.getCompleteTime());
- Assert.assertFalse(failureEvent.isSuccess());
- Assert.assertThat(failureEvent.getFailureCause(), CoreMatchers.startsWith("java.lang.RuntimeException: failure"));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventConfiguration.java
deleted file mode 100755
index 4f6cd5b..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventConfiguration.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.event.fixture;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListener;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListenerConfigurationException;
-import lombok.RequiredArgsConstructor;
-
-@RequiredArgsConstructor
-public final class TestJobEventConfiguration extends TestJobEventIdentity implements JobEventConfiguration {
-
- private final JobEventCaller jobEventCaller;
-
- @Override
- public JobEventListener createJobEventListener() throws JobEventListenerConfigurationException {
- return new TestJobEventListener(jobEventCaller);
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventFailureConfiguration.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventFailureConfiguration.java
deleted file mode 100755
index 43decde..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventFailureConfiguration.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.event.fixture;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListener;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListenerConfigurationException;
-
-public final class TestJobEventFailureConfiguration extends TestJobEventIdentity implements JobEventConfiguration {
-
- @Override
- public JobEventListener createJobEventListener() throws JobEventListenerConfigurationException {
- throw new JobEventListenerConfigurationException(new RuntimeException("assert failure"));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventIdentity.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventIdentity.java
deleted file mode 100755
index 75bc221..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventIdentity.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.event.fixture;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventIdentity;
-
-public class TestJobEventIdentity implements JobEventIdentity {
-
- @Override
- public String getIdentity() {
- return "test";
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventListener.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventListener.java
deleted file mode 100755
index 096337d..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/TestJobEventListener.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.event.fixture;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListener;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import lombok.Getter;
-import lombok.RequiredArgsConstructor;
-
-@RequiredArgsConstructor
-public final class TestJobEventListener extends TestJobEventIdentity implements JobEventListener {
-
- @Getter
- private static volatile boolean executionEventCalled;
-
- private final JobEventCaller jobEventCaller;
-
- @Override
- public void listen(final JobExecutionEvent jobExecutionEvent) {
- jobEventCaller.call();
- executionEventCalled = true;
- }
-
- @Override
- public void listen(final JobStatusTraceEvent jobStatusTraceEvent) {
- jobEventCaller.call();
- }
-
- /**
- * Reset the event.
- */
- public static void reset() {
- executionEventCalled = false;
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbConfigurationTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbConfigurationTest.java
deleted file mode 100755
index b52d827..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbConfigurationTest.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.event.rdb;
-
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListenerConfigurationException;
-import org.apache.commons.dbcp.BasicDataSource;
-import org.hamcrest.CoreMatchers;
-import org.hamcrest.core.Is;
-import org.junit.Assert;
-import org.junit.Test;
-
-public final class JobEventRdbConfigurationTest {
-
- @Test
- public void assertGetDataSource() throws JobEventListenerConfigurationException {
- BasicDataSource dataSource = new BasicDataSource();
- dataSource.setDriverClassName(org.h2.Driver.class.getName());
- dataSource.setUrl("jdbc:h2:mem:job_event_storage");
- dataSource.setUsername("sa");
- dataSource.setPassword("");
- Assert.assertThat((BasicDataSource) (new JobEventRdbConfiguration(dataSource).getDataSource()), Is.is(dataSource));
- }
-
- @Test
- public void assertCreateJobEventListenerSuccess() throws JobEventListenerConfigurationException {
- BasicDataSource dataSource = new BasicDataSource();
- dataSource.setDriverClassName(org.h2.Driver.class.getName());
- dataSource.setUrl("jdbc:h2:mem:job_event_storage");
- dataSource.setUsername("sa");
- dataSource.setPassword("");
- Assert.assertThat(new JobEventRdbConfiguration(dataSource).createJobEventListener(), CoreMatchers.instanceOf(JobEventRdbListener.class));
- }
-
- @Test(expected = JobEventListenerConfigurationException.class)
- public void assertCreateJobEventListenerFailure() throws JobEventListenerConfigurationException {
- new JobEventRdbConfiguration(new BasicDataSource()).createJobEventListener();
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentityTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentityTest.java
deleted file mode 100755
index 5a70e6a..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbIdentityTest.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.event.rdb;
-
-import org.hamcrest.core.Is;
-import org.junit.Assert;
-import org.junit.Test;
-
-public final class JobEventRdbIdentityTest {
-
- @Test
- public void assertGetIdentity() {
- Assert.assertThat(new JobEventRdbIdentity().getIdentity(), Is.is("rdb"));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbListenerTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbListenerTest.java
deleted file mode 100755
index 93865a1..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbListenerTest.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.event.rdb;
-
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventListenerConfigurationException;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import org.apache.commons.dbcp.BasicDataSource;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
-import org.unitils.util.ReflectionUtils;
-
-import java.sql.SQLException;
-
-import static org.mockito.Mockito.atMost;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
-
-@RunWith(MockitoJUnitRunner.class)
-public final class JobEventRdbListenerTest {
-
- private static final String JOB_NAME = "test_rdb_event_listener";
-
- @Mock
- private JobEventRdbConfiguration jobEventRdbConfiguration;
-
- @Mock
- private JobEventRdbStorage repository;
-
- private JobEventBus jobEventBus;
-
- @Before
- public void setUp() throws JobEventListenerConfigurationException, SQLException, NoSuchFieldException {
- BasicDataSource dataSource = new BasicDataSource();
- dataSource.setDriverClassName(org.h2.Driver.class.getName());
- dataSource.setUrl("jdbc:h2:mem:job_event_storage");
- dataSource.setUsername("sa");
- dataSource.setPassword("");
- JobEventRdbListener jobEventRdbListener = new JobEventRdbListener(dataSource);
- ReflectionUtils.setFieldValue(jobEventRdbListener, "repository", repository);
- when(jobEventRdbConfiguration.createJobEventListener()).thenReturn(jobEventRdbListener);
- jobEventBus = new JobEventBus(jobEventRdbConfiguration);
- }
-
- @Test
- public void assertPostJobExecutionEvent() {
- JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("fake_task_id", JOB_NAME, JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- jobEventBus.post(jobExecutionEvent);
- verify(repository, atMost(1)).addJobExecutionEvent(jobExecutionEvent);
- }
-
- @Test
- public void assertPostJobStatusTraceEvent() {
- JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(
- JOB_NAME, "fake_task_id", "fake_slave_id", JobStatusTraceEvent.Source.LITE_EXECUTOR, ExecutionType.READY, "0", JobStatusTraceEvent.State.TASK_RUNNING, "message is empty.");
- jobEventBus.post(jobStatusTraceEvent);
- verify(repository, atMost(1)).addJobStatusTraceEvent(jobStatusTraceEvent);
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbSearchTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbSearchTest.java
deleted file mode 100755
index a1b3b24..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbSearchTest.java
+++ /dev/null
@@ -1,241 +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.event.rdb;
-
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import org.apache.commons.dbcp.BasicDataSource;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.sql.SQLException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class JobEventRdbSearchTest {
-
- private static JobEventRdbStorage storage;
-
- private static JobEventRdbSearch repository;
-
- @BeforeClass
- public static void setUpClass() throws SQLException {
- BasicDataSource dataSource = new BasicDataSource();
- dataSource.setDriverClassName(org.h2.Driver.class.getName());
- dataSource.setUrl("jdbc:h2:mem:");
- dataSource.setUsername("sa");
- dataSource.setPassword("");
- storage = new JobEventRdbStorage(dataSource);
- repository = new JobEventRdbSearch(dataSource);
- initStorage();
- }
-
- private static void initStorage() {
- for (int i = 1; i <= 500; i++) {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job_" + i, JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- storage.addJobExecutionEvent(startEvent);
- if (i % 2 == 0) {
- JobExecutionEvent successEvent = startEvent.executionSuccess();
- storage.addJobExecutionEvent(successEvent);
- }
- storage.addJobStatusTraceEvent(
- new JobStatusTraceEvent("test_job_" + i, "fake_failed_failover_task_id", "fake_slave_id",
- JobStatusTraceEvent.Source.LITE_EXECUTOR, ExecutionType.FAILOVER, "0", JobStatusTraceEvent.State.TASK_FAILED, "message is empty."));
- }
- }
-
- @Test
- public void assertFindJobExecutionEventsWithPageSizeAndNumber() {
- JobEventRdbSearch.Result<JobExecutionEvent> result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(50, 1, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(50));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(100, 5, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(100));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(100, 6, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(0));
- }
-
- @Test
- public void assertFindJobExecutionEventsWithErrorPageSizeAndNumber() {
- JobEventRdbSearch.Result<JobExecutionEvent> result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(-1, -1, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-
- @Test
- public void assertFindJobExecutionEventsWithSort() {
- JobEventRdbSearch.Result<JobExecutionEvent> result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, "jobName", "ASC", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- assertThat(result.getRows().get(0).getJobName(), is("test_job_1"));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, "jobName", "DESC", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- assertThat(result.getRows().get(0).getJobName(), is("test_job_99"));
- }
-
- @Test
- public void assertFindJobExecutionEventsWithErrorSort() {
- JobEventRdbSearch.Result<JobExecutionEvent> result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, "jobName", "ERROR_SORT", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- assertThat(result.getRows().get(0).getJobName(), is("test_job_1"));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, "notExistField", "ASC", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-
- @Test
- public void assertFindJobExecutionEventsWithTime() {
- Date now = new Date();
- Date tenMinutesBefore = new Date(now.getTime() - 10 * 60 * 1000);
- JobEventRdbSearch.Result<JobExecutionEvent> result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, tenMinutesBefore, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, now, null, null));
- assertThat(result.getTotal(), is(0));
- assertThat(result.getRows().size(), is(0));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, tenMinutesBefore, null));
- assertThat(result.getTotal(), is(0));
- assertThat(result.getRows().size(), is(0));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, now, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, tenMinutesBefore, now, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-
- @Test
- public void assertFindJobExecutionEventsWithFields() {
- Map<String, Object> fields = new HashMap<>();
- fields.put("isSuccess", "1");
- JobEventRdbSearch.Result<JobExecutionEvent> result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, null, fields));
- assertThat(result.getTotal(), is(250));
- assertThat(result.getRows().size(), is(10));
- fields.put("isSuccess", null);
- fields.put("jobName", "test_job_1");
- result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, null, fields));
- assertThat(result.getTotal(), is(1));
- assertThat(result.getRows().size(), is(1));
- }
-
- @Test
- public void assertFindJobExecutionEventsWithErrorFields() {
- Map<String, Object> fields = new HashMap<>();
- fields.put("notExistField", "some value");
- JobEventRdbSearch.Result<JobExecutionEvent> result = repository.findJobExecutionEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, null, fields));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-
- @Test
- public void assertFindJobStatusTraceEventsWithPageSizeAndNumber() {
- JobEventRdbSearch.Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(50, 1, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(50));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(100, 5, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(100));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(100, 6, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(0));
- }
-
- @Test
- public void assertFindJobStatusTraceEventsWithErrorPageSizeAndNumber() {
- JobEventRdbSearch.Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(-1, -1, null, null, null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-
- @Test
- public void assertFindJobStatusTraceEventsWithSort() {
- JobEventRdbSearch.Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, "jobName", "ASC", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- assertThat(result.getRows().get(0).getJobName(), is("test_job_1"));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, "jobName", "DESC", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- assertThat(result.getRows().get(0).getJobName(), is("test_job_99"));
- }
-
- @Test
- public void assertFindJobStatusTraceEventsWithErrorSort() {
- JobEventRdbSearch.Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, "jobName", "ERROR_SORT", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- assertThat(result.getRows().get(0).getJobName(), is("test_job_1"));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, "notExistField", "ASC", null, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-
- @Test
- public void assertFindJobStatusTraceEventsWithTime() {
- Date now = new Date();
- Date tenMinutesBefore = new Date(now.getTime() - 10 * 60 * 1000);
- JobEventRdbSearch.Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, tenMinutesBefore, null, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, now, null, null));
- assertThat(result.getTotal(), is(0));
- assertThat(result.getRows().size(), is(0));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, tenMinutesBefore, null));
- assertThat(result.getTotal(), is(0));
- assertThat(result.getRows().size(), is(0));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, now, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, tenMinutesBefore, now, null));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-
- @Test
- public void assertFindJobStatusTraceEventsWithFields() {
- Map<String, Object> fields = new HashMap<>();
- fields.put("jobName", "test_job_1");
- JobEventRdbSearch.Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, null, fields));
- assertThat(result.getTotal(), is(1));
- assertThat(result.getRows().size(), is(1));
- }
-
- @Test
- public void assertFindJobStatusTraceEventsWithErrorFields() {
- Map<String, Object> fields = new HashMap<>();
- fields.put("notExistField", "some value");
- JobEventRdbSearch.Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new JobEventRdbSearch.Condition(10, 1, null, null, null, null, fields));
- assertThat(result.getTotal(), is(500));
- assertThat(result.getRows().size(), is(10));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbStorageTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbStorageTest.java
deleted file mode 100755
index c549576..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbStorageTest.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.event.rdb;
-
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import org.apache.commons.dbcp.BasicDataSource;
-import org.hamcrest.CoreMatchers;
-import org.hamcrest.core.Is;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.sql.SQLException;
-import java.util.List;
-
-public class JobEventRdbStorageTest {
-
- private JobEventRdbStorage storage;
-
- @Before
- public void setup() throws SQLException {
- BasicDataSource dataSource = new BasicDataSource();
- dataSource.setDriverClassName(org.h2.Driver.class.getName());
- dataSource.setUrl("jdbc:h2:mem:job_event_storage");
- dataSource.setUsername("sa");
- dataSource.setPassword("");
- storage = new JobEventRdbStorage(dataSource);
- }
-
- @Test
- public void assertAddJobExecutionEvent() throws SQLException {
- Assert.assertTrue(storage.addJobExecutionEvent(new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0)));
- }
-
- @Test
- public void assertAddJobStatusTraceEvent() throws SQLException {
- Assert.assertTrue(storage.addJobStatusTraceEvent(new JobStatusTraceEvent("test_job", "fake_task_id", "fake_slave_id", JobStatusTraceEvent.Source.LITE_EXECUTOR, ExecutionType.READY, "0",
- JobStatusTraceEvent.State.TASK_RUNNING, "message is empty.")));
- }
-
- @Test
- public void assertAddJobStatusTraceEventWhenFailoverWithTaskStagingState() throws SQLException {
- JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent("test_job", "fake_failover_task_id", "fake_slave_id", JobStatusTraceEvent.Source.LITE_EXECUTOR, ExecutionType.FAILOVER, "0",
- JobStatusTraceEvent.State.TASK_STAGING, "message is empty.");
- jobStatusTraceEvent.setOriginalTaskId("original_fake_failover_task_id");
- Assert.assertThat(storage.getJobStatusTraceEvents("fake_failover_task_id").size(), Is.is(0));
- storage.addJobStatusTraceEvent(jobStatusTraceEvent);
- Assert.assertThat(storage.getJobStatusTraceEvents("fake_failover_task_id").size(), Is.is(1));
- }
-
- @Test
- public void assertAddJobStatusTraceEventWhenFailoverWithTaskFailedState() throws SQLException {
- JobStatusTraceEvent stagingJobStatusTraceEvent = new JobStatusTraceEvent("test_job", "fake_failed_failover_task_id", "fake_slave_id", JobStatusTraceEvent.Source.LITE_EXECUTOR,
- ExecutionType.FAILOVER, "0", JobStatusTraceEvent.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", JobStatusTraceEvent.Source.LITE_EXECUTOR,
- ExecutionType.FAILOVER, "0", JobStatusTraceEvent.State.TASK_FAILED, "message is empty.");
- storage.addJobStatusTraceEvent(failedJobStatusTraceEvent);
- List<JobStatusTraceEvent> jobStatusTraceEvents = storage.getJobStatusTraceEvents("fake_failed_failover_task_id");
- Assert.assertThat(jobStatusTraceEvents.size(), Is.is(2));
- for (JobStatusTraceEvent jobStatusTraceEvent : jobStatusTraceEvents) {
- Assert.assertThat(jobStatusTraceEvent.getOriginalTaskId(), Is.is("original_fake_failed_failover_task_id"));
- }
- }
-
- @Test
- public void assertUpdateJobExecutionEventWhenSuccess() throws SQLException {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- Assert.assertTrue(storage.addJobExecutionEvent(startEvent));
- JobExecutionEvent successEvent = startEvent.executionSuccess();
- Assert.assertTrue(storage.addJobExecutionEvent(successEvent));
- }
-
- @Test
- public void assertUpdateJobExecutionEventWhenFailure() throws SQLException {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- Assert.assertTrue(storage.addJobExecutionEvent(startEvent));
- JobExecutionEvent failureEvent = startEvent.executionFailure(new RuntimeException("failure"));
- Assert.assertTrue(storage.addJobExecutionEvent(failureEvent));
- Assert.assertThat(failureEvent.getFailureCause(), CoreMatchers.startsWith("java.lang.RuntimeException: failure"));
- Assert.assertTrue(null != failureEvent.getCompleteTime());
- }
-
- @Test
- public void assertUpdateJobExecutionEventWhenSuccessAndConflict() throws SQLException {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- JobExecutionEvent successEvent = startEvent.executionSuccess();
- Assert.assertTrue(storage.addJobExecutionEvent(successEvent));
- Assert.assertFalse(storage.addJobExecutionEvent(startEvent));
- }
-
- @Test
- public void assertUpdateJobExecutionEventWhenFailureAndConflict() throws SQLException {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- JobExecutionEvent failureEvent = startEvent.executionFailure(new RuntimeException("failure"));
- Assert.assertTrue(storage.addJobExecutionEvent(failureEvent));
- Assert.assertThat(failureEvent.getFailureCause(), CoreMatchers.startsWith("java.lang.RuntimeException: failure"));
- Assert.assertFalse(storage.addJobExecutionEvent(startEvent));
- }
-
- @Test
- public void assertUpdateJobExecutionEventWhenFailureAndMessageExceed() throws SQLException {
- JobExecutionEvent startEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
- Assert.assertTrue(storage.addJobExecutionEvent(startEvent));
- StringBuilder failureMsg = new StringBuilder();
- for (int i = 0; i < 600; i++) {
- failureMsg.append(i);
- }
- JobExecutionEvent failEvent = startEvent.executionFailure(new RuntimeException("failure" + failureMsg.toString()));
- Assert.assertTrue(storage.addJobExecutionEvent(failEvent));
- Assert.assertThat(failEvent.getFailureCause(), CoreMatchers.startsWith("java.lang.RuntimeException: failure"));
- }
-
- @Test
- public void assertFindJobExecutionEvent() throws SQLException {
- storage.addJobExecutionEvent(new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/AllExceptionTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/AllExceptionTests.java
deleted file mode 100755
index 0afd576..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/AllExceptionTests.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.exception;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- JobConfigurationExceptionTest.class,
- JobExecutionEnvironmentExceptionTest.class,
- JobSystemExceptionTest.class,
- ExceptionUtilTest.class,
- JobStatisticExceptionTest.class
- })
-public final class AllExceptionTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/AllExecutorTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/AllExecutorTests.java
deleted file mode 100755
index 4afcbfd..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/AllExecutorTests.java
+++ /dev/null
@@ -1,43 +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;
-
-import org.apache.shardingsphere.elasticjob.cloud.executor.handler.ExecutorServiceHandlerRegistryTest;
-import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobPropertiesTest;
-import org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl.DefaultJobExceptionHandlerTest;
-import org.apache.shardingsphere.elasticjob.cloud.executor.type.DataflowJobExecutorTest;
-import org.apache.shardingsphere.elasticjob.cloud.executor.type.ScriptJobExecutorTest;
-import org.apache.shardingsphere.elasticjob.cloud.executor.type.SimpleJobExecutorTest;
-import org.apache.shardingsphere.elasticjob.cloud.executor.type.WrongJobExecutorTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- JobExecutorFactoryTest.class,
- ExecutorServiceHandlerRegistryTest.class,
- JobPropertiesTest.class,
- DefaultJobExceptionHandlerTest.class,
- SimpleJobExecutorTest.class,
- WrongJobExecutorTest.class,
- DataflowJobExecutorTest.class,
- ScriptJobExecutorTest.class
- })
-public final class AllExecutorTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultJobExceptionHandlerTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultJobExceptionHandlerTest.java
index d3003fd..21f1bdb 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultJobExceptionHandlerTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultJobExceptionHandlerTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl;
-import org.apache.shardingsphere.elasticjob.cloud.event.fixture.JobEventCaller;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/JobEventCaller.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/JobEventCaller.java
similarity index 91%
rename from elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/JobEventCaller.java
rename to elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/JobEventCaller.java
index d00cb41..7bfc179 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/event/fixture/JobEventCaller.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/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.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.event.fixture;
+package org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl;
public interface JobEventCaller {
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ElasticJobVerify.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ElasticJobVerify.java
index 72160c7..a591489 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ElasticJobVerify.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ElasticJobVerify.java
@@ -17,12 +17,12 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.type;
-import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
-import org.apache.shardingsphere.elasticjob.cloud.executor.JobFacade;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.cloud.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -43,7 +43,7 @@ final class ElasticJobVerify {
throw new RuntimeException(ex);
}
verify(jobFacade).getShardingContexts();
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_STAGING, "Job 'test_job' execute begin.");
+ verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin.");
verify(jobFacade).misfireIfRunning(shardingContexts.getShardingItemParameters().keySet());
verify(jobFacade).beforeJobExecuted(shardingContexts);
verify(jobFacade).registerJobBegin(shardingContexts);
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/SimpleJobExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/SimpleJobExecutorTest.java
index acad2f5..29f7d90 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/SimpleJobExecutorTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/SimpleJobExecutorTest.java
@@ -17,18 +17,18 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.type;
-import org.apache.shardingsphere.elasticjob.cloud.executor.AbstractElasticJobExecutor;
-import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
-import org.apache.shardingsphere.elasticjob.cloud.fixture.config.TestSimpleJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.cloud.executor.AbstractElasticJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl.DefaultExecutorServiceHandler;
import org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl.DefaultJobExceptionHandler;
import org.apache.shardingsphere.elasticjob.cloud.fixture.ShardingContextsBuilder;
+import org.apache.shardingsphere.elasticjob.cloud.fixture.config.TestSimpleJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.fixture.job.JobCaller;
import org.apache.shardingsphere.elasticjob.cloud.fixture.job.TestSimpleJob;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -57,7 +57,7 @@ public final class SimpleJobExecutorTest {
private SimpleJobExecutor simpleJobExecutor;
@Before
- public void setUp() throws NoSuchFieldException {
+ public void setUp() {
when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration());
simpleJobExecutor = new SimpleJobExecutor(new TestSimpleJob(jobCaller), jobFacade);
}
@@ -85,12 +85,12 @@ public final class SimpleJobExecutorTest {
@Test
public void assertExecuteWhenPreviousJobStillRunning() throws JobExecutionEnvironmentException {
- ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.<Integer, String>emptyMap());
+ ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap());
when(jobFacade.getShardingContexts()).thenReturn(shardingContexts);
when(jobFacade.misfireIfRunning(shardingContexts.getShardingItemParameters().keySet())).thenReturn(true);
simpleJobExecutor.execute();
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_STAGING, "Job 'test_job' execute begin.");
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_FINISHED,
+ 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(jobFacade).checkJobExecutionEnvironment();
verify(jobFacade).getShardingContexts();
@@ -100,11 +100,11 @@ public final class SimpleJobExecutorTest {
@Test
public void assertExecuteWhenShardingItemsIsEmpty() throws JobExecutionEnvironmentException {
- ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.<Integer, String>emptyMap());
+ ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", Collections.emptyMap());
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, shardingContexts);
simpleJobExecutor.execute();
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_STAGING, "Job 'test_job' execute begin.");
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_FINISHED, "Sharding item for job 'test_job' is empty.");
+ 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(jobFacade).checkJobExecutionEnvironment();
verify(jobFacade).getShardingContexts();
verify(jobFacade).misfireIfRunning(shardingContexts.getShardingItemParameters().keySet());
@@ -127,8 +127,8 @@ public final class SimpleJobExecutorTest {
try {
simpleJobExecutor.execute();
} finally {
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_STAGING, "Job 'test_job' execute begin.");
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_RUNNING, "");
+ verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin.");
+ verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_RUNNING, "");
String errorMessage;
String lineSeparator = System.getProperty("line.separator");
if (1 == shardingContexts.getShardingItemParameters().size()) {
@@ -136,7 +136,7 @@ public final class SimpleJobExecutorTest {
} else {
errorMessage = "{0=java.lang.RuntimeException" + lineSeparator + ", 1=java.lang.RuntimeException" + lineSeparator + "}";
}
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_ERROR, errorMessage);
+ verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_ERROR, errorMessage);
verify(jobFacade).checkJobExecutionEnvironment();
verify(jobFacade).getShardingContexts();
verify(jobFacade).misfireIfRunning(shardingContexts.getShardingItemParameters().keySet());
@@ -159,8 +159,8 @@ public final class SimpleJobExecutorTest {
private void assertExecuteWhenRunOnceSuccess(final ShardingContexts shardingContexts) {
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, shardingContexts);
simpleJobExecutor.execute();
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_STAGING, "Job 'test_job' execute begin.");
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_FINISHED, "");
+ verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin.");
+ verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_FINISHED, "");
ElasticJobVerify.verifyForIsNotMisfire(jobFacade, shardingContexts);
verify(jobCaller, times(shardingContexts.getShardingTotalCount())).execute();
}
@@ -193,8 +193,8 @@ public final class SimpleJobExecutorTest {
when(jobFacade.misfireIfRunning(shardingContexts.getShardingItemParameters().keySet())).thenReturn(false);
when(jobFacade.isExecuteMisfired(shardingContexts.getShardingItemParameters().keySet())).thenReturn(true, false);
simpleJobExecutor.execute();
- verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_STAGING, "Job 'test_job' execute begin.");
- verify(jobFacade, times(2)).postJobStatusTraceEvent(shardingContexts.getTaskId(), JobStatusTraceEvent.State.TASK_RUNNING, "");
+ verify(jobFacade).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_STAGING, "Job 'test_job' execute begin.");
+ verify(jobFacade, times(2)).postJobStatusTraceEvent(shardingContexts.getTaskId(), State.TASK_RUNNING, "");
verify(jobFacade).checkJobExecutionEnvironment();
verify(jobFacade).getShardingContexts();
verify(jobFacade).misfireIfRunning(shardingContexts.getShardingItemParameters().keySet());
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java
index 494b5b5..c1ce77c 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/WrongJobExecutorTest.java
@@ -17,11 +17,11 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.type;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
import org.apache.shardingsphere.elasticjob.cloud.executor.JobFacade;
import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.cloud.fixture.config.TestSimpleJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.fixture.job.TestWrongJob;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -43,13 +43,13 @@ public final class WrongJobExecutorTest {
private SimpleJobExecutor wrongSimpleJobExecutor;
@Before
- public void setUp() throws NoSuchFieldException {
+ public void setUp() {
when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestSimpleJobConfiguration());
wrongSimpleJobExecutor = new SimpleJobExecutor(new TestWrongJob(), jobFacade);
}
@Test(expected = RuntimeException.class)
- public void assertWrongJobExecutorWithSingleItem() throws NoSuchFieldException {
+ public void assertWrongJobExecutorWithSingleItem() {
Map<Integer, String> map = new HashMap<>(1, 1);
map.put(0, "A");
ShardingContexts shardingContexts = new ShardingContexts("fake_task_id", "test_job", 10, "", map);
@@ -58,7 +58,7 @@ public final class WrongJobExecutorTest {
}
@Test
- public void assertWrongJobExecutorWithMultipleItems() throws NoSuchFieldException {
+ public void assertWrongJobExecutorWithMultipleItems() {
Map<Integer, String> map = new HashMap<>(1, 1);
map.put(0, "A");
map.put(1, "B");
@@ -66,6 +66,6 @@ public final class WrongJobExecutorTest {
when(jobFacade.getShardingContexts()).thenReturn(shardingContexts);
wrongSimpleJobExecutor.execute();
verify(jobFacade).getShardingContexts();
- verify(jobFacade).postJobStatusTraceEvent("fake_task_id", JobStatusTraceEvent.State.TASK_RUNNING, "");
+ verify(jobFacade).postJobStatusTraceEvent("fake_task_id", State.TASK_RUNNING, "");
}
}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/reg/AllRegTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/reg/AllRegTests.java
deleted file mode 100755
index 7984e6d..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/reg/AllRegTests.java
+++ /dev/null
@@ -1,49 +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.reg;
-
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperRegistryCenterForAuthTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperRegistryCenterModifyTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperRegistryCenterQueryWithoutCacheTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.exception.RegExceptionHandlerTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperConfigurationTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperElectionServiceTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperRegistryCenterInitFailureTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperRegistryCenterMiscellaneousTest;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperRegistryCenterQueryWithCacheTest;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- ZookeeperConfigurationTest.class,
- ZookeeperRegistryCenterForAuthTest.class,
- ZookeeperRegistryCenterQueryWithCacheTest.class,
- ZookeeperRegistryCenterQueryWithoutCacheTest.class,
- ZookeeperRegistryCenterModifyTest.class,
- ZookeeperRegistryCenterMiscellaneousTest.class,
- ZookeeperElectionServiceTest.class,
- RegExceptionHandlerTest.class,
- ZookeeperRegistryCenterInitFailureTest.class
- })
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllRegTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/AllStatisticsTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/AllStatisticsTests.java
deleted file mode 100755
index 3fed7bf..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/statistics/AllStatisticsTests.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.statistics;
-
-import org.apache.shardingsphere.elasticjob.cloud.statistics.rdb.StatisticRdbRepositoryTest;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses(StatisticRdbRepositoryTest.class)
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllStatisticsTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/AllUtilTests.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/AllUtilTests.java
deleted file mode 100755
index feba6ea..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/AllUtilTests.java
+++ /dev/null
@@ -1,49 +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.util;
-
-import org.apache.shardingsphere.elasticjob.cloud.util.concurrent.ExecutorServiceObjectTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.config.ShardingItemParametersTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.config.ShardingItemsTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.digest.EncryptionTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.env.HostExceptionTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.env.IpUtilsTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.env.TimeServiceTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.json.GsonFactoryTest;
-import org.apache.shardingsphere.elasticjob.cloud.util.json.JobConfigurationGsonTypeAdapterTest;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- ExecutorServiceObjectTest.class,
- EncryptionTest.class,
- TimeServiceTest.class,
- IpUtilsTest.class,
- HostExceptionTest.class,
- GsonFactoryTest.class,
- JobConfigurationGsonTypeAdapterTest.class,
- ShardingItemsTest.class,
- ShardingItemParametersTest.class
- })
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllUtilTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/resources/logback-test.xml b/elasticjob-cloud/elasticjob-cloud-common/src/test/resources/logback-test.xml
index 8403c6f..d66e541 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/resources/logback-test.xml
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/resources/logback-test.xml
@@ -36,8 +36,8 @@
<appender-ref ref="STDOUT" />
</root>
- <logger name="org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration" level="OFF" />
- <logger name="org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus" level="OFF" />
+ <logger name="org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration" level="OFF" />
+ <logger name="org.apache.shardingsphere.elasticjob.tracing.JobEventBus" level="OFF" />
<logger name="org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl.DefaultJobExceptionHandler" level="OFF" />
<logger name="org.apache.curator.framework.recipes.leader.LeaderSelector" level="OFF" />
</configuration>
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java
index 95bafe3..068e949 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacade.java
@@ -17,14 +17,15 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
+import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.config.dataflow.DataflowJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
-import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
+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;
@@ -46,7 +47,7 @@ public final class CloudJobFacade implements JobFacade {
}
@Override
- public void checkJobExecutionEnvironment() throws JobExecutionEnvironmentException {
+ public void checkJobExecutionEnvironment() {
}
@Override
@@ -60,11 +61,8 @@ public final class CloudJobFacade implements JobFacade {
@Override
public void registerJobCompleted(final ShardingContexts shardingContexts) {
}
-
- /**
- * Get sharding contexts.
- * @return sharding contexts
- */
+
+ @Override
public ShardingContexts getShardingContexts() {
return shardingContexts;
}
@@ -107,9 +105,9 @@ public final class CloudJobFacade implements JobFacade {
}
@Override
- public void postJobStatusTraceEvent(final String taskId, final JobStatusTraceEvent.State state, final String message) {
+ public void postJobStatusTraceEvent(final String taskId, final State state, final String message) {
TaskContext taskContext = TaskContext.from(taskId);
jobEventBus.post(new JobStatusTraceEvent(taskContext.getMetaInfo().getJobName(), taskContext.getId(), taskContext.getSlaveId(),
- JobStatusTraceEvent.Source.CLOUD_EXECUTOR, taskContext.getType(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), state, message));
+ Source.CLOUD_EXECUTOR, taskContext.getType().toString(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), state, message));
}
}
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutor.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutor.java
index de86cbe..9c67142 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutor.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutor.java
@@ -17,13 +17,6 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
-import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob;
-import org.apache.shardingsphere.elasticjob.cloud.api.script.ScriptJob;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.exception.ExceptionUtil;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
-import org.apache.shardingsphere.elasticjob.cloud.util.concurrent.ExecutorServiceObject;
import com.google.common.base.Strings;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -33,8 +26,16 @@ 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.cloud.api.ElasticJob;
+import org.apache.shardingsphere.elasticjob.cloud.api.script.ScriptJob;
+import org.apache.shardingsphere.elasticjob.cloud.exception.ExceptionUtil;
+import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.cloud.util.concurrent.ExecutorServiceObject;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.springframework.context.support.ClassPathXmlApplicationContext;
+import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
@@ -64,7 +65,7 @@ public final class TaskExecutor implements Executor {
dataSource.setUrl(data.get("event_trace_rdb_url"));
dataSource.setPassword(data.get("event_trace_rdb_password"));
dataSource.setUsername(data.get("event_trace_rdb_username"));
- jobEventBus = new JobEventBus(new JobEventRdbConfiguration(dataSource));
+ jobEventBus = new JobEventBus(new TracingConfiguration<DataSource>("RDB", dataSource));
}
}
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
index 041730c..725634b 100755
--- 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
@@ -17,26 +17,26 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.local;
+import com.google.common.base.Joiner;
+import com.google.common.base.Strings;
+import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
import org.apache.shardingsphere.elasticjob.cloud.api.dataflow.DataflowJob;
import org.apache.shardingsphere.elasticjob.cloud.api.simple.SimpleJob;
import org.apache.shardingsphere.elasticjob.cloud.config.JobCoreConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.config.dataflow.DataflowJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.config.script.ScriptJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
+import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.executor.AbstractElasticJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.CloudJobFacade;
import org.apache.shardingsphere.elasticjob.cloud.executor.JobConfigurationContext;
import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.DataflowJobExecutor;
-import org.apache.shardingsphere.elasticjob.cloud.config.dataflow.DataflowJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.ScriptJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.SimpleJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.util.config.ShardingItemParameters;
-import com.google.common.base.Joiner;
-import com.google.common.base.Strings;
-import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.HashMap;
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/AllCloudExecutorTests.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/AllCloudExecutorTests.java
deleted file mode 100755
index 0f19c8b..0000000
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/AllCloudExecutorTests.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.executor;
-
-import org.apache.shardingsphere.elasticjob.cloud.executor.local.AllLocalExecutorTests;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- CloudJobFacadeTest.class,
- DaemonTaskSchedulerTest.class,
- JobConfigurationContextTest.class,
- TaskExecutorTest.class,
- TaskExecutorThreadTest.class,
- AllLocalExecutorTests.class
- })
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllCloudExecutorTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacadeTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacadeTest.java
index 6f695a8..3f11535 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacadeTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/CloudJobFacadeTest.java
@@ -20,11 +20,10 @@ package org.apache.shardingsphere.elasticjob.cloud.executor;
import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -73,7 +72,7 @@ public class CloudJobFacadeTest {
@Test
public void assertLoadJobRootConfiguration() {
- assertThat(jobFacade.loadJobRootConfiguration(true), is((JobRootConfiguration) jobConfig));
+ assertThat(jobFacade.loadJobRootConfiguration(true), is(jobConfig));
}
@Test
@@ -148,13 +147,13 @@ public class CloudJobFacadeTest {
@Test
public void assertPostJobExecutionEvent() {
- JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
+ JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
jobFacade.postJobExecutionEvent(jobExecutionEvent);
verify(eventBus).post(jobExecutionEvent);
}
@Test
public void assertPostJobStatusTraceEvent() {
- jobFacade.postJobStatusTraceEvent(String.format("%s@-@0@-@%s@-@fake_slave_id@-@0", "test_job", ExecutionType.READY), JobStatusTraceEvent.State.TASK_RUNNING, "message is empty.");
+ 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/AllLocalExecutorTests.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/AllLocalExecutorTests.java
deleted file mode 100755
index 8e41ad0..0000000
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/AllLocalExecutorTests.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.executor.local;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(LocalTaskExecutorTest.class)
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllLocalExecutorTests {
-}
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 aa01cfa..8fc40e4 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
@@ -17,8 +17,6 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.env;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperConfiguration;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
@@ -26,7 +24,10 @@ import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
+import javax.sql.DataSource;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashMap;
@@ -123,11 +124,11 @@ public final class BootstrapEnvironment {
}
/**
- * Get the job event rdb config.
+ * Get tracing configuration.
*
- * @return job event rdb config
+ * @return tracing configuration
*/
- public Optional<JobEventRdbConfiguration> getJobEventRdbConfiguration() {
+ public Optional<TracingConfiguration> 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);
@@ -138,7 +139,7 @@ public final class BootstrapEnvironment {
dataSource.setUrl(url);
dataSource.setUsername(username);
dataSource.setPassword(password);
- return Optional.of(new JobEventRdbConfiguration(dataSource));
+ return Optional.of(new TracingConfiguration<DataSource>("RDB", dataSource));
}
return Optional.absent();
}
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 1767c1f..23d518e 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
@@ -17,17 +17,17 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.FrameworkIDService;
-import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
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.cloud.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.JobEventBus;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import java.util.List;
@@ -83,8 +83,8 @@ public final class SchedulerEngine implements Scheduler {
TaskContext taskContext = TaskContext.from(taskId);
String jobName = taskContext.getMetaInfo().getJobName();
log.trace("call statusUpdate task state is: {}, task id is: {}", taskStatus.getState(), taskId);
- jobEventBus.post(new JobStatusTraceEvent(jobName, taskContext.getId(), taskContext.getSlaveId(), JobStatusTraceEvent.Source.CLOUD_SCHEDULER,
- taskContext.getType(), String.valueOf(taskContext.getMetaInfo().getShardingItems()), JobStatusTraceEvent.State.valueOf(taskStatus.getState().name()), taskStatus.getMessage()));
+ jobEventBus.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()) {
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
index cf94e26..873d653 100755
--- 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
@@ -17,26 +17,24 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.restful.RestfulService;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration;
-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.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.reg.base.CoordinatorRegistryCenter;
import com.google.common.base.Optional;
import com.google.common.util.concurrent.Service;
import com.netflix.fenzo.TaskScheduler;
-import com.netflix.fenzo.VirtualMachineLease;
-import com.netflix.fenzo.functions.Action1;
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.reg.base.CoordinatorRegistryCenter;
+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.restful.RestfulService;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
/**
* Scheduler service.
@@ -68,7 +66,7 @@ public final class SchedulerService {
public SchedulerService(final CoordinatorRegistryCenter regCenter) {
env = BootstrapEnvironment.getInstance();
facadeService = new FacadeService(regCenter);
- statisticManager = StatisticManager.getInstance(regCenter, env.getJobEventRdbConfiguration());
+ statisticManager = StatisticManager.getInstance(regCenter, env.getTracingConfiguration());
TaskScheduler taskScheduler = getTaskScheduler();
JobEventBus jobEventBus = getJobEventBus();
schedulerDriver = getSchedulerDriver(taskScheduler, jobEventBus, new FrameworkIDService(regCenter));
@@ -102,20 +100,16 @@ public final class SchedulerService {
private TaskScheduler getTaskScheduler() {
return new TaskScheduler.Builder()
.withLeaseOfferExpirySecs(1000000000L)
- .withLeaseRejectAction(new Action1<VirtualMachineLease>() {
-
- @Override
- public void call(final VirtualMachineLease lease) {
- log.warn("Declining offer on '{}'", lease.hostname());
- schedulerDriver.declineOffer(lease.getOffer().getId());
- }
+ .withLeaseRejectAction(lease -> {
+ log.warn("Declining offer on '{}'", lease.hostname());
+ schedulerDriver.declineOffer(lease.getOffer().getId());
}).build();
}
private JobEventBus getJobEventBus() {
- Optional<JobEventRdbConfiguration> rdbConfig = env.getJobEventRdbConfiguration();
- if (rdbConfig.isPresent()) {
- return new JobEventBus(rdbConfig.get());
+ Optional<TracingConfiguration> tracingConfiguration = env.getTracingConfiguration();
+ if (tracingConfiguration.isPresent()) {
+ return new JobEventBus(tracingConfiguration.get());
}
return new JobEventBus();
}
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 69c31f8..1edb951 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
@@ -17,23 +17,8 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos;
-import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment;
-import org.apache.shardingsphere.elasticjob.cloud.config.script.ScriptJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
-import org.apache.shardingsphere.elasticjob.cloud.util.json.GsonFactory;
-import org.apache.shardingsphere.elasticjob.cloud.util.config.ShardingItemParameters;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.AbstractScheduledService;
import com.google.protobuf.ByteString;
import com.netflix.fenzo.TaskAssignmentResult;
@@ -49,6 +34,20 @@ 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.api.JobType;
+import org.apache.shardingsphere.elasticjob.cloud.config.script.ScriptJobConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
+import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
+import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnvironment;
+import org.apache.shardingsphere.elasticjob.cloud.util.config.ShardingItemParameters;
+import org.apache.shardingsphere.elasticjob.cloud.util.json.GsonFactory;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
+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;
@@ -87,18 +86,18 @@ public final class TaskLaunchScheduledService extends AbstractScheduledService {
}
@Override
- protected void startUp() throws Exception {
+ protected void startUp() {
log.info("Elastic Job: Start {}", serviceName());
AppConstraintEvaluator.init(facadeService);
}
@Override
- protected void shutDown() throws Exception {
+ protected void shutDown() {
log.info("Elastic Job: Stop {}", serviceName());
}
@Override
- protected void runOneIteration() throws Exception {
+ protected void runOneIteration() {
try {
LaunchingTasks launchingTasks = new LaunchingTasks(facadeService.getEligibleJobContext());
List<TaskRequest> taskRequests = launchingTasks.getPendingTasks();
@@ -209,7 +208,7 @@ public final class TaskLaunchScheduledService extends AbstractScheduledService {
.setValue(taskContext.getExecutorId(jobConfig.getAppName()))).setCommand(command)
.addResources(buildResource("cpus", appConfig.getCpuCount(), offer.getResourcesList()))
.addResources(buildResource("mem", appConfig.getMemoryMB(), offer.getResourcesList()));
- if (env.getJobEventRdbConfiguration().isPresent()) {
+ if (env.getTracingConfiguration().isPresent()) {
executorBuilder.setData(ByteString.copyFrom(SerializationUtils.serialize(env.getJobEventRdbConfigurationMap()))).build();
}
return result.setExecutor(executorBuilder.build()).build();
@@ -238,18 +237,14 @@ public final class TaskLaunchScheduledService extends AbstractScheduledService {
}
private Protos.Resource buildResource(final String type, final double resourceValue, final List<Protos.Resource> resources) {
- return Protos.Resource.newBuilder().mergeFrom(Iterables.find(resources, new Predicate<Protos.Resource>() {
- @Override
- public boolean apply(final Protos.Resource input) {
- return input.getName().equals(type);
- }
- })).setScalar(Protos.Value.Scalar.newBuilder().setValue(resourceValue)).build();
+ 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) {
TaskContext.MetaInfo metaInfo = taskContext.getMetaInfo();
JobStatusTraceEvent result = new JobStatusTraceEvent(metaInfo.getJobName(), taskContext.getId(), taskContext.getSlaveId(),
- JobStatusTraceEvent.Source.CLOUD_SCHEDULER, taskContext.getType(), String.valueOf(metaInfo.getShardingItems()), JobStatusTraceEvent.State.TASK_STAGING, "");
+ Source.CLOUD_SCHEDULER, taskContext.getType().toString(), String.valueOf(metaInfo.getShardingItems()), JobStatusTraceEvent.State.TASK_STAGING, "");
if (ExecutionType.FAILOVER == taskContext.getType()) {
Optional<String> taskContextOptional = facadeService.getFailoverTaskId(metaInfo);
if (taskContextOptional.isPresent()) {
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApi.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApi.java
index edaec0a..2a28c0f 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApi.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApi.java
@@ -17,11 +17,15 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.restful;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.restful.search.JobEventRdbSearch;
+import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.cloud.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbSearch;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationGsonFactory;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
@@ -29,24 +33,21 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.BootstrapEnviron
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.JobRegisterStatistics;
-import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics;
-import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
-import org.apache.shardingsphere.elasticjob.cloud.reg.base.CoordinatorRegistryCenter;
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.job.JobTypeStatistics;
+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.cloud.util.json.GsonFactory;
-import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import lombok.extern.slf4j.Slf4j;
+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.codehaus.jettison.json.JSONException;
+import javax.sql.DataSource;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
@@ -96,8 +97,7 @@ public final class CloudJobRestfulApi {
Preconditions.checkNotNull(regCenter);
configService = new CloudJobConfigurationService(regCenter);
facadeService = new FacadeService(regCenter);
- Optional<JobEventRdbConfiguration> jobEventRdbConfiguration = Optional.absent();
- statisticManager = StatisticManager.getInstance(regCenter, jobEventRdbConfiguration);
+ statisticManager = StatisticManager.getInstance(regCenter, Optional.absent());
}
/**
@@ -110,9 +110,9 @@ public final class CloudJobRestfulApi {
CloudJobRestfulApi.regCenter = regCenter;
CloudJobRestfulApi.producerManager = producerManager;
GsonFactory.registerTypeAdapter(CloudJobConfiguration.class, new CloudJobConfigurationGsonFactory.CloudJobConfigurationGsonTypeAdapter());
- Optional<JobEventRdbConfiguration> jobEventRdbConfig = BootstrapEnvironment.getInstance().getJobEventRdbConfiguration();
- if (jobEventRdbConfig.isPresent()) {
- jobEventRdbSearch = new JobEventRdbSearch(jobEventRdbConfig.get().getDataSource());
+ Optional<TracingConfiguration> tracingConfiguration = BootstrapEnvironment.getInstance().getTracingConfiguration();
+ if (tracingConfiguration.isPresent()) {
+ jobEventRdbSearch = new JobEventRdbSearch((DataSource) tracingConfiguration.get().getStorage());
} else {
jobEventRdbSearch = null;
}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbSearch.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/search/JobEventRdbSearch.java
similarity index 95%
rename from elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbSearch.java
rename to elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/search/JobEventRdbSearch.java
index 54fa230..d60c4d1 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/event/rdb/JobEventRdbSearch.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/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.
@@ -15,18 +15,16 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.event.rdb;
+package org.apache.shardingsphere.elasticjob.cloud.scheduler.restful.search;
import com.google.common.base.CaseFormat;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEventThrowable;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
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;
@@ -90,8 +88,7 @@ public final class JobEventRdbSearch {
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.valueOf(resultSet.getString(7)),
new Date(resultSet.getTimestamp(8).getTime()), resultSet.getTimestamp(9) == null ? null : new Date(resultSet.getTimestamp(9).getTime()),
- resultSet.getBoolean(10), new JobExecutionEventThrowable(null, resultSet.getString(11))
- );
+ resultSet.getBoolean(10), resultSet.getString(11));
result.add(jobExecutionEvent);
}
} catch (final SQLException ex) {
@@ -110,7 +107,7 @@ public final class JobEventRdbSearch {
) {
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)), ExecutionType.valueOf(resultSet.getString(7)), resultSet.getString(8),
+ 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);
}
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
index 5b555af..e963825 100755
--- 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
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics;
import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.JobRunningStatisticJob;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
@@ -39,7 +38,9 @@ import com.google.common.base.Optional;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
+import javax.sql.DataSource;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -62,7 +63,7 @@ public final class StatisticManager {
private final CloudJobConfigurationService configurationService;
- private final Optional<JobEventRdbConfiguration> jobEventRdbConfiguration;
+ private final Optional<TracingConfiguration> tracingConfiguration;
private final StatisticsScheduler scheduler;
@@ -70,11 +71,11 @@ public final class StatisticManager {
private StatisticRdbRepository rdbRepository;
- private StatisticManager(final CoordinatorRegistryCenter registryCenter, final Optional<JobEventRdbConfiguration> jobEventRdbConfiguration,
+ private StatisticManager(final CoordinatorRegistryCenter registryCenter, final Optional<TracingConfiguration> tracingConfiguration,
final StatisticsScheduler scheduler, final Map<StatisticInterval, TaskResultMetaData> statisticData) {
this.registryCenter = registryCenter;
this.configurationService = new CloudJobConfigurationService(registryCenter);
- this.jobEventRdbConfiguration = jobEventRdbConfiguration;
+ this.tracingConfiguration = tracingConfiguration;
this.scheduler = scheduler;
this.statisticData = statisticData;
}
@@ -83,10 +84,10 @@ public final class StatisticManager {
* Get statistic manager.
*
* @param regCenter registry center
- * @param jobEventRdbConfiguration rdb configuration
+ * @param tracingConfiguration tracing configuration
* @return statistic manager
*/
- public static StatisticManager getInstance(final CoordinatorRegistryCenter regCenter, final Optional<JobEventRdbConfiguration> jobEventRdbConfiguration) {
+ public static StatisticManager getInstance(final CoordinatorRegistryCenter regCenter, final Optional<TracingConfiguration> tracingConfiguration) {
if (null == instance) {
synchronized (StatisticManager.class) {
if (null == instance) {
@@ -94,7 +95,7 @@ public final class StatisticManager {
statisticData.put(StatisticInterval.MINUTE, new TaskResultMetaData());
statisticData.put(StatisticInterval.HOUR, new TaskResultMetaData());
statisticData.put(StatisticInterval.DAY, new TaskResultMetaData());
- instance = new StatisticManager(regCenter, jobEventRdbConfiguration, new StatisticsScheduler(), statisticData);
+ instance = new StatisticManager(regCenter, tracingConfiguration, new StatisticsScheduler(), statisticData);
init();
}
}
@@ -103,9 +104,9 @@ public final class StatisticManager {
}
private static void init() {
- if (instance.jobEventRdbConfiguration.isPresent()) {
+ if (instance.tracingConfiguration.isPresent()) {
try {
- instance.rdbRepository = new StatisticRdbRepository(instance.jobEventRdbConfiguration.get().getDataSource());
+ instance.rdbRepository = new StatisticRdbRepository((DataSource) instance.tracingConfiguration.get().getStorage());
} catch (final SQLException ex) {
log.error("Init StatisticRdbRepository error:", ex);
}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/AllTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/AllTests.java
deleted file mode 100755
index 0a584a2..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/AllTests.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.cloud;
-
-import org.apache.shardingsphere.elasticjob.cloud.restful.AllRestfulTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.AllCloudSchedulerTests;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- AllCloudSchedulerTests.class,
- AllRestfulTests.class
- })
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/restful/AllRestfulTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/restful/AllRestfulTests.java
deleted file mode 100755
index f862ebf..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/restful/AllRestfulTests.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.restful;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-
-@RunWith(Suite.class)
-@SuiteClasses({
- RestfulServerTest.class,
- RestfulExceptionTest.class
- })
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class AllRestfulTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/AllCloudSchedulerTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/AllCloudSchedulerTests.java
deleted file mode 100755
index cd8416e..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/AllCloudSchedulerTests.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;
-
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.env.AllEnvTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.AllProducerTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.restful.AllRestfulTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.AllConfigTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.AllContextTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.ha.AllHATests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.AllMesosTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.AllStateTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.AllStatisticTests;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- AllEnvTests.class,
- AllContextTests.class,
- AllConfigTests.class,
- AllStateTests.class,
- AllProducerTests.class,
- AllRestfulTests.class,
- AllMesosTests.class,
- AllStatisticTests.class,
- AllHATests.class
- })
-public final class AllCloudSchedulerTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/AllConfigTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/AllConfigTests.java
deleted file mode 100755
index 34cfeea..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/config/AllConfigTests.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;
-
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.AllCloudAppConfigTests;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.AllCloudJobConfigTests;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- AllCloudAppConfigTests.class,
- AllCloudJobConfigTests.class
- })
-public final class AllConfigTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/AllContextTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/AllContextTests.java
deleted file mode 100755
index 154b3e6..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/context/AllContextTests.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.scheduler.context;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(JobContextTest.class)
-public final class AllContextTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AllEnvTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AllEnvTests.java
deleted file mode 100755
index 0ed9a58..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/env/AllEnvTests.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.scheduler.env;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(BootstrapEnvironmentTest.class)
-public final class AllEnvTests {
-}
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 e088af0..845540b 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
@@ -17,10 +17,10 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.env;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperConfiguration;
import com.google.common.base.Optional;
import org.apache.commons.dbcp.BasicDataSource;
+import org.apache.shardingsphere.elasticjob.cloud.reg.zookeeper.ZookeeperConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.hamcrest.core.Is;
import org.hamcrest.core.IsInstanceOf;
import org.junit.Assert;
@@ -35,7 +35,7 @@ public final class BootstrapEnvironmentTest {
private final BootstrapEnvironment bootstrapEnvironment = BootstrapEnvironment.getInstance();
@Test
- public void assertGetMesosConfiguration() throws NoSuchFieldException {
+ public void assertGetMesosConfiguration() {
MesosConfiguration mesosConfig = bootstrapEnvironment.getMesosConfiguration();
Assert.assertThat(mesosConfig.getHostname(), Is.is("localhost"));
Assert.assertThat(mesosConfig.getUser(), Is.is(""));
@@ -73,15 +73,15 @@ public final class BootstrapEnvironmentTest {
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);
- Optional<JobEventRdbConfiguration> jobEventRdbConfiguration = bootstrapEnvironment.getJobEventRdbConfiguration();
- if (jobEventRdbConfiguration.isPresent()) {
- Assert.assertThat(jobEventRdbConfiguration.get().getDataSource(), IsInstanceOf.instanceOf(BasicDataSource.class));
+ Optional<TracingConfiguration> tracingConfiguration = bootstrapEnvironment.getTracingConfiguration();
+ if (tracingConfiguration.isPresent()) {
+ Assert.assertThat(tracingConfiguration.get().getStorage(), IsInstanceOf.instanceOf(BasicDataSource.class));
}
}
@Test
- public void assertWithoutEventTraceRdbConfiguration() throws NoSuchFieldException {
- Assert.assertFalse(bootstrapEnvironment.getJobEventRdbConfiguration().isPresent());
+ public void assertWithoutEventTraceRdbConfiguration() {
+ Assert.assertFalse(bootstrapEnvironment.getTracingConfiguration().isPresent());
}
@Test
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/AllHATests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/AllHATests.java
deleted file mode 100755
index d9d5f1f..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/AllHATests.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.scheduler.ha;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(FrameworkIDServiceTest.class)
-public class AllHATests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AllMesosTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AllMesosTests.java
deleted file mode 100755
index a709a47..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/mesos/AllMesosTests.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.apache.shardingsphere.elasticjob.cloud.scheduler.ha.FrameworkIDServiceTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- SupportedExtractionTypeTest.class,
- LeasesQueueTest.class,
- JobTaskRequestTest.class,
- TaskInfoDataTest.class,
- FacadeServiceTest.class,
- SchedulerEngineTest.class,
- TaskLaunchScheduledServiceTest.class,
- SchedulerServiceTest.class,
- LaunchingTasksTest.class,
- FrameworkIDServiceTest.class,
- MesosStateServiceTest.class,
- ReconcileServiceTest.class,
- AppConstraintEvaluatorTest.class
- })
-public final class AllMesosTests {
-}
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 5a55406..4e3b16d 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
@@ -17,20 +17,20 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.StatisticManager;
-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.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.reg.base.CoordinatorRegistryCenter;
import com.google.common.base.Optional;
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.context.TaskContext;
+import org.apache.shardingsphere.elasticjob.cloud.reg.base.CoordinatorRegistryCenter;
+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.tracing.JobEventBus;
import org.hamcrest.core.Is;
import org.junit.Assert;
import org.junit.Before;
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 dd91769..e3ef81d 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
@@ -17,28 +17,26 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudAppConfigurationBuilder;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder;
-import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.JobEventBus;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.context.JobContext;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.fixture.OfferBuilder;
-import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
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.TaskRequest;
import com.netflix.fenzo.TaskScheduler;
import com.netflix.fenzo.VMAssignmentResult;
-import com.netflix.fenzo.VirtualMachineLease;
import com.netflix.fenzo.functions.Action2;
import com.netflix.fenzo.plugins.VMLeaseObject;
import org.apache.mesos.SchedulerDriver;
+import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
+import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.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.tracing.JobEventBus;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -76,48 +74,48 @@ public final class TaskLaunchScheduledServiceTest {
private TaskLaunchScheduledService taskLaunchScheduledService;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(facadeService.loadAppConfig("test_app")).thenReturn(Optional.of(CloudAppConfigurationBuilder.createCloudAppConfiguration("test_app")));
taskLaunchScheduledService = new TaskLaunchScheduledService(schedulerDriver, taskScheduler, facadeService, jobEventBus);
taskLaunchScheduledService.startUp();
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
taskLaunchScheduledService.shutDown();
}
@Test
- public void assertRunOneIteration() throws Exception {
+ public void assertRunOneIteration() {
when(facadeService.getEligibleJobContext()).thenReturn(Lists.newArrayList(
JobContext.from(CloudJobConfigurationBuilder.createCloudJobConfiguration("failover_job", CloudJobExecutionType.DAEMON, 1), ExecutionType.FAILOVER)));
Map<String, VMAssignmentResult> vmAssignmentResultMap = new HashMap<>();
- vmAssignmentResultMap.put("rs1", new VMAssignmentResult("localhost", Lists.<VirtualMachineLease>newArrayList(new VMLeaseObject(OfferBuilder.createOffer("offer_0"))),
+ vmAssignmentResultMap.put("rs1", new VMAssignmentResult("localhost", Lists.newArrayList(new VMLeaseObject(OfferBuilder.createOffer("offer_0"))),
Sets.newHashSet(mockTaskAssignmentResult("failover_job", ExecutionType.FAILOVER))));
- when(taskScheduler.scheduleOnce(ArgumentMatchers.<TaskRequest>anyList(), ArgumentMatchers.<VirtualMachineLease>anyList())).thenReturn(new SchedulingResult(vmAssignmentResultMap));
+ 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(TaskContext.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.<TaskContext>anyList());
+ verify(facadeService).removeLaunchTasksFromQueue(ArgumentMatchers.anyList());
verify(facadeService).loadAppConfig("test_app");
verify(jobEventBus).post(ArgumentMatchers.<JobStatusTraceEvent>any());
}
@Test
- public void assertRunOneIterationWithScriptJob() throws Exception {
+ public void assertRunOneIterationWithScriptJob() {
when(facadeService.getEligibleJobContext()).thenReturn(Lists.newArrayList(
JobContext.from(CloudJobConfigurationBuilder.createScriptCloudJobConfiguration("script_job", 1), ExecutionType.READY)));
Map<String, VMAssignmentResult> vmAssignmentResultMap = new HashMap<>();
- vmAssignmentResultMap.put("rs1", new VMAssignmentResult("localhost", Lists.<VirtualMachineLease>newArrayList(new VMLeaseObject(OfferBuilder.createOffer("offer_0"))),
+ vmAssignmentResultMap.put("rs1", new VMAssignmentResult("localhost", Lists.newArrayList(new VMLeaseObject(OfferBuilder.createOffer("offer_0"))),
Sets.newHashSet(mockTaskAssignmentResult("script_job", ExecutionType.READY))));
- when(taskScheduler.scheduleOnce(ArgumentMatchers.<TaskRequest>anyList(), ArgumentMatchers.<VirtualMachineLease>anyList())).thenReturn(new SchedulingResult(vmAssignmentResultMap));
+ 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.<TaskContext>anyList());
+ 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(jobEventBus).post(ArgumentMatchers.<JobStatusTraceEvent>any());
@@ -130,12 +128,12 @@ public final class TaskLaunchScheduledServiceTest {
}
@Test
- public void assertScheduler() throws Exception {
+ public void assertScheduler() {
assertThat(taskLaunchScheduledService.scheduler(), instanceOf(Scheduler.class));
}
@Test
- public void assertServiceName() throws Exception {
+ public 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/AllProducerTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/AllProducerTests.java
deleted file mode 100755
index 202f48a..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/AllProducerTests.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.producer;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ProducerJobTest.class,
- TransientProducerRepositoryTest.class,
- TransientProducerSchedulerTest.class,
- ProducerManagerTest.class
- })
-public final class AllProducerTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AbstractCloudRestfulApiTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AbstractCloudRestfulApiTest.java
index ab3cb7f..4994f7c 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AbstractCloudRestfulApiTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AbstractCloudRestfulApiTest.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.restful;
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.slave.MesosSlaveServerMock;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbSearch;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.restful.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.fixture.master.MesosMasterServerMock;
@@ -74,13 +74,13 @@ public abstract class AbstractCloudRestfulApiTest {
private static void initMesosServer() throws Exception {
MesosStateService.register("127.0.0.1", 9050);
masterServer = new RestfulServer(9050);
- masterServer.start(MesosMasterServerMock.class.getPackage().getName(), Optional.<String>absent(), Optional.<String>absent());
+ masterServer.start(MesosMasterServerMock.class.getPackage().getName(), Optional.absent(), Optional.absent());
slaveServer = new RestfulServer(9051);
- slaveServer.start(MesosSlaveServerMock.class.getPackage().getName(), Optional.<String>absent(), Optional.<String>absent());
+ slaveServer.start(MesosSlaveServerMock.class.getPackage().getName(), Optional.absent(), Optional.absent());
}
@AfterClass
- public static void tearDown() throws Exception {
+ public static void tearDown() {
restfulService.stop();
masterServer.stop();
slaveServer.stop();
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AllRestfulTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AllRestfulTests.java
deleted file mode 100755
index e473e95..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/AllRestfulTests.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.restful;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- CloudJobRestfulApiTest.class,
- CloudAppRestfulApiTest.class,
- CloudOperationRestfulApiTest.class
- })
-public final class AllRestfulTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApiTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApiTest.java
index 7bea51b..8cc29ab 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApiTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudJobRestfulApiTest.java
@@ -17,22 +17,23 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.restful;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.TaskNode;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService;
+import com.google.common.collect.Lists;
import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbSearch;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.restful.search.JobEventRdbSearch;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.restful.search.JobEventRdbSearch.Result;
+import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
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.statistics.type.task.TaskResultStatistics;
-import org.apache.shardingsphere.elasticjob.cloud.util.json.GsonFactory;
-import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.cloud.event.type.JobStatusTraceEvent;
+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.job.JobTypeStatistics;
-import com.google.common.collect.Lists;
+import org.apache.shardingsphere.elasticjob.cloud.statistics.type.task.TaskResultStatistics;
+import org.apache.shardingsphere.elasticjob.cloud.util.json.GsonFactory;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import org.hamcrest.core.Is;
import org.junit.Assert;
import org.junit.Test;
@@ -185,7 +186,7 @@ public final class CloudJobRestfulApiTest extends AbstractCloudRestfulApiTest {
@Test
public void assertFindJobExecutionEvents() throws Exception {
ReflectionUtils.setFieldValue(CloudJobRestfulApi.class, CloudJobRestfulApi.class.getDeclaredField("jobEventRdbSearch"), getJobEventRdbSearch());
- JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
+ JobExecutionEvent jobExecutionEvent = new JobExecutionEvent("localhost", "127.0.0.1", "fake_task_id", "test_job", JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER, 0);
Mockito.when(getJobEventRdbSearch().findJobExecutionEvents(Mockito.any(JobEventRdbSearch.Condition.class))).thenReturn(new JobEventRdbSearch.Result<>(0,
Lists.newArrayList(jobExecutionEvent)));
Assert.assertThat(RestfulTestsUtil.sentGetRequest("http://127.0.0.1:19000/api/job/events/executions?" + buildFindJobEventsQueryParameter()),
@@ -203,9 +204,9 @@ public final class CloudJobRestfulApiTest extends AbstractCloudRestfulApiTest {
@Test
public void assertFindJobStatusTraceEvent() throws Exception {
ReflectionUtils.setFieldValue(CloudJobRestfulApi.class, CloudJobRestfulApi.class.getDeclaredField("jobEventRdbSearch"), getJobEventRdbSearch());
- JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent(
- "test-job", "fake_task_id", "fake_slave_id", JobStatusTraceEvent.Source.LITE_EXECUTOR, ExecutionType.READY, "0", JobStatusTraceEvent.State.TASK_RUNNING, "message is empty.");
- Mockito.when(getJobEventRdbSearch().findJobStatusTraceEvents(Mockito.any(JobEventRdbSearch.Condition.class))).thenReturn(new JobEventRdbSearch.Result<>(0,
+ JobStatusTraceEvent jobStatusTraceEvent = new JobStatusTraceEvent("test-job",
+ "fake_task_id", "fake_slave_id", JobStatusTraceEvent.Source.LITE_EXECUTOR, ExecutionType.READY.toString(), "0", JobStatusTraceEvent.State.TASK_RUNNING, "message is empty.");
+ Mockito.when(getJobEventRdbSearch().findJobStatusTraceEvents(Mockito.any(JobEventRdbSearch.Condition.class))).thenReturn(new Result<>(0,
Lists.newArrayList(jobStatusTraceEvent)));
Assert.assertThat(RestfulTestsUtil.sentGetRequest("http://127.0.0.1:19000/api/job/events/statusTraces?" + buildFindJobEventsQueryParameter()),
Is.is(GsonFactory.getGson().toJson(new JobEventRdbSearch.Result<>(0, Lists.newArrayList(jobStatusTraceEvent)))));
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/AllStateTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/AllStateTests.java
deleted file mode 100755
index 8a634aa..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/state/AllStateTests.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.state;
-
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobNodeTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobServiceTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverNodeTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.failover.FailoverServiceTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyServiceTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningServiceTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.DisableAppNodeTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.DisableAppServiceTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyNodeTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningNodeTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- ReadyNodeTest.class,
- ReadyServiceTest.class,
- FailoverNodeTest.class,
- FailoverServiceTest.class,
- RunningNodeTest.class,
- RunningServiceTest.class,
- DisableAppNodeTest.class,
- DisableAppServiceTest.class,
- DisableJobNodeTest.class,
- DisableJobServiceTest.class
- })
-public final class AllStateTests {
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/AllStatisticTests.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/AllStatisticTests.java
deleted file mode 100755
index 2c2cde1..0000000
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/AllStatisticTests.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.scheduler.statistics;
-
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.JobRunningStatisticJobTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.RegisteredJobStatisticJobTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.TaskResultStatisticJobTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.util.StatisticTimeUtilsTest;
-import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.BaseStatisticJobTest;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- StatisticManagerTest.class,
- StatisticsSchedulerTest.class,
- BaseStatisticJobTest.class,
- TaskResultMetaDataTest.class,
- StatisticTimeUtilsTest.class,
- RegisteredJobStatisticJobTest.class,
- TaskResultStatisticJobTest.class,
- JobRunningStatisticJobTest.class
- })
-public final class AllStatisticTests {
-}
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 548028d..684ebac 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
@@ -17,19 +17,19 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics;
+import com.google.common.base.Optional;
+import com.google.common.collect.Lists;
+import org.apache.shardingsphere.elasticjob.cloud.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobExecutionType;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConfigurationBuilder;
-import org.apache.shardingsphere.elasticjob.cloud.event.rdb.JobEventRdbConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.reg.base.CoordinatorRegistryCenter;
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 com.google.common.base.Optional;
-import com.google.common.collect.Lists;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.hamcrest.core.Is;
import org.junit.After;
import org.junit.Assert;
@@ -50,7 +50,7 @@ public class StatisticManagerTest {
private CoordinatorRegistryCenter regCenter;
@Mock
- private Optional<JobEventRdbConfiguration> jobEventRdbConfiguration;
+ private Optional<TracingConfiguration> tracingConfiguration;
@Mock
private StatisticRdbRepository rdbRepository;
@@ -65,7 +65,7 @@ public class StatisticManagerTest {
@Before
public void setUp() {
- statisticManager = StatisticManager.getInstance(regCenter, jobEventRdbConfiguration);
+ statisticManager = StatisticManager.getInstance(regCenter, tracingConfiguration);
}
@After
@@ -78,7 +78,7 @@ public class StatisticManagerTest {
@Test
public void assertGetInstance() {
- Assert.assertThat(statisticManager, Is.is(StatisticManager.getInstance(regCenter, jobEventRdbConfiguration)));
+ Assert.assertThat(statisticManager, Is.is(StatisticManager.getInstance(regCenter, tracingConfiguration)));
}
@Test
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/pom.xml b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/pom.xml
similarity index 96%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/pom.xml
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/pom.xml
index 82ac4a6..4157b64 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/pom.xml
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/pom.xml
@@ -22,10 +22,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-tracing</artifactId>
+ <artifactId>elasticjob-tracing</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-tracing-api</artifactId>
+ <artifactId>elasticjob-tracing-api</artifactId>
<name>${project.artifactId}</name>
<dependencies>
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/JobEventBus.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobEventBus.java
similarity index 87%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/JobEventBus.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobEventBus.java
index 5a40b11..68fa466 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/JobEventBus.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/JobEventBus.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.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing;
+package org.apache.shardingsphere.elasticjob.tracing;
import com.google.common.base.Joiner;
import com.google.common.eventbus.AsyncEventBus;
@@ -23,10 +23,10 @@ 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.lite.tracing.api.TracingConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerFactory;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.exception.TracingConfigurationException;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerFactory;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobEvent;
+import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/api/TracingConfiguration.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/api/TracingConfiguration.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/api/TracingConfiguration.java
index bc8e982..c97bed6 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/api/TracingConfiguration.java
+++ b/elasticjob-common/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.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.api;
+package org.apache.shardingsphere.elasticjob.tracing.api;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobEvent.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java
similarity index 93%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobEvent.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobEvent.java
index 0bf7232..3b7324e 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobEvent.java
+++ b/elasticjob-common/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.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.event;
+package org.apache.shardingsphere.elasticjob.tracing.event;
/**
* Job event.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobExecutionEvent.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java
similarity index 97%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobExecutionEvent.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java
index 50eb831..1f95531 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobExecutionEvent.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEvent.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.event;
+package org.apache.shardingsphere.elasticjob.tracing.event;
import lombok.AllArgsConstructor;
import lombok.Getter;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobStatusTraceEvent.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java
similarity index 96%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobStatusTraceEvent.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java
index d88073b..9a1b679 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobStatusTraceEvent.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/event/JobStatusTraceEvent.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.event;
+package org.apache.shardingsphere.elasticjob.tracing.event;
import lombok.AllArgsConstructor;
import lombok.Getter;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/exception/TracingConfigurationException.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/exception/TracingConfigurationException.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/exception/TracingConfigurationException.java
index 5224b7d..89f8a15 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/exception/TracingConfigurationException.java
+++ b/elasticjob-common/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.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.exception;
+package org.apache.shardingsphere.elasticjob.tracing.exception;
/**
* Tracing configuration exception.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListener.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java
similarity index 85%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListener.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListener.java
index d41a5cd..414ddeb 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListener.java
+++ b/elasticjob-common/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.
@@ -15,12 +15,12 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.listener;
+package org.apache.shardingsphere.elasticjob.tracing.listener;
import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
/**
* Tracing listener.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerConfiguration.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java
similarity index 88%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerConfiguration.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java
index f1b0b92..eb3b2f2 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerConfiguration.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerConfiguration.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.listener;
+package org.apache.shardingsphere.elasticjob.tracing.listener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.exception.TracingConfigurationException;
+import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException;
/**
* Tracing listener configuration.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerFactory.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerFactory.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java
index 38a73b3..b6d3d90 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerFactory.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/main/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactory.java
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.listener;
+package org.apache.shardingsphere.elasticjob.tracing.listener;
import com.google.common.base.Strings;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.exception.TracingConfigurationException;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException;
import java.util.HashMap;
import java.util.Map;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/JobEventBusTest.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobEventBusTest.java
similarity index 86%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/JobEventBusTest.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobEventBusTest.java
index 858e2c2..71b715f 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/JobEventBusTest.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/JobEventBusTest.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.
@@ -15,15 +15,15 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing;
+package org.apache.shardingsphere.elasticjob.tracing;
import com.google.common.eventbus.EventBus;
import lombok.SneakyThrows;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.fixture.JobEventCaller;
-import org.apache.shardingsphere.elasticjob.lite.tracing.fixture.TestTracingListener;
+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.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobExecutionEventTest.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java
similarity index 92%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobExecutionEventTest.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/event/JobExecutionEventTest.java
index e4913cd..3696941 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/event/JobExecutionEventTest.java
+++ b/elasticjob-common/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.
@@ -15,8 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.event;
+package org.apache.shardingsphere.elasticjob.tracing.event;
+import org.hamcrest.CoreMatchers;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
@@ -32,7 +33,7 @@ public final class JobExecutionEventTest {
public 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));
+ assertThat(actual.getSource(), CoreMatchers.is(JobExecutionEvent.ExecutionSource.NORMAL_TRIGGER));
assertThat(actual.getShardingItem(), is(0));
assertNotNull(actual.getHostname());
assertNotNull(actual.getStartTime());
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/JobEventCaller.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java
similarity index 92%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/JobEventCaller.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/JobEventCaller.java
index 35993bf..99d0cad 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/JobEventCaller.java
+++ b/elasticjob-common/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.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.fixture;
+package org.apache.shardingsphere.elasticjob.tracing.fixture;
public interface JobEventCaller {
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingFailureConfiguration.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java
similarity index 77%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingFailureConfiguration.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingFailureConfiguration.java
index 8ed4a89..ed824c8 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingFailureConfiguration.java
+++ b/elasticjob-common/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.
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.fixture;
+package org.apache.shardingsphere.elasticjob.tracing.fixture;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.exception.TracingConfigurationException;
+import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener;
+import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException;
public final class TestTracingFailureConfiguration implements TracingListenerConfiguration {
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingListener.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java
similarity index 82%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingListener.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListener.java
index 6ce9b9f..48f09f0 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingListener.java
+++ b/elasticjob-common/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.
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.fixture;
+package org.apache.shardingsphere.elasticjob.tracing.fixture;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
@RequiredArgsConstructor
public final class TestTracingListener implements TracingListener {
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingListenerConfiguration.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java
similarity index 82%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingListenerConfiguration.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/fixture/TestTracingListenerConfiguration.java
index 5d93180..c950d22 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/fixture/TestTracingListenerConfiguration.java
+++ b/elasticjob-common/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.
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.fixture;
+package org.apache.shardingsphere.elasticjob.tracing.fixture;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListener;
+import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.listener.TracingListener;
public final class TestTracingListenerConfiguration implements TracingListenerConfiguration<JobEventCaller> {
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerFactoryTest.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java
similarity index 83%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerFactoryTest.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java
index 8381739..facc403 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/listener/TracingListenerFactoryTest.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/java/org/apache/shardingsphere/elasticjob/tracing/listener/TracingListenerFactoryTest.java
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.listener;
+package org.apache.shardingsphere.elasticjob.tracing.listener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.exception.TracingConfigurationException;
-import org.apache.shardingsphere.elasticjob.lite.tracing.fixture.TestTracingListener;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException;
+import org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListener;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration
similarity index 81%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration
index 30df3a8..6abb615 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration
@@ -15,5 +15,5 @@
# limitations under the License.
#
-org.apache.shardingsphere.elasticjob.lite.tracing.fixture.TestTracingListenerConfiguration
-org.apache.shardingsphere.elasticjob.lite.tracing.fixture.TestTracingFailureConfiguration
+org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingListenerConfiguration
+org.apache.shardingsphere.elasticjob.tracing.fixture.TestTracingFailureConfiguration
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/resources/logback-test.xml b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml
similarity index 87%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/resources/logback-test.xml
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml
index 8112b99..ecc5b0f 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-api/src/test/resources/logback-test.xml
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-api/src/test/resources/logback-test.xml
@@ -36,6 +36,6 @@
<appender-ref ref="STDOUT" />
</root>
- <logger name="org.apache.shardingsphere.elasticjob.lite.tracing.rdb.config.RDBTracingListenerConfiguration" level="OFF" />
- <logger name="org.apache.shardingsphere.elasticjob.lite.tracing.JobEventBus" level="OFF" />
+ <logger name="RDBTracingListenerConfiguration" level="OFF" />
+ <logger name="org.apache.shardingsphere.elasticjob.tracing.JobEventBus" level="OFF" />
</configuration>
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/pom.xml b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/pom.xml
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml
index 8fcdca1..00b408d 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/pom.xml
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/pom.xml
@@ -22,16 +22,16 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-tracing</artifactId>
+ <artifactId>elasticjob-tracing</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-tracing-rdb</artifactId>
+ <artifactId>elasticjob-tracing-rdb</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-tracing-api</artifactId>
+ <artifactId>elasticjob-tracing-api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListener.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java
similarity index 78%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListener.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListener.java
index cceee81..5369302 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListener.java
+++ b/elasticjob-common/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.
@@ -15,12 +15,12 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.listener;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.listener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.storage.RDBJobEventStorage;
+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.tracing.rdb.storage.RDBJobEventStorage;
import javax.sql.DataSource;
import java.sql.SQLException;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerConfiguration.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java
similarity index 79%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerConfiguration.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfiguration.java
index 64ba15e..f6747e5 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerConfiguration.java
+++ b/elasticjob-common/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.
@@ -15,11 +15,11 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.listener;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.listener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.exception.TracingConfigurationException;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListener;
-import org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration;
+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 javax.sql.DataSource;
import java.sql.SQLException;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBJobEventStorage.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java
similarity index 97%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBJobEventStorage.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorage.java
index a9de4d5..f907d82 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBJobEventStorage.java
+++ b/elasticjob-common/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.
@@ -15,15 +15,15 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.storage;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.storage;
import com.google.common.base.Strings;
import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.Source;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.State;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType;
+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.type.DatabaseType;
import javax.sql.DataSource;
import java.sql.Connection;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBStorageSQLMapper.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java
similarity index 98%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBStorageSQLMapper.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java
index 2849408..ffc7e71 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBStorageSQLMapper.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBStorageSQLMapper.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.storage;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.storage;
import lombok.Getter;
import lombok.SneakyThrows;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/DatabaseType.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java
similarity index 95%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/DatabaseType.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java
index f271761..0b5bdca 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/DatabaseType.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/DatabaseType.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.type;
/**
* Database type.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/DB2DatabaseType.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/DB2DatabaseType.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java
index 249cfd7..6128864 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/DB2DatabaseType.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/DB2DatabaseType.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType;
+import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType;
/**
* DB2 database type.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/H2DatabaseType.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/H2DatabaseType.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java
index 32eee18..c163db8 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/H2DatabaseType.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/H2DatabaseType.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType;
+import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType;
/**
* H2 database type.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/MySQLDatabaseType.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/MySQLDatabaseType.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java
index d2950a2..46bc5c7 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/MySQLDatabaseType.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/MySQLDatabaseType.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType;
+import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType;
/**
* MySQL database type.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/OracleDatabaseType.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/OracleDatabaseType.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java
index b049fbd..005df35 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/OracleDatabaseType.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/OracleDatabaseType.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType;
+import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType;
/**
* Oracle database type.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/PostgreSQLDatabaseType.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/PostgreSQLDatabaseType.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java
index b10c8f8..b03748e 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/PostgreSQLDatabaseType.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/PostgreSQLDatabaseType.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType;
+import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType;
/**
* PostgreSQL database type.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/SQLServerDatabaseType.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/SQLServerDatabaseType.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java
index 0597d61..e752955 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/type/impl/SQLServerDatabaseType.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/java/org/apache/shardingsphere/elasticjob/tracing/rdb/type/impl/SQLServerDatabaseType.java
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType;
+import org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType;
/**
* SQLServer database type.
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration
similarity index 89%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration
index bfbbffb..567ef3f 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.listener.TracingListenerConfiguration
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.listener.TracingListenerConfiguration
@@ -15,4 +15,4 @@
# limitations under the License.
#
-org.apache.shardingsphere.elasticjob.lite.tracing.rdb.listener.RDBTracingListenerConfiguration
+org.apache.shardingsphere.elasticjob.tracing.rdb.listener.RDBTracingListenerConfiguration
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType
similarity index 61%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType
index e543af1..374dab7 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.DatabaseType
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/services/org.apache.shardingsphere.elasticjob.tracing.rdb.type.DatabaseType
@@ -15,9 +15,9 @@
# limitations under the License.
#
-org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl.MySQLDatabaseType
-org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl.PostgreSQLDatabaseType
-org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl.OracleDatabaseType
-org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl.SQLServerDatabaseType
-org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl.DB2DatabaseType
-org.apache.shardingsphere.elasticjob.lite.tracing.rdb.type.impl.H2DatabaseType
+org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.MySQLDatabaseType
+org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.PostgreSQLDatabaseType
+org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.OracleDatabaseType
+org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.SQLServerDatabaseType
+org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.DB2DatabaseType
+org.apache.shardingsphere.elasticjob.tracing.rdb.type.impl.H2DatabaseType
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/db2.properties b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/db2.properties
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/db2.properties
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/db2.properties
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/h2.properties b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/h2.properties
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/h2.properties
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/h2.properties
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/mysql.properties b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/mysql.properties
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/mysql.properties
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/mysql.properties
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/oracle.properties b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/oracle.properties
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/oracle.properties
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/oracle.properties
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/postgresQL.properties b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/postgresQL.properties
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/postgresQL.properties
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/postgresQL.properties
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/sql92.properties b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/sql92.properties
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/sql92.properties
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/sql92.properties
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/sqlserver.properties b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/sqlserver.properties
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/main/resources/META-INF/sql/sqlserver.properties
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/main/resources/META-INF/sql/sqlserver.properties
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java
similarity index 91%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java
index 7a74401..a6e74ee 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerConfigurationTest.java
+++ b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerConfigurationTest.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.
@@ -15,10 +15,10 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.listener;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.listener;
import org.apache.commons.dbcp.BasicDataSource;
-import org.apache.shardingsphere.elasticjob.lite.tracing.exception.TracingConfigurationException;
+import org.apache.shardingsphere.elasticjob.tracing.exception.TracingConfigurationException;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerTest.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java
similarity index 82%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerTest.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/listener/RDBTracingListenerTest.java
index fa50ca7..4df2d62 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/listener/RDBTracingListenerTest.java
+++ b/elasticjob-common/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.
@@ -15,17 +15,17 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.listener;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.listener;
import lombok.SneakyThrows;
import org.apache.commons.dbcp.BasicDataSource;
-import org.apache.shardingsphere.elasticjob.lite.tracing.JobEventBus;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.Source;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.State;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.storage.RDBJobEventStorage;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
+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.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBJobEventStorageTest.java b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBJobEventStorageTest.java
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/tracing/rdb/storage/RDBJobEventStorageTest.java
index a2390c0..92a4c04 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/java/org/apache/shardingsphere/elasticjob/lite/tracing/rdb/storage/RDBJobEventStorageTest.java
+++ b/elasticjob-common/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.
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.tracing.rdb.storage;
+package org.apache.shardingsphere.elasticjob.tracing.rdb.storage;
import org.apache.commons.dbcp.BasicDataSource;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.Source;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.State;
+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.Before;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/resources/logback-test.xml b/elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml
similarity index 100%
rename from elasticjob-lite/elasticjob-lite-tracing/elasticjob-lite-tracing-rdb/src/test/resources/logback-test.xml
rename to elasticjob-common/elasticjob-tracing/elasticjob-tracing-rdb/src/test/resources/logback-test.xml
diff --git a/elasticjob-lite/elasticjob-lite-tracing/pom.xml b/elasticjob-common/elasticjob-tracing/pom.xml
similarity index 89%
copy from elasticjob-lite/elasticjob-lite-tracing/pom.xml
copy to elasticjob-common/elasticjob-tracing/pom.xml
index 0a23ad3..bf6a1b1 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/pom.xml
+++ b/elasticjob-common/elasticjob-tracing/pom.xml
@@ -25,12 +25,12 @@
<artifactId>elasticjob-lite</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-tracing</artifactId>
+ <artifactId>elasticjob-tracing</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<modules>
- <module>elasticjob-lite-tracing-api</module>
- <module>elasticjob-lite-tracing-rdb</module>
+ <module>elasticjob-tracing-api</module>
+ <module>elasticjob-tracing-rdb</module>
</modules>
</project>
diff --git a/elasticjob-lite/elasticjob-lite-tracing/pom.xml b/elasticjob-common/pom.xml
similarity index 86%
rename from elasticjob-lite/elasticjob-lite-tracing/pom.xml
rename to elasticjob-common/pom.xml
index 0a23ad3..0abdeeb 100644
--- a/elasticjob-lite/elasticjob-lite-tracing/pom.xml
+++ b/elasticjob-common/pom.xml
@@ -8,7 +8,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.
@@ -22,15 +22,14 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite</artifactId>
+ <artifactId>elasticjob</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-lite-tracing</artifactId>
+ <artifactId>elasticjob-common</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<modules>
- <module>elasticjob-lite-tracing-api</module>
- <module>elasticjob-lite-tracing-rdb</module>
+ <module>elasticjob-tracing</module>
</modules>
</project>
diff --git a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/controller/EventTraceHistoryController.java b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/controller/EventTraceHistoryController.java
index 3a6521c..709c4f3 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/controller/EventTraceHistoryController.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/controller/EventTraceHistoryController.java
@@ -21,8 +21,8 @@ import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobExec
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobStatusTraceEventsRequest;
import org.apache.shardingsphere.elasticjob.lite.console.dto.response.BasePageResponse;
import org.apache.shardingsphere.elasticjob.lite.console.service.EventTraceHistoryService;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
diff --git a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobExecutionLog.java b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobExecutionLog.java
index 1c28686..af0d520 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobExecutionLog.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobExecutionLog.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.console.domain;
import lombok.Data;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
import javax.persistence.Column;
import javax.persistence.Entity;
diff --git a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobStatusTraceLog.java b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobStatusTraceLog.java
index 68003fd..14685be 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobStatusTraceLog.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/domain/JobStatusTraceLog.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.console.domain;
import lombok.Data;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import javax.persistence.Column;
import javax.persistence.Entity;
diff --git a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/EventTraceHistoryService.java b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/EventTraceHistoryService.java
index a0ed520..881a862 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/EventTraceHistoryService.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/EventTraceHistoryService.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.elasticjob.lite.console.service;
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobExecutionEventsRequest;
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobStatusTraceEventsRequest;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import org.springframework.data.domain.Page;
/**
diff --git a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/impl/EventTraceHistoryServiceImpl.java b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/impl/EventTraceHistoryServiceImpl.java
index 84315ba..76397cf 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/impl/EventTraceHistoryServiceImpl.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/service/impl/EventTraceHistoryServiceImpl.java
@@ -28,8 +28,8 @@ import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobExec
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobStatusTraceEventsRequest;
import org.apache.shardingsphere.elasticjob.lite.console.service.EventTraceHistoryService;
import org.apache.shardingsphere.elasticjob.lite.console.util.BeanUtils;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
diff --git a/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTest.java b/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTest.java
index 3e0f13a..5ddcc5b 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTest.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTest.java
@@ -20,8 +20,8 @@ package org.apache.shardingsphere.elasticjob.lite.console.dao.search;
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobExecutionEventsRequest;
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobStatusTraceEventsRequest;
import org.apache.shardingsphere.elasticjob.lite.console.service.EventTraceHistoryService;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
diff --git a/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTestConfiguration.java b/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTestConfiguration.java
index 871712a..6210ca5 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTestConfiguration.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/test/java/org/apache/shardingsphere/elasticjob/lite/console/dao/search/RDBJobEventSearchTestConfiguration.java
@@ -20,9 +20,9 @@ package org.apache.shardingsphere.elasticjob.lite.console.dao.search;
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobExecutionEventsRequest;
import org.apache.shardingsphere.elasticjob.lite.console.dto.request.FindJobStatusTraceEventsRequest;
import org.apache.shardingsphere.elasticjob.lite.console.service.EventTraceHistoryService;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.rdb.storage.RDBJobEventStorage;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent;
+import org.apache.shardingsphere.elasticjob.tracing.rdb.storage.RDBJobEventStorage;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.TestConfiguration;
diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml
index c007692..b30bbd0 100644
--- a/elasticjob-lite/elasticjob-lite-core/pom.xml
+++ b/elasticjob-lite/elasticjob-lite-core/pom.xml
@@ -28,7 +28,7 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
- <artifactId>elasticjob-lite-tracing-rdb</artifactId>
+ <artifactId>elasticjob-tracing-rdb</artifactId>
<version>${project.parent.version}</version>
</dependency>
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 8478e44..5898c74 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
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.lite.api.listener.ElasticJobListener
import org.apache.shardingsphere.elasticjob.lite.api.job.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
/**
* One off job bootstrap.
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 b0b3c86..8180f12 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
@@ -25,7 +25,7 @@ import org.apache.shardingsphere.elasticjob.lite.api.listener.ElasticJobListener
import org.apache.shardingsphere.elasticjob.lite.api.job.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobScheduler;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
/**
* Schedule job bootstrap.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutor.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutor.java
index 8f75ad1..926a35f 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutor.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutor.java
@@ -31,10 +31,10 @@ import org.apache.shardingsphere.elasticjob.lite.handler.error.JobErrorHandlerFa
import org.apache.shardingsphere.elasticjob.lite.handler.threadpool.JobExecutorServiceHandlerFactory;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.LiteJobFacade;
import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent.ExecutionSource;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.State;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
+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.lite.util.env.IpUtils;
import java.util.Collection;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/JobFacade.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/JobFacade.java
index 40a34b1..712e70e 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/JobFacade.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/JobFacade.java
@@ -19,8 +19,8 @@ package org.apache.shardingsphere.elasticjob.lite.executor;
import org.apache.shardingsphere.elasticjob.lite.api.job.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.State;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import java.util.Collection;
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 2967f01..a02b934 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
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.lite.handler.sharding.JobInstance;
import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService;
import org.apache.shardingsphere.elasticjob.lite.internal.setup.SetUpFacade;
import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java
index 30f37d3..48af55a 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJob.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.lite.api.listener.ElasticJobListener
import org.apache.shardingsphere.elasticjob.lite.api.job.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.executor.ElasticJobExecutor;
import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacade.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacade.java
index c94e313..fd42128 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacade.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/LiteJobFacade.java
@@ -31,12 +31,12 @@ import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionCont
import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ExecutionService;
import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService;
import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.tracing.JobEventBus;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobExecutionEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.Source;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.State;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
+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;
import java.util.List;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutorTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutorTest.java
index 1a15240..65ce3b3 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutorTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/ElasticJobExecutorTest.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.lite.fixture.executor.ClassedFooJobExecutor;
import org.apache.shardingsphere.elasticjob.lite.fixture.job.FooJob;
import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.tracing.event.JobStatusTraceEvent.State;
+import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils;
import org.junit.Before;
import org.junit.Test;
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 6faf6ab..1b17faa 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
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverServi
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.tracing.JobEventBus;
+import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils;
import org.junit.Before;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/tracing/parser/TracingBeanDefinitionParser.java b/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/tracing/parser/TracingBeanDefinitionParser.java
index fcc8465..2378441 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/tracing/parser/TracingBeanDefinitionParser.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/tracing/parser/TracingBeanDefinitionParser.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.spring.tracing.parser;
import org.apache.shardingsphere.elasticjob.lite.spring.tracing.tag.TracingBeanDefinitionTag;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.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/elasticjob-lite/pom.xml b/elasticjob-lite/pom.xml
index b87c987..a297e49 100644
--- a/elasticjob-lite/pom.xml
+++ b/elasticjob-lite/pom.xml
@@ -28,11 +28,10 @@
<artifactId>elasticjob-lite</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
-
+
<modules>
<module>elasticjob-lite-core</module>
<module>elasticjob-lite-executor</module>
- <module>elasticjob-lite-tracing</module>
<module>elasticjob-lite-spring</module>
<module>elasticjob-lite-lifecycle</module>
<module>elasticjob-lite-console</module>
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 dc5e642..924c000 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
@@ -27,7 +27,7 @@ import org.apache.shardingsphere.elasticjob.lite.reg.base.CoordinatorRegistryCen
import org.apache.shardingsphere.elasticjob.lite.reg.zookeeper.ZookeeperConfiguration;
import org.apache.shardingsphere.elasticjob.lite.reg.zookeeper.ZookeeperRegistryCenter;
import org.apache.shardingsphere.elasticjob.lite.script.props.ScriptJobProperties;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import javax.sql.DataSource;
import java.io.IOException;
diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java
index a11a1ae..d2637d3 100644
--- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java
+++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/DataflowJobConfig.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.lite.dataflow.job.DataflowJob;
import org.apache.shardingsphere.elasticjob.lite.dataflow.props.DataflowJobProperties;
import org.apache.shardingsphere.elasticjob.lite.example.job.dataflow.SpringDataflowJob;
import org.apache.shardingsphere.elasticjob.lite.reg.zookeeper.ZookeeperRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java
index 2a164dc..320c6a7 100644
--- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java
+++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/SimpleJobConfig.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.lite.simple.job.SimpleJob;
import org.apache.shardingsphere.elasticjob.lite.api.job.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.example.job.simple.SpringSimpleJob;
import org.apache.shardingsphere.elasticjob.lite.reg.zookeeper.ZookeeperRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/TracingConfig.java b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/TracingConfig.java
index 6791d07..7467eb8 100644
--- a/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/TracingConfig.java
+++ b/examples/elasticjob-example-lite-springboot/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/config/TracingConfig.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.example.config;
-import org.apache.shardingsphere.elasticjob.lite.tracing.api.TracingConfiguration;
+import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
diff --git a/pom.xml b/pom.xml
index da5f999..cac6991 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,6 +33,7 @@
<modules>
<module>elasticjob-lite</module>
<module>elasticjob-cloud</module>
+ <module>elasticjob-common</module>
</modules>
<properties>