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/11 13:09:37 UTC
[shardingsphere-elasticjob-lite] branch master updated: Add
elasticjob-infra-common module (#1029)
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 cdf64b3 Add elasticjob-infra-common module (#1029)
cdf64b3 is described below
commit cdf64b3891e88e7894a2411e70968ef157c2b7d0
Author: Liang Zhang <te...@163.com>
AuthorDate: Sat Jul 11 21:09:31 2020 +0800
Add elasticjob-infra-common module (#1029)
* Add elasticjob-infra-common module
* move lite.util code to common module
* move cloud.util code to common module
* move exception to common module
---
elasticjob-cloud/elasticjob-cloud-common/pom.xml | 5 +
.../elasticjob/cloud/exception/ExceptionUtil.java | 48 --------
.../JobExecutionEnvironmentException.java | 30 -----
.../cloud/exception/JobSystemException.java | 34 ------
.../cloud/executor/AbstractElasticJobExecutor.java | 10 +-
.../cloud/executor/JobExecutorFactory.java | 6 +-
.../elasticjob/cloud/executor/JobFacade.java | 2 +-
.../impl/DefaultExecutorServiceHandler.java | 4 +-
.../cloud/executor/type/ScriptJobExecutor.java | 2 +-
.../cloud/util/concurrent/BlockUtils.java | 44 --------
.../util/concurrent/ExecutorServiceObject.java | 81 --------------
.../cloud/util/config/ShardingItemParameters.java | 2 +-
.../cloud/util/config/ShardingItems.java | 66 -----------
.../elasticjob/cloud/util/env/HostException.java | 32 ------
.../elasticjob/cloud/util/env/IpUtils.java | 98 ----------------
.../cloud/exception/ExceptionUtilTest.java | 42 -------
.../cloud/exception/JobSystemExceptionTest.java | 37 -------
.../cloud/executor/JobExecutorFactoryTest.java | 2 +-
.../cloud/executor/type/ElasticJobVerify.java | 2 +-
.../cloud/executor/type/ScriptJobExecutorTest.java | 20 ++--
.../cloud/executor/type/SimpleJobExecutorTest.java | 4 +-
.../fixture/handler/ThrowJobExceptionHandler.java | 2 +-
.../util/concurrent/ExecutorServiceObjectTest.java | 62 -----------
.../util/config/ShardingItemParametersTest.java | 2 +-
.../cloud/util/config/ShardingItemsTest.java | 59 ----------
.../cloud/util/env/HostExceptionTest.java | 34 ------
.../elasticjob/cloud/util/env/IpUtilsTest.java | 35 ------
.../elasticjob/cloud/util/env/TimeServiceTest.java | 32 ------
.../cloud/executor/DaemonTaskScheduler.java | 2 +-
.../elasticjob/cloud/executor/TaskExecutor.java | 10 +-
.../cloud/executor/local/LocalTaskExecutor.java | 2 +-
.../cloud/executor/CloudJobFacadeTest.java | 2 +-
.../cloud/executor/TaskExecutorThreadTest.java | 2 +-
.../executor/local/LocalTaskExecutorTest.java | 2 +-
.../elasticjob-cloud-scheduler/pom.xml | 5 +
.../cloud/restful/RestfulExceptionMapper.java | 6 +-
.../scheduler/ha/SchedulerElectionCandidate.java | 2 +-
.../cloud/scheduler/producer/ProducerManager.java | 2 +-
.../producer/TransientProducerScheduler.java | 7 +-
.../scheduler/restful/CloudAppRestfulApi.java | 2 +-
.../scheduler/restful/CloudJobRestfulApi.java | 2 +-
.../scheduler/statistics/StatisticsScheduler.java | 2 +-
.../scheduler/producer/ProducerManagerTest.java | 2 +-
.../pom.xml | 48 ++------
.../infra/common}/concurrent/BlockUtils.java | 4 +-
.../concurrent/ElasticJobExecutorService.java | 4 +-
.../infra/common}/env/HostException.java | 4 +-
.../elasticjob/infra/common}/env/IpUtils.java | 4 +-
.../elasticjob/infra/common}/env/TimeService.java | 4 +-
.../infra/common}/exception/ExceptionUtils.java | 4 +-
.../exception/JobConfigurationException.java | 4 +-
.../JobExecutionEnvironmentException.java | 4 +-
.../common}/exception/JobStatisticException.java | 4 +-
.../common}/exception/JobSystemException.java | 4 +-
.../elasticjob/infra/common}/json/GsonFactory.java | 4 +-
.../common}/yaml/DefaultYamlTupleProcessor.java | 2 +-
.../common}/yaml/ElasticJobYamlRepresenter.java | 2 +-
.../elasticjob/infra/common}/yaml/YamlEngine.java | 2 +-
.../concurrent/ElasticJobExecutorServiceTest.java | 4 +-
.../infra/common}/env/HostExceptionTest.java | 4 +-
.../elasticjob/infra/common}/env/IpUtilsTest.java | 4 +-
.../infra/common}/env/TimeServiceTest.java | 4 +-
.../common}/exception/ExceptionUtilsTest.java | 4 +-
.../exception/JobConfigurationExceptionTest.java | 4 +-
.../JobExecutionEnvironmentExceptionTest.java | 4 +-
.../exception/JobStatisticExceptionTest.java | 5 +-
.../common}/exception/JobSystemExceptionTest.java | 4 +-
.../infra/common}/json/GsonFactoryTest.java | 4 +-
.../infra/common/yaml/YamlEngineTest.java | 61 ++++++++++
.../common/yaml/fixture/FooYamlConfiguration.java | 25 ++---
.../elasticjob-registry-center/pom.xml | 1 -
elasticjob-infra/pom.xml | 1 +
.../config/advice/ConsoleRestControllerAdvice.java | 2 +-
elasticjob-lite/elasticjob-lite-core/pom.xml | 5 +
.../AbstractDistributeOnceElasticJobListener.java | 6 +-
.../lite/exception/AppConfigurationException.java | 34 ------
.../lite/exception/JobConfigurationException.java | 34 ------
.../lite/exception/JobStatisticException.java | 30 -----
.../lite/executor/ElasticJobExecutor.java | 6 +-
.../elasticjob/lite/executor/JobFacade.java | 2 +-
.../lite/executor/item/JobItemExecutorFactory.java | 2 +-
.../lite/handler/error/JobErrorHandlerFactory.java | 2 +-
.../handler/error/impl/ThrowJobErrorHandler.java | 2 +-
.../lite/handler/sharding/JobInstance.java | 2 +-
.../sharding/JobShardingStrategyFactory.java | 2 +-
.../JobExecutorServiceHandlerFactory.java | 2 +-
.../impl/AbstractJobExecutorServiceHandler.java | 2 +-
.../lite/internal/config/ConfigurationService.java | 8 +-
.../internal/config/RescheduleListenerManager.java | 2 +-
.../lite/internal/election/LeaderService.java | 2 +-
.../internal/failover/FailoverListenerManager.java | 2 +-
.../internal/schedule/JobScheduleController.java | 2 +-
.../lite/internal/schedule/JobScheduler.java | 2 +-
.../lite/internal/schedule/LiteJobFacade.java | 2 +-
.../lite/internal/server/ServerNode.java | 2 +-
.../lite/internal/server/ServerService.java | 2 +-
.../internal/sharding/ExecutionContextService.java | 1 -
.../sharding/MonitorExecutionListenerManager.java | 2 +-
.../sharding}/ShardingItemParameters.java | 6 +-
.../internal/sharding/ShardingListenerManager.java | 2 +-
.../lite/internal/sharding/ShardingService.java | 2 +-
.../lite/internal/storage/JobNodeStorage.java | 2 +-
.../lite/internal/util/SensitiveInfoUtils.java | 2 +-
.../elasticjob/lite/util/config/ShardingItems.java | 66 -----------
.../DistributeOnceElasticJobListenerTest.java | 4 +-
.../exception/JobConfigurationExceptionTest.java | 37 -------
.../JobExecutionEnvironmentExceptionTest.java | 31 ------
.../lite/exception/JobStatisticExceptionTest.java | 32 ------
.../lite/executor/ElasticJobExecutorTest.java | 4 +-
.../executor/item/JobItemExecutorFactoryTest.java | 2 +-
.../handler/error/JobErrorHandlerFactoryTest.java | 2 +-
.../error/impl/ThrowJobErrorHandlerTest.java | 2 +-
.../lite/handler/sharding/JobInstanceTest.java | 2 +-
.../sharding/JobShardingStrategyFactoryTest.java | 2 +-
.../JobExecutorServiceHandlerFactoryTest.java | 2 +-
.../disable/DisabledJobIntegrateTest.java | 6 +-
.../disable/OneOffDisabledJobIntegrateTest.java | 2 +-
.../disable/ScheduleDisabledJobIntegrateTest.java | 2 +-
.../integrate/enable/EnabledJobIntegrateTest.java | 4 +-
.../enable/OneOffEnabledJobIntegrateTest.java | 2 +-
.../enable/ScheduleEnabledJobIntegrateTest.java | 2 +-
.../internal/config/ConfigurationServiceTest.java | 6 +-
.../config/yaml/YamlJobConfigurationTest.java | 96 ++++++++++++++++
.../schedule/JobScheduleControllerTest.java | 2 +-
.../lite/internal/schedule/LiteJobFacadeTest.java | 2 +-
.../sharding}/ShardingItemParametersTest.java | 6 +-
.../lite/util/config/ShardingItemsTest.java | 59 ----------
.../elasticjob/lite/util/yaml/YamlEngineTest.java | 123 ---------------------
.../lite/script/executor/ScriptJobExecutor.java | 6 +-
.../internal/settings/JobConfigurationAPIImpl.java | 2 +-
.../internal/statistics/JobStatisticsAPIImpl.java | 2 +-
.../lite/spring/job/util/AopTargetUtils.java | 2 +-
.../spring/job/AbstractJobSpringIntegrateTest.java | 2 +-
.../spring/job/JobSpringNamespaceWithRefTest.java | 2 +-
.../test/EmbedZookeeperTestExecutionListener.java | 2 +-
135 files changed, 362 insertions(+), 1402 deletions(-)
diff --git a/elasticjob-cloud/elasticjob-cloud-common/pom.xml b/elasticjob-cloud/elasticjob-cloud-common/pom.xml
index 9e78088..92524f0 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/pom.xml
+++ b/elasticjob-cloud/elasticjob-cloud-common/pom.xml
@@ -36,6 +36,11 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
+ <artifactId>elasticjob-infra-common</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-registry-center</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/ExceptionUtil.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/ExceptionUtil.java
deleted file mode 100755
index ec6a710..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/ExceptionUtil.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-/**
- * Exception utility.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class ExceptionUtil {
-
- /**
- * Transform throwable to string.
- *
- * @param cause cause
- * @return string
- */
- public static String transform(final Throwable cause) {
- if (null == cause) {
- return "";
- }
- StringWriter result = new StringWriter();
- try (PrintWriter writer = new PrintWriter(result)) {
- cause.printStackTrace(writer);
- }
- return result.toString();
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentException.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentException.java
deleted file mode 100755
index f29c232..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentException.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.exception;
-
-/**
- * Job execution environment exception.
- */
-public final class JobExecutionEnvironmentException extends Exception {
-
- private static final long serialVersionUID = -6670738108926897433L;
-
- public JobExecutionEnvironmentException(final String errorMessage, final Object... args) {
- super(String.format(errorMessage, args));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemException.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemException.java
deleted file mode 100755
index b52ff05..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemException.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.exception;
-
-/**
- * Job system exception.
- */
-public final class JobSystemException extends RuntimeException {
-
- private static final long serialVersionUID = 5018901344199973515L;
-
- public JobSystemException(final String errorMessage, final Object... args) {
- super(String.format(errorMessage, args));
- }
-
- public JobSystemException(final Throwable cause) {
- super(cause);
- }
-}
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 2bf9150..4d9be09 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
@@ -22,14 +22,14 @@ import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-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 org.apache.shardingsphere.elasticjob.cloud.util.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.ExceptionUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
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;
@@ -208,7 +208,7 @@ public abstract class AbstractElasticJobExecutor {
// CHECKSTYLE:OFF
} catch (final Throwable cause) {
// CHECKSTYLE:ON
- String errorMessage = ExceptionUtil.transform(cause);
+ String errorMessage = ExceptionUtils.transform(cause);
completeEvent = startEvent.executionFailure(errorMessage);
jobFacade.postJobExecutionEvent(completeEvent);
itemErrorMessages.put(item, errorMessage);
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactory.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactory.java
index 2ed1aa7..b2b056c 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactory.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactory.java
@@ -17,15 +17,15 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.cloud.api.dataflow.DataflowJob;
import org.apache.shardingsphere.elasticjob.cloud.api.simple.SimpleJob;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.DataflowJobExecutor;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.ScriptJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.SimpleJobExecutor;
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
/**
* Job executor factory.
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 424fb7f..dcde4f7 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,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultExecutorServiceHandler.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultExecutorServiceHandler.java
index e9f6eac..68b771c 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultExecutorServiceHandler.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/handler/impl/DefaultExecutorServiceHandler.java
@@ -17,8 +17,8 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.handler.impl;
-import org.apache.shardingsphere.elasticjob.cloud.util.concurrent.ExecutorServiceObject;
import org.apache.shardingsphere.elasticjob.cloud.executor.handler.ExecutorServiceHandler;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.ElasticJobExecutorService;
import java.util.concurrent.ExecutorService;
@@ -29,6 +29,6 @@ public final class DefaultExecutorServiceHandler implements ExecutorServiceHandl
@Override
public ExecutorService createExecutorService(final String jobName) {
- return new ExecutorServiceObject("inner-job-" + jobName, Runtime.getRuntime().availableProcessors() * 2).createExecutorService();
+ return new ElasticJobExecutorService("inner-job-" + jobName, Runtime.getRuntime().availableProcessors() * 2).createExecutorService();
}
}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutor.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutor.java
index 0027f1e..3c4612c 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutor.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutor.java
@@ -22,10 +22,10 @@ import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
import org.apache.shardingsphere.elasticjob.cloud.config.script.ScriptJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.cloud.executor.AbstractElasticJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.JobFacade;
import org.apache.shardingsphere.elasticjob.cloud.util.json.GsonFactory;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import java.io.IOException;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/BlockUtils.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/BlockUtils.java
deleted file mode 100755
index 556a26a..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/BlockUtils.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.util.concurrent;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class BlockUtils {
-
- /**
- * Wait for short time.
- */
- public static void waitingShortTime() {
- sleep(100L);
- }
-
- /**
- * Sleep for millis.
- * @param millis the time for sleep
- */
- public static void sleep(final long millis) {
- try {
- Thread.sleep(millis);
- } catch (final InterruptedException ex) {
- Thread.currentThread().interrupt();
- }
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/ExecutorServiceObject.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/ExecutorServiceObject.java
deleted file mode 100755
index c40980b..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/ExecutorServiceObject.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.util.concurrent;
-
-import com.google.common.base.Joiner;
-import com.google.common.util.concurrent.MoreExecutors;
-import org.apache.commons.lang3.concurrent.BasicThreadFactory;
-
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Executor service object.
- */
-public final class ExecutorServiceObject {
-
- private final ThreadPoolExecutor threadPoolExecutor;
-
- private final BlockingQueue<Runnable> workQueue;
-
- public ExecutorServiceObject(final String namingPattern, final int threadSize) {
- workQueue = new LinkedBlockingQueue<>();
- threadPoolExecutor = new ThreadPoolExecutor(threadSize, threadSize, 5L, TimeUnit.MINUTES, workQueue,
- new BasicThreadFactory.Builder().namingPattern(Joiner.on("-").join(namingPattern, "%s")).build());
- threadPoolExecutor.allowCoreThreadTimeOut(true);
- }
-
- /**
- * Create executor service.
- *
- * @return executor service
- */
- public ExecutorService createExecutorService() {
- return MoreExecutors.listeningDecorator(MoreExecutors.getExitingExecutorService(threadPoolExecutor));
- }
-
- /**
- * Whether the threadPoolExecutor has been shut down.
- *
- * @return Whether the threadPoolExecutor has been shut down
- */
- public boolean isShutdown() {
- return threadPoolExecutor.isShutdown();
- }
-
- /**
- * Get active thread count.
- *
- * @return active thread count
- */
- public int getActiveThreadCount() {
- return threadPoolExecutor.getActiveCount();
- }
-
- /**
- * Get work queue size.
- *
- * @return work queue size
- */
- public int getWorkQueueSize() {
- return workQueue.size();
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParameters.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParameters.java
index 93caf15..2ea50f7 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParameters.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParameters.java
@@ -18,9 +18,9 @@
package org.apache.shardingsphere.elasticjob.cloud.util.config;
import com.google.common.base.Strings;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobConfigurationException;
import lombok.AllArgsConstructor;
import lombok.Getter;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import java.util.Collections;
import java.util.HashMap;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItems.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItems.java
deleted file mode 100755
index 0709968..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItems.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.config;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Strings;
-import lombok.Getter;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Sharding items.
- */
-@Getter
-public final class ShardingItems {
-
- private static final String DELIMITER = ",";
-
- /**
- * Get sharding items via string.
- *
- * @param itemsString sharding items string
- * @return sharding items
- */
- public static List<Integer> toItemList(final String itemsString) {
- if (Strings.isNullOrEmpty(itemsString)) {
- return Collections.emptyList();
- }
- String[] items = itemsString.split(DELIMITER);
- List<Integer> result = new ArrayList<>(items.length);
- for (String each : items) {
- int item = Integer.parseInt(each);
- if (!result.contains(item)) {
- result.add(item);
- }
- }
- return result;
- }
-
- /**
- * Get sharding items string.
- *
- * @param items sharding items
- * @return sharding items string
- */
- public static String toItemsString(final List<Integer> items) {
- return items.isEmpty() ? "" : Joiner.on(DELIMITER).join(items);
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostException.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostException.java
deleted file mode 100755
index d786762..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostException.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.util.env;
-
-import java.io.IOException;
-
-/**
- * Host exception.
- */
-public final class HostException extends RuntimeException {
-
- private static final long serialVersionUID = 3589264847881174997L;
-
- public HostException(final IOException cause) {
- super(cause);
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/IpUtils.java b/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/IpUtils.java
deleted file mode 100755
index 6e2d1ae..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/IpUtils.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.util.env;
-
-import lombok.AccessLevel;
-import lombok.NoArgsConstructor;
-
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.util.Enumeration;
-
-/**
- * IP address utility.
- */
-@NoArgsConstructor(access = AccessLevel.PRIVATE)
-public final class IpUtils {
-
- public static final String IP_REGEX = "((\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3})";
-
- private static volatile String cachedIpAddress;
-
- /**
- * Get IP address for localhost.
- *
- * @return IP address for localhost
- */
- public static String getIp() {
- if (null != cachedIpAddress) {
- return cachedIpAddress;
- }
- Enumeration<NetworkInterface> netInterfaces;
- try {
- netInterfaces = NetworkInterface.getNetworkInterfaces();
- } catch (final SocketException ex) {
- throw new HostException(ex);
- }
- String localIpAddress = null;
- while (netInterfaces.hasMoreElements()) {
- NetworkInterface netInterface = netInterfaces.nextElement();
- Enumeration<InetAddress> ipAddresses = netInterface.getInetAddresses();
- while (ipAddresses.hasMoreElements()) {
- InetAddress ipAddress = ipAddresses.nextElement();
- if (isPublicIpAddress(ipAddress)) {
- String publicIpAddress = ipAddress.getHostAddress();
- cachedIpAddress = publicIpAddress;
- return publicIpAddress;
- }
- if (isLocalIpAddress(ipAddress)) {
- localIpAddress = ipAddress.getHostAddress();
- }
- }
- }
- cachedIpAddress = localIpAddress;
- return localIpAddress;
- }
-
- private static boolean isPublicIpAddress(final InetAddress ipAddress) {
- return !ipAddress.isSiteLocalAddress() && !ipAddress.isLoopbackAddress() && !isV6IpAddress(ipAddress);
- }
-
- private static boolean isLocalIpAddress(final InetAddress ipAddress) {
- return ipAddress.isSiteLocalAddress() && !ipAddress.isLoopbackAddress() && !isV6IpAddress(ipAddress);
- }
-
- private static boolean isV6IpAddress(final InetAddress ipAddress) {
- return ipAddress.getHostAddress().contains(":");
- }
-
- /**
- * Get host name for localhost.
- *
- * @return host name for localhost
- */
- public static String getHostName() {
- try {
- return InetAddress.getLocalHost().getHostName();
- } catch (final UnknownHostException ex) {
- return "unknown";
- }
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/ExceptionUtilTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/ExceptionUtilTest.java
deleted file mode 100755
index c3419c1..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/ExceptionUtilTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.exception;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public final class ExceptionUtilTest {
-
- @Test
- public void assertTransformWithError() {
- assertTrue(ExceptionUtil.transform(new Error("Error")).startsWith("java.lang.Error"));
- }
-
- @Test
- public void assertTransformWithException() {
- assertTrue(ExceptionUtil.transform(new Exception("Exception")).startsWith("java.lang.Exception"));
- }
-
- @Test
- public void assertTransformWithNull() {
- assertThat(ExceptionUtil.transform(null), is(""));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemExceptionTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemExceptionTest.java
deleted file mode 100755
index 22b2118..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobSystemExceptionTest.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.exception;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public final class JobSystemExceptionTest {
-
- @Test
- public void assertGetMessage() {
- assertThat(new JobSystemException("message is: '%s'", "test").getMessage(), is("message is: 'test'"));
- }
-
- @Test
- public void assertGetCause() {
- assertThat(new JobSystemException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactoryTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactoryTest.java
index 11ede02..02a2961 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactoryTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/JobExecutorFactoryTest.java
@@ -17,7 +17,6 @@
package org.apache.shardingsphere.elasticjob.cloud.executor;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.DataflowJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.ScriptJobExecutor;
import org.apache.shardingsphere.elasticjob.cloud.executor.type.SimpleJobExecutor;
@@ -28,6 +27,7 @@ import org.apache.shardingsphere.elasticjob.cloud.fixture.handler.IgnoreJobExcep
import org.apache.shardingsphere.elasticjob.cloud.fixture.job.OtherJob;
import org.apache.shardingsphere.elasticjob.cloud.fixture.job.TestDataflowJob;
import org.apache.shardingsphere.elasticjob.cloud.fixture.job.TestSimpleJob;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
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/executor/type/ElasticJobVerify.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ElasticJobVerify.java
index a591489..c5667da 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
@@ -19,9 +19,9 @@ package org.apache.shardingsphere.elasticjob.cloud.executor.type;
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.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import static org.mockito.Mockito.verify;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutorTest.java
index 8e5e32b..c45f891 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutorTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/type/ScriptJobExecutorTest.java
@@ -17,20 +17,18 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.type;
-import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
-import org.apache.shardingsphere.elasticjob.cloud.fixture.config.TestScriptJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.executor.JobFacade;
+import org.apache.shardingsphere.elasticjob.cloud.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.cloud.fixture.ShardingContextsBuilder;
+import org.apache.shardingsphere.elasticjob.cloud.fixture.config.TestScriptJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.fixture.handler.IgnoreJobExceptionHandler;
import org.apache.shardingsphere.elasticjob.cloud.fixture.handler.ThrowJobExceptionHandler;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
-import java.io.IOException;
-
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -43,7 +41,7 @@ public final class ScriptJobExecutorTest {
private ScriptJobExecutor scriptJobExecutor;
@Test
- public void assertExecuteWhenCommandLineIsEmpty() throws IOException {
+ public void assertExecuteWhenCommandLineIsEmpty() {
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, ShardingContextsBuilder.getMultipleShardingContexts());
when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("", IgnoreJobExceptionHandler.class));
scriptJobExecutor = new ScriptJobExecutor(jobFacade);
@@ -51,12 +49,12 @@ public final class ScriptJobExecutorTest {
}
@Test(expected = JobSystemException.class)
- public void assertExecuteWhenExecuteFailureForSingleShardingItems() throws IOException, NoSuchFieldException {
+ public void assertExecuteWhenExecuteFailureForSingleShardingItems() {
assertExecuteWhenExecuteFailure(ShardingContextsBuilder.getSingleShardingContexts());
}
@Test
- public void assertExecuteWhenExecuteFailureForMultipleShardingItems() throws IOException, NoSuchFieldException {
+ public void assertExecuteWhenExecuteFailureForMultipleShardingItems() {
assertExecuteWhenExecuteFailure(ShardingContextsBuilder.getMultipleShardingContexts());
}
@@ -68,16 +66,16 @@ public final class ScriptJobExecutorTest {
}
@Test
- public void assertExecuteSuccessForMultipleShardingItems() throws IOException, NoSuchFieldException {
+ public void assertExecuteSuccessForMultipleShardingItems() {
assertExecuteSuccess(ShardingContextsBuilder.getMultipleShardingContexts());
}
@Test
- public void assertExecuteSuccessForSingleShardingItems() throws IOException, NoSuchFieldException {
+ public void assertExecuteSuccessForSingleShardingItems() {
assertExecuteSuccess(ShardingContextsBuilder.getSingleShardingContexts());
}
- private void assertExecuteSuccess(final ShardingContexts shardingContexts) throws IOException, NoSuchFieldException {
+ private void assertExecuteSuccess(final ShardingContexts shardingContexts) {
ElasticJobVerify.prepareForIsNotMisfire(jobFacade, shardingContexts);
when(jobFacade.loadJobRootConfiguration(true)).thenReturn(new TestScriptJobConfiguration("exists_file param0 param1", IgnoreJobExceptionHandler.class));
scriptJobExecutor = new ScriptJobExecutor(jobFacade);
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 29f7d90..23e3989 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,8 +17,6 @@
package org.apache.shardingsphere.elasticjob.cloud.executor.type;
-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;
@@ -28,6 +26,8 @@ import org.apache.shardingsphere.elasticjob.cloud.fixture.ShardingContextsBuilde
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.infra.common.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
import org.junit.Before;
import org.junit.Test;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/handler/ThrowJobExceptionHandler.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/handler/ThrowJobExceptionHandler.java
index 80d2b68..7a7155f 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/handler/ThrowJobExceptionHandler.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/fixture/handler/ThrowJobExceptionHandler.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.cloud.fixture.handler;
import org.apache.shardingsphere.elasticjob.cloud.executor.handler.JobExceptionHandler;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
public final class ThrowJobExceptionHandler implements JobExceptionHandler {
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/ExecutorServiceObjectTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/ExecutorServiceObjectTest.java
deleted file mode 100755
index c73147e..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/concurrent/ExecutorServiceObjectTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.util.concurrent;
-
-import org.junit.Test;
-
-import java.util.concurrent.ExecutorService;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public final class ExecutorServiceObjectTest {
-
- private ExecutorServiceObject executorServiceObject;
-
- @Test
- public void assertCreateExecutorService() {
- executorServiceObject = new ExecutorServiceObject("executor-service-test", 1);
- assertThat(executorServiceObject.getActiveThreadCount(), is(0));
- assertThat(executorServiceObject.getWorkQueueSize(), is(0));
- assertFalse(executorServiceObject.isShutdown());
- ExecutorService executorService = executorServiceObject.createExecutorService();
- executorService.submit(new FooTask());
- BlockUtils.waitingShortTime();
- assertThat(executorServiceObject.getActiveThreadCount(), is(1));
- assertThat(executorServiceObject.getWorkQueueSize(), is(0));
- assertFalse(executorServiceObject.isShutdown());
- executorService.submit(new FooTask());
- BlockUtils.waitingShortTime();
- assertThat(executorServiceObject.getActiveThreadCount(), is(1));
- assertThat(executorServiceObject.getWorkQueueSize(), is(1));
- assertFalse(executorServiceObject.isShutdown());
- executorService.shutdownNow();
- assertThat(executorServiceObject.getWorkQueueSize(), is(0));
- assertTrue(executorServiceObject.isShutdown());
- }
-
- class FooTask implements Runnable {
-
- @Override
- public void run() {
- BlockUtils.sleep(1000L);
- }
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParametersTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParametersTest.java
index 6ff0815..f224ad2 100755
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParametersTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemParametersTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.cloud.util.config;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.junit.Test;
import java.util.Collections;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemsTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemsTest.java
deleted file mode 100755
index 48d60de..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/config/ShardingItemsTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.cloud.util.config;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public final class ShardingItemsTest {
-
- @Test
- public void assertTtoItemListWhenNull() {
- assertThat(ShardingItems.toItemList(null), is(Collections.EMPTY_LIST));
- }
-
- @Test
- public void assertToItemListWhenEmpty() {
- assertThat(ShardingItems.toItemList(""), is(Collections.EMPTY_LIST));
- }
-
- @Test
- public void assertToItemList() {
- assertThat(ShardingItems.toItemList("0,1,2"), is(Arrays.asList(0, 1, 2)));
- }
-
- @Test
- public void assertToItemListForDuplicated() {
- assertThat(ShardingItems.toItemList("0,1,2,2"), is(Arrays.asList(0, 1, 2)));
- }
-
- @Test
- public void assertToItemsStringWhenEmpty() {
- assertThat(ShardingItems.toItemsString(Collections.<Integer>emptyList()), is(""));
- }
-
- @Test
- public void assertToItemsString() {
- assertThat(ShardingItems.toItemsString(Arrays.asList(0, 1, 2)), is("0,1,2"));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostExceptionTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostExceptionTest.java
deleted file mode 100755
index b757f4b..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/HostExceptionTest.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.util.env;
-
-import org.hamcrest.core.Is;
-import org.junit.Test;
-
-import java.io.IOException;
-
-import static org.junit.Assert.assertThat;
-
-public final class HostExceptionTest {
-
- @Test
- public void assertGetCause() {
- IOException cause = new IOException();
- assertThat(new HostException(cause).getCause(), Is.<Throwable>is(cause));
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/IpUtilsTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/IpUtilsTest.java
deleted file mode 100755
index ee89d79..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/IpUtilsTest.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.util.env;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertNotNull;
-
-public final class IpUtilsTest {
-
- @Test
- public void assertGetIp() {
- assertNotNull(IpUtils.getIp());
- }
-
- @Test
- public void assertGetHostName() {
- assertNotNull(IpUtils.getHostName());
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeServiceTest.java b/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeServiceTest.java
deleted file mode 100755
index 1603ea1..0000000
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeServiceTest.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.util.env;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertTrue;
-
-public class TimeServiceTest {
-
- private TimeService timeService = new TimeService();
-
- @Test
- public void assertGetCurrentMillis() {
- assertTrue(timeService.getCurrentMillis() <= System.currentTimeMillis());
- }
-}
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java
index 3f8ffe8..049e3f0 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/main/java/org/apache/shardingsphere/elasticjob/cloud/executor/DaemonTaskScheduler.java
@@ -23,7 +23,7 @@ import org.apache.mesos.ExecutorDriver;
import org.apache.mesos.Protos;
import org.apache.shardingsphere.elasticjob.cloud.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.cloud.config.JobRootConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
import org.quartz.Job;
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 ea9776f..796d121 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
@@ -28,9 +28,9 @@ 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.infra.common.concurrent.ElasticJobExecutorService;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.ExceptionUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -53,7 +53,7 @@ public final class TaskExecutor implements Executor {
private volatile JobEventBus jobEventBus = new JobEventBus();
public TaskExecutor() {
- executorService = new ExecutorServiceObject("cloud-task-executor", Runtime.getRuntime().availableProcessors() * 100).createExecutorService();
+ executorService = new ElasticJobExecutorService("cloud-task-executor", Runtime.getRuntime().availableProcessors() * 100).createExecutorService();
}
@Override
@@ -133,7 +133,7 @@ public final class TaskExecutor implements Executor {
} catch (final Throwable ex) {
// CHECKSTYLE:ON
log.error("ElasticJob Cloud Executor error", ex);
- executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_ERROR).setMessage(ExceptionUtil.transform(ex)).build());
+ executorDriver.sendStatusUpdate(Protos.TaskStatus.newBuilder().setTaskId(taskInfo.getTaskId()).setState(Protos.TaskState.TASK_ERROR).setMessage(ExceptionUtils.transform(ex)).build());
executorDriver.stop();
throw ex;
}
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 725634b..889ada3 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
@@ -27,7 +27,6 @@ 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.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;
@@ -36,6 +35,7 @@ import org.apache.shardingsphere.elasticjob.cloud.executor.type.DataflowJobExecu
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 org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
import org.springframework.context.support.ClassPathXmlApplicationContext;
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 08eace8..7c6b893 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,7 +20,7 @@ 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.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.tracing.JobEventBus;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutorThreadTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutorThreadTest.java
index 0bdbd70..59ac437 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutorThreadTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/TaskExecutorThreadTest.java
@@ -26,8 +26,8 @@ import org.apache.mesos.Protos.TaskInfo;
import org.apache.mesos.Protos.TaskState;
import org.apache.shardingsphere.elasticjob.cloud.api.JobType;
import org.apache.shardingsphere.elasticjob.cloud.context.ExecutionType;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.executor.fixture.TestJob;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
diff --git a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java
index bbb5822..bbea3b6 100755
--- a/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-executor/src/test/java/org/apache/shardingsphere/elasticjob/cloud/executor/local/LocalTaskExecutorTest.java
@@ -21,9 +21,9 @@ 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.config.simple.SimpleJobConfiguration;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.executor.local.fixture.TestDataflowJob;
import org.apache.shardingsphere.elasticjob.cloud.executor.local.fixture.TestSimpleJob;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.junit.Before;
import org.junit.Test;
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml
index 38e3056..0502182 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/pom.xml
@@ -29,6 +29,11 @@
<dependencies>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
+ <artifactId>elasticjob-infra-common</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-cloud-common</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/restful/RestfulExceptionMapper.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/restful/RestfulExceptionMapper.java
index 47a7d04..2890131 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/restful/RestfulExceptionMapper.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/restful/RestfulExceptionMapper.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.cloud.restful;
-import org.apache.shardingsphere.elasticjob.cloud.exception.ExceptionUtil;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.ExceptionUtils;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@@ -25,13 +25,13 @@ import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;
/**
- * Restful api exception mapper.
+ * Restful API exception mapper.
*/
@Provider
public final class RestfulExceptionMapper implements ExceptionMapper<Throwable> {
@Override
public Response toResponse(final Throwable cause) {
- return Response.ok(ExceptionUtil.transform(cause), MediaType.TEXT_PLAIN).status(Response.Status.INTERNAL_SERVER_ERROR).build();
+ return Response.ok(ExceptionUtils.transform(cause), MediaType.TEXT_PLAIN).status(Response.Status.INTERNAL_SERVER_ERROR).build();
}
}
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java
index 170ed3b..1d255d2 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/ha/SchedulerElectionCandidate.java
@@ -17,8 +17,8 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.ha;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.SchedulerService;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.reg.base.ElectionCandidate;
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java
index 4d6f81c..d7db5a5 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManager.java
@@ -25,7 +25,6 @@ import org.apache.mesos.Protos.SlaveID;
import org.apache.mesos.SchedulerDriver;
import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
import org.apache.shardingsphere.elasticjob.cloud.exception.AppConfigurationException;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
@@ -35,6 +34,7 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.Di
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import java.util.Optional;
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java
index 2cfabe7..c62cf03 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/TransientProducerScheduler.java
@@ -17,16 +17,15 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.producer;
+import lombok.Setter;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
-import lombok.Setter;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.quartz.CronScheduleBuilder;
import org.quartz.Job;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
@@ -145,7 +144,7 @@ final class TransientProducerScheduler {
private ReadyService readyService;
@Override
- public void execute(final JobExecutionContext context) throws JobExecutionException {
+ public void execute(final JobExecutionContext context) {
List<String> jobNames = repository.get(context.getJobDetail().getKey());
for (String each : jobNames) {
readyService.addTransient(each);
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudAppRestfulApi.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudAppRestfulApi.java
index 8b876dc..434161b 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudAppRestfulApi.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/restful/CloudAppRestfulApi.java
@@ -20,7 +20,6 @@ package org.apache.shardingsphere.elasticjob.cloud.scheduler.restful;
import org.apache.mesos.Protos.ExecutorID;
import org.apache.mesos.Protos.SlaveID;
import org.apache.shardingsphere.elasticjob.cloud.exception.AppConfigurationException;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationGsonFactory;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService;
@@ -30,6 +29,7 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.mesos.MesosStateServ
import org.apache.shardingsphere.elasticjob.cloud.scheduler.producer.ProducerManager;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.app.DisableAppService;
import org.apache.shardingsphere.elasticjob.cloud.util.json.GsonFactory;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.codehaus.jettison.json.JSONException;
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 318f743..c28e095 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
@@ -21,7 +21,6 @@ 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.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationGsonFactory;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfigurationService;
@@ -40,6 +39,7 @@ import org.apache.shardingsphere.elasticjob.cloud.statistics.type.job.JobTypeSta
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 org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java
index 86e685d..4e63c70 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/main/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/statistics/StatisticsScheduler.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.statistics.job.StatisticJob;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobStatisticException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobStatisticException;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
diff --git a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java
index a1c35a9..d606c3e 100755
--- a/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java
+++ b/elasticjob-cloud/elasticjob-cloud-scheduler/src/test/java/org/apache/shardingsphere/elasticjob/cloud/scheduler/producer/ProducerManagerTest.java
@@ -22,7 +22,6 @@ import org.apache.mesos.Protos;
import org.apache.mesos.SchedulerDriver;
import org.apache.shardingsphere.elasticjob.cloud.context.TaskContext;
import org.apache.shardingsphere.elasticjob.cloud.exception.AppConfigurationException;
-import org.apache.shardingsphere.elasticjob.cloud.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfiguration;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.app.CloudAppConfigurationService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.config.job.CloudJobConfiguration;
@@ -33,6 +32,7 @@ import org.apache.shardingsphere.elasticjob.cloud.scheduler.fixture.CloudJobConf
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.disable.job.DisableJobService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.ready.ReadyService;
import org.apache.shardingsphere.elasticjob.cloud.scheduler.state.running.RunningService;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.junit.Before;
import org.junit.Test;
diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-infra-common/pom.xml
similarity index 58%
copy from elasticjob-infra/elasticjob-registry-center/pom.xml
copy to elasticjob-infra/elasticjob-infra-common/pom.xml
index 0e07a80..5512f78 100644
--- a/elasticjob-infra/elasticjob-registry-center/pom.xml
+++ b/elasticjob-infra/elasticjob-infra-common/pom.xml
@@ -25,59 +25,35 @@
<artifactId>elasticjob-infra</artifactId>
<version>3.0.0.M1-SNAPSHOT</version>
</parent>
- <artifactId>elasticjob-registry-center</artifactId>
+ <artifactId>elasticjob-infra-common</artifactId>
<name>${project.artifactId}</name>
<dependencies>
<dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-framework</artifactId>
- <version>${curator.version}</version>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-client</artifactId>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-recipes</artifactId>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.apache.curator</groupId>
- <artifactId>curator-test</artifactId>
- </dependency>
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-inline</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>log4j-over-slf4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/BlockUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/BlockUtils.java
similarity index 95%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/BlockUtils.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/BlockUtils.java
index 6c99f03..1827c47 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/BlockUtils.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/BlockUtils.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.concurrent;
+package org.apache.shardingsphere.elasticjob.infra.common.concurrent;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/ElasticJobExecutorService.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/ElasticJobExecutorService.java
similarity index 97%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/ElasticJobExecutorService.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/ElasticJobExecutorService.java
index 29f6b84..887beae 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/ElasticJobExecutorService.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/ElasticJobExecutorService.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.concurrent;
+package org.apache.shardingsphere.elasticjob.infra.common.concurrent;
import com.google.common.base.Joiner;
import com.google.common.util.concurrent.MoreExecutors;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/HostException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/HostException.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/HostException.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/HostException.java
index 71e48e5..adde90d 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/HostException.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/HostException.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.env;
+package org.apache.shardingsphere.elasticjob.infra.common.env;
import java.io.IOException;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/IpUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/IpUtils.java
similarity index 98%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/IpUtils.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/IpUtils.java
index 7e89d08..95bf358 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/IpUtils.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/IpUtils.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.env;
+package org.apache.shardingsphere.elasticjob.infra.common.env;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/TimeService.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/TimeService.java
similarity index 93%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/TimeService.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/TimeService.java
index 95b2614..b76e118 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/env/TimeService.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/env/TimeService.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.env;
+package org.apache.shardingsphere.elasticjob.infra.common.env;
/**
* Time service.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/ExceptionUtils.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/ExceptionUtils.java
similarity index 95%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/ExceptionUtils.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/ExceptionUtils.java
index ceaf895..ba0a73a 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/ExceptionUtils.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/ExceptionUtils.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobConfigurationException.java
old mode 100755
new mode 100644
similarity index 94%
rename from elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationException.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobConfigurationException.java
index e82e205..3a95d11
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationException.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobConfigurationException.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
/**
* Job configuration exception.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobExecutionEnvironmentException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobExecutionEnvironmentException.java
similarity index 93%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobExecutionEnvironmentException.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobExecutionEnvironmentException.java
index 8b78afc..e9a66d7 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobExecutionEnvironmentException.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobExecutionEnvironmentException.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
/**
* Job execution environment exception.
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobStatisticException.java
old mode 100755
new mode 100644
similarity index 93%
rename from elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticException.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobStatisticException.java
index 9bfcd18..e3fc25e
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticException.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobStatisticException.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
/**
* Job statistic exception.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobSystemException.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobSystemException.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobSystemException.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobSystemException.java
index 20e1ebb..a049900 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobSystemException.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobSystemException.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
/**
* Job system exception.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/json/GsonFactory.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/json/GsonFactory.java
similarity index 96%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/json/GsonFactory.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/json/GsonFactory.java
index 8dd173c..a6b2e40 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/json/GsonFactory.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/json/GsonFactory.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.util.json;
+package org.apache.shardingsphere.elasticjob.infra.common.json;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/DefaultYamlTupleProcessor.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/DefaultYamlTupleProcessor.java
similarity index 97%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/DefaultYamlTupleProcessor.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/DefaultYamlTupleProcessor.java
index 0125aa1..93f97fc 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/DefaultYamlTupleProcessor.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/DefaultYamlTupleProcessor.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.yaml;
+package org.apache.shardingsphere.elasticjob.infra.common.yaml;
import org.yaml.snakeyaml.nodes.CollectionNode;
import org.yaml.snakeyaml.nodes.MappingNode;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/ElasticJobYamlRepresenter.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/ElasticJobYamlRepresenter.java
similarity index 95%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/ElasticJobYamlRepresenter.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/ElasticJobYamlRepresenter.java
index 21a1181..66c4da7 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/ElasticJobYamlRepresenter.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/ElasticJobYamlRepresenter.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.yaml;
+package org.apache.shardingsphere.elasticjob.infra.common.yaml;
import org.yaml.snakeyaml.introspector.Property;
import org.yaml.snakeyaml.nodes.NodeTuple;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/YamlEngine.java b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/YamlEngine.java
similarity index 96%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/YamlEngine.java
rename to elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/YamlEngine.java
index 9b75ee1..95d3897 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/YamlEngine.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/main/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/YamlEngine.java
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.yaml;
+package org.apache.shardingsphere.elasticjob.infra.common.yaml;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/ElasticJobExecutorServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/ElasticJobExecutorServiceTest.java
similarity index 97%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/ElasticJobExecutorServiceTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/ElasticJobExecutorServiceTest.java
index 31073eb..0198062 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/concurrent/ElasticJobExecutorServiceTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/concurrent/ElasticJobExecutorServiceTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.concurrent;
+package org.apache.shardingsphere.elasticjob.infra.common.concurrent;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/HostExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/HostExceptionTest.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/HostExceptionTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/HostExceptionTest.java
index cbc370f..ee6730f 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/HostExceptionTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/HostExceptionTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.env;
+package org.apache.shardingsphere.elasticjob.infra.common.env;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/IpUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/IpUtilsTest.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/IpUtilsTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/IpUtilsTest.java
index 53b1181..9deebc7 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/IpUtilsTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/IpUtilsTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.env;
+package org.apache.shardingsphere.elasticjob.infra.common.env;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/TimeServiceTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/TimeServiceTest.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/TimeServiceTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/TimeServiceTest.java
index 3028956..c238d22 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/env/TimeServiceTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/env/TimeServiceTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.env;
+package org.apache.shardingsphere.elasticjob.infra.common.env;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/ExceptionUtilsTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/ExceptionUtilsTest.java
similarity index 95%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/ExceptionUtilsTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/ExceptionUtilsTest.java
index dd95696..6e899e4 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/ExceptionUtilsTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/ExceptionUtilsTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
import org.junit.Test;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobConfigurationExceptionTest.java
old mode 100755
new mode 100644
similarity index 94%
rename from elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationExceptionTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobConfigurationExceptionTest.java
index c54d11f..9bd9fe8
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobConfigurationExceptionTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobConfigurationExceptionTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
import org.junit.Test;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobExecutionEnvironmentExceptionTest.java
old mode 100755
new mode 100644
similarity index 93%
rename from elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentExceptionTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobExecutionEnvironmentExceptionTest.java
index 8a1468e..2a17f44
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobExecutionEnvironmentExceptionTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobExecutionEnvironmentExceptionTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
import org.junit.Test;
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobStatisticExceptionTest.java
old mode 100755
new mode 100644
similarity index 93%
rename from elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticExceptionTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobStatisticExceptionTest.java
index c9f3869..4bd33e6
--- a/elasticjob-cloud/elasticjob-cloud-common/src/test/java/org/apache/shardingsphere/elasticjob/cloud/exception/JobStatisticExceptionTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobStatisticExceptionTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
import org.junit.Test;
@@ -28,5 +28,4 @@ public class JobStatisticExceptionTest {
public void assertGetCause() {
assertThat(new JobStatisticException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class));
}
-
}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobSystemExceptionTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobSystemExceptionTest.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobSystemExceptionTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobSystemExceptionTest.java
index 676e5d3..db5b2b0 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobSystemExceptionTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/exception/JobSystemExceptionTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.exception;
+package org.apache.shardingsphere.elasticjob.infra.common.exception;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/json/GsonFactoryTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/json/GsonFactoryTest.java
similarity index 96%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/json/GsonFactoryTest.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/json/GsonFactoryTest.java
index f3ac07c..3d1feec 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/json/GsonFactoryTest.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/json/GsonFactoryTest.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.util.json;
+package org.apache.shardingsphere.elasticjob.infra.common.json;
import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
diff --git a/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/YamlEngineTest.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/YamlEngineTest.java
new file mode 100644
index 0000000..7300807
--- /dev/null
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/YamlEngineTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.elasticjob.infra.common.yaml;
+
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.fixture.FooYamlConfiguration;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+
+public final class YamlEngineTest {
+
+ private static final String YAML = "bar: bar\nfoo: foo\n";
+
+ private static final String YAML_WITH_NULL = "foo: foo\n";
+
+ @Test
+ public void assertMarshal() {
+ FooYamlConfiguration actual = new FooYamlConfiguration();
+ actual.setFoo("foo");
+ actual.setBar("bar");
+ assertThat(YamlEngine.marshal(actual), is(YAML));
+ }
+
+ @Test
+ public void assertMarshalWithNullValue() {
+ FooYamlConfiguration actual = new FooYamlConfiguration();
+ actual.setFoo("foo");
+ assertThat(YamlEngine.marshal(actual), is(YAML_WITH_NULL));
+ }
+
+ @Test
+ public void assertUnmarshal() {
+ FooYamlConfiguration actual = YamlEngine.unmarshal(YAML, FooYamlConfiguration.class);
+ assertThat(actual.getFoo(), is("foo"));
+ assertThat(actual.getBar(), is("bar"));
+ }
+
+ @Test
+ public void assertUnmarshalWithNullValue() {
+ FooYamlConfiguration actual = YamlEngine.unmarshal(YAML_WITH_NULL, FooYamlConfiguration.class);
+ assertThat(actual.getFoo(), is("foo"));
+ assertNull(actual.getBar());
+ }
+}
diff --git a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeService.java b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/fixture/FooYamlConfiguration.java
old mode 100755
new mode 100644
similarity index 73%
rename from elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeService.java
rename to elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/fixture/FooYamlConfiguration.java
index d8fc2c7..e17db7c
--- a/elasticjob-cloud/elasticjob-cloud-common/src/main/java/org/apache/shardingsphere/elasticjob/cloud/util/env/TimeService.java
+++ b/elasticjob-infra/elasticjob-infra-common/src/test/java/org/apache/shardingsphere/elasticjob/infra/common/yaml/fixture/FooYamlConfiguration.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,19 +15,16 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.cloud.util.env;
+package org.apache.shardingsphere.elasticjob.infra.common.yaml.fixture;
-/**
- * Time service.
- */
-public final class TimeService {
+import lombok.Getter;
+import lombok.Setter;
- /**
- * Get current millis.
- *
- * @return current millis
- */
- public long getCurrentMillis() {
- return System.currentTimeMillis();
- }
+@Getter
+@Setter
+public final class FooYamlConfiguration {
+
+ private String foo;
+
+ private String bar;
}
diff --git a/elasticjob-infra/elasticjob-registry-center/pom.xml b/elasticjob-infra/elasticjob-registry-center/pom.xml
index 0e07a80..2e49966 100644
--- a/elasticjob-infra/elasticjob-registry-center/pom.xml
+++ b/elasticjob-infra/elasticjob-registry-center/pom.xml
@@ -32,7 +32,6 @@
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
- <version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
diff --git a/elasticjob-infra/pom.xml b/elasticjob-infra/pom.xml
index 61f84ba..937bddf 100644
--- a/elasticjob-infra/pom.xml
+++ b/elasticjob-infra/pom.xml
@@ -30,6 +30,7 @@
<name>${project.artifactId}</name>
<modules>
+ <module>elasticjob-infra-common</module>
<module>elasticjob-registry-center</module>
<module>elasticjob-tracing</module>
</modules>
diff --git a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/config/advice/ConsoleRestControllerAdvice.java b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/config/advice/ConsoleRestControllerAdvice.java
index 4c6a827..de85211 100644
--- a/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/config/advice/ConsoleRestControllerAdvice.java
+++ b/elasticjob-lite/elasticjob-lite-console/src/main/java/org/apache/shardingsphere/elasticjob/lite/console/config/advice/ConsoleRestControllerAdvice.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.console.config.advice;
import lombok.extern.slf4j.Slf4j;
-import org.apache.shardingsphere.elasticjob.lite.exception.ExceptionUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.ExceptionUtils;
import org.springframework.core.MethodParameter;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
diff --git a/elasticjob-lite/elasticjob-lite-core/pom.xml b/elasticjob-lite/elasticjob-lite-core/pom.xml
index 1895980..a8e88d2 100644
--- a/elasticjob-lite/elasticjob-lite-core/pom.xml
+++ b/elasticjob-lite/elasticjob-lite-core/pom.xml
@@ -33,6 +33,11 @@
</dependency>
<dependency>
<groupId>org.apache.shardingsphere.elasticjob</groupId>
+ <artifactId>elasticjob-infra-common</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere.elasticjob</groupId>
<artifactId>elasticjob-registry-center</artifactId>
<version>${project.parent.version}</version>
</dependency>
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java
index aaadde5..a024fe6 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/api/listener/AbstractDistributeOnceElasticJobListener.java
@@ -19,11 +19,11 @@ package org.apache.shardingsphere.elasticjob.lite.api.listener;
import java.util.Set;
import lombok.Setter;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.lite.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
-import org.apache.shardingsphere.elasticjob.lite.util.env.TimeService;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.TimeService;
/**
* Distributed once elasticjob listener.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/AppConfigurationException.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/AppConfigurationException.java
deleted file mode 100644
index 9b05d34..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/AppConfigurationException.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.lite.exception;
-
-/**
- * Application configuration exception.
- */
-public final class AppConfigurationException extends RuntimeException {
-
- private static final long serialVersionUID = -1466479389299512371L;
-
- public AppConfigurationException(final String errorMessage, final Object... args) {
- super(String.format(errorMessage, args));
- }
-
- public AppConfigurationException(final Throwable cause) {
- super(cause);
- }
-}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobConfigurationException.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobConfigurationException.java
deleted file mode 100644
index 88cc470..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobConfigurationException.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.lite.exception;
-
-/**
- * Job configuration exception.
- */
-public final class JobConfigurationException extends RuntimeException {
-
- private static final long serialVersionUID = 3244988974343209468L;
-
- public JobConfigurationException(final String errorMessage, final Object... args) {
- super(String.format(errorMessage, args));
- }
-
- public JobConfigurationException(final Throwable cause) {
- super(cause);
- }
-}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobStatisticException.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobStatisticException.java
deleted file mode 100644
index 3cddb40..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/exception/JobStatisticException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.lite.exception;
-
-/**
- * Job statistic exception.
- */
-public final class JobStatisticException extends RuntimeException {
-
- private static final long serialVersionUID = -2502533914008085601L;
-
- public JobStatisticException(final Exception ex) {
- super(ex);
- }
-}
diff --git a/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 3814f39..aaebcdc 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
@@ -21,15 +21,15 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.api.listener.ElasticJobListener;
-import org.apache.shardingsphere.elasticjob.lite.exception.ExceptionUtils;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.ExceptionUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutor;
import org.apache.shardingsphere.elasticjob.lite.executor.item.JobItemExecutorFactory;
import org.apache.shardingsphere.elasticjob.lite.handler.error.JobErrorHandler;
import org.apache.shardingsphere.elasticjob.lite.handler.error.JobErrorHandlerFactory;
import org.apache.shardingsphere.elasticjob.lite.handler.threadpool.JobExecutorServiceHandlerFactory;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.LiteJobFacade;
-import org.apache.shardingsphere.elasticjob.lite.util.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.tracing.api.TracingConfiguration;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
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 2096838..ab615fe 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
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.executor;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.tracing.event.JobExecutionEvent;
import org.apache.shardingsphere.elasticjob.tracing.event.JobStatusTraceEvent.State;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactory.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactory.java
index 9bea827..9da00fc 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactory.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactory.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.executor.item;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.ClassedJobItemExecutor;
import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.TypedJobItemExecutor;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactory.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactory.java
index 95b9eaf..dfb830d 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactory.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactory.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.handler.error;
import com.google.common.base.Strings;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import java.util.LinkedHashMap;
import java.util.Map;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandler.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandler.java
index 91e5e5d..04f7900 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandler.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandler.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.handler.error.impl;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.lite.handler.error.JobErrorHandler;
/**
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstance.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstance.java
index ce24d5b..0527c5d 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstance.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstance.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.handler.sharding;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.util.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
import java.lang.management.ManagementFactory;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactory.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactory.java
index 571c65f..9ba8d98 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactory.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactory.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.handler.sharding;
import com.google.common.base.Strings;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import java.util.LinkedHashMap;
import java.util.Map;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactory.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactory.java
index 47e881d..352ecea 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactory.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactory.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.handler.threadpool;
import com.google.common.base.Strings;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import java.util.LinkedHashMap;
import java.util.Map;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java
index dc76317..3791238 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/impl/AbstractJobExecutorServiceHandler.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.handler.threadpool.impl;
import java.util.concurrent.ExecutorService;
import org.apache.shardingsphere.elasticjob.lite.handler.threadpool.JobExecutorServiceHandler;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.ElasticJobExecutorService;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.ElasticJobExecutorService;
/**
* Abstract job executor service handler.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
index 3fad3c6..a9e89eb 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationService.java
@@ -18,13 +18,13 @@
package org.apache.shardingsphere.elasticjob.lite.internal.config;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.env.TimeService;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.env.TimeService;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
/**
* Configuration service.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManager.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManager.java
index a8d63f0..2f178f1 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManager.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/config/RescheduleListenerManager.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractJobLi
import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
/**
* Reschedule listener manager.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderService.java
index be09e84..15aa003 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderService.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/election/LeaderService.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerService;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.LeaderExecutionCallback;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
/**
* Leader service.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java
index 900f3c0..7b333c6 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/failover/FailoverListenerManager.java
@@ -28,7 +28,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListe
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.sharding.ShardingService;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
import java.util.List;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleController.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleController.java
index 48c7470..802b814 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleController.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleController.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.internal.schedule;
import lombok.RequiredArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.quartz.CronScheduleBuilder;
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
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 f976104..2e9166a 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
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.api.listener.AbstractDistributeOnceElasticJobListener;
import org.apache.shardingsphere.elasticjob.lite.api.listener.ElasticJobListener;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
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;
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 92a0fad..4d685eb 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
@@ -22,7 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.elasticjob.lite.api.listener.ElasticJobListener;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.context.TaskContext;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
import org.apache.shardingsphere.elasticjob.lite.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNode.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNode.java
index 090b3f9..72322e5 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNode.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerNode.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.server;
import org.apache.shardingsphere.elasticjob.lite.handler.sharding.JobInstance;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath;
-import org.apache.shardingsphere.elasticjob.lite.util.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
import java.util.Objects;
import java.util.regex.Pattern;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java
index 320a09a..b428d80 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/server/ServerService.java
@@ -22,7 +22,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.instance.InstanceNode;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import java.util.List;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextService.java
index 03fea9d..a8ac009 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextService.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ExecutionContextService.java
@@ -25,7 +25,6 @@ import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationSe
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.config.ShardingItemParameters;
import java.util.ArrayList;
import java.util.Collections;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManager.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManager.java
index 4ca1cb5..c344847 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManager.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/MonitorExecutionListenerManager.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobCon
import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractJobListener;
import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListenerManager;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
/**
* Monitor execution listener manager.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemParameters.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingItemParameters.java
similarity index 94%
rename from elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemParameters.java
rename to elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingItemParameters.java
index 1c0768c..39d1365 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemParameters.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingItemParameters.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.util.config;
+package org.apache.shardingsphere.elasticjob.lite.internal.sharding;
import com.google.common.base.Strings;
import lombok.AllArgsConstructor;
import lombok.Getter;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import java.util.Collections;
import java.util.HashMap;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManager.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManager.java
index 790caf2..e0170f5 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManager.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingListenerManager.java
@@ -26,7 +26,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.listener.AbstractListe
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerNode;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
/**
* Sharding listener manager.
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingService.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingService.java
index 1898d4c..2312d8f 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingService.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingService.java
@@ -31,7 +31,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.TransactionExecutionCallback;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.curator.framework.api.transaction.CuratorTransactionFinal;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java
index 526d835..d573c05 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/storage/JobNodeStorage.java
@@ -23,7 +23,7 @@ import org.apache.curator.framework.recipes.cache.TreeCache;
import org.apache.curator.framework.recipes.cache.TreeCacheListener;
import org.apache.curator.framework.recipes.leader.LeaderLatch;
import org.apache.curator.framework.state.ConnectionStateListener;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtils.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtils.java
index 5afa8ec..e503a91 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtils.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/internal/util/SensitiveInfoUtils.java
@@ -20,7 +20,7 @@ package org.apache.shardingsphere.elasticjob.lite.internal.util;
import com.google.common.base.Joiner;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.util.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
import java.util.HashMap;
import java.util.List;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItems.java b/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItems.java
deleted file mode 100644
index c0cb080..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/main/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItems.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.lite.util.config;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Strings;
-import lombok.Getter;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Sharding items.
- */
-@Getter
-public final class ShardingItems {
-
- private static final String DELIMITER = ",";
-
- /**
- * Get sharding items via string.
- *
- * @param itemsString sharding items string
- * @return sharding items
- */
- public static List<Integer> toItemList(final String itemsString) {
- if (Strings.isNullOrEmpty(itemsString)) {
- return Collections.emptyList();
- }
- String[] items = itemsString.split(DELIMITER);
- List<Integer> result = new ArrayList<>(items.length);
- for (String each : items) {
- int item = Integer.parseInt(each);
- if (!result.contains(item)) {
- result.add(item);
- }
- }
- return result;
- }
-
- /**
- * Get sharding items string.
- *
- * @param items sharding items
- * @return sharding items string
- */
- public static String toItemsString(final List<Integer> items) {
- return items.isEmpty() ? "" : Joiner.on(DELIMITER).join(items);
- }
-}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java
index 1465643..e9e377e 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/api/listener/DistributeOnceElasticJobListenerTest.java
@@ -20,11 +20,11 @@ package org.apache.shardingsphere.elasticjob.lite.api.listener;
import com.google.common.collect.Sets;
import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.ElasticJobListenerCaller;
import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.TestDistributeOnceElasticJobListener;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.lite.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.lite.internal.guarantee.GuaranteeService;
import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils;
-import org.apache.shardingsphere.elasticjob.lite.util.env.TimeService;
+import org.apache.shardingsphere.elasticjob.infra.common.env.TimeService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobConfigurationExceptionTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobConfigurationExceptionTest.java
deleted file mode 100644
index 6b534f3..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobConfigurationExceptionTest.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.lite.exception;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public final class JobConfigurationExceptionTest {
-
- @Test
- public void assertGetMessage() {
- assertThat(new JobConfigurationException("message is: '%s'", "test").getMessage(), is("message is: 'test'"));
- }
-
- @Test
- public void assertGetCause() {
- assertThat(new JobConfigurationException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class));
- }
-}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobExecutionEnvironmentExceptionTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobExecutionEnvironmentExceptionTest.java
deleted file mode 100644
index 2ece625..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobExecutionEnvironmentExceptionTest.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.lite.exception;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public final class JobExecutionEnvironmentExceptionTest {
-
- @Test
- public void assertGetMessage() {
- assertThat(new JobExecutionEnvironmentException("message is: '%s'", "test").getMessage(), is("message is: 'test'"));
- }
-}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobStatisticExceptionTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobStatisticExceptionTest.java
deleted file mode 100644
index 6e2f62b..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/exception/JobStatisticExceptionTest.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.lite.exception;
-
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.junit.Assert.assertThat;
-
-public class JobStatisticExceptionTest {
-
- @Test
- public void assertGetCause() {
- assertThat(new JobStatisticException(new RuntimeException()).getCause(), instanceOf(RuntimeException.class));
- }
-
-}
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 a895ccc..e305eb9 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
@@ -18,8 +18,8 @@
package org.apache.shardingsphere.elasticjob.lite.executor;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.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.reg.base.CoordinatorRegistryCenter;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactoryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactoryTest.java
index 9149486..79b6871 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactoryTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/executor/item/JobItemExecutorFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.executor.item;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.lite.fixture.executor.ClassedFooJobExecutor;
import org.apache.shardingsphere.elasticjob.lite.fixture.executor.TypedFooJobExecutor;
import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactoryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactoryTest.java
index 72f6301..11726b5 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactoryTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/JobErrorHandlerFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.handler.error;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.lite.handler.error.impl.LogJobErrorHandler;
import org.apache.shardingsphere.elasticjob.lite.handler.error.impl.ThrowJobErrorHandler;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandlerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandlerTest.java
index 5a36f81..36e2e46 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandlerTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/error/impl/ThrowJobErrorHandlerTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.handler.error.impl;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.junit.Test;
public final class ThrowJobErrorHandlerTest {
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstanceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstanceTest.java
index 383ddc7..18d9910 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstanceTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobInstanceTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.handler.sharding;
-import org.apache.shardingsphere.elasticjob.lite.util.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactoryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactoryTest.java
index bea93d1..412902f 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactoryTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/sharding/JobShardingStrategyFactoryTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.handler.sharding;
import org.apache.shardingsphere.elasticjob.lite.handler.sharding.impl.AverageAllocationJobShardingStrategy;
import org.apache.shardingsphere.elasticjob.lite.handler.sharding.impl.OdevitySortByNameJobShardingStrategy;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.instanceOf;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java
index b0c68c3..8653c26 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/handler/threadpool/JobExecutorServiceHandlerFactoryTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.handler.threadpool;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.apache.shardingsphere.elasticjob.lite.handler.threadpool.impl.CPUUsageJobExecutorServiceHandler;
import org.apache.shardingsphere.elasticjob.lite.handler.threadpool.impl.SingleThreadJobExecutorServiceHandler;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java
index d5be64a..ebb46d5 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/DisabledJobIntegrateTest.java
@@ -24,9 +24,9 @@ import org.apache.shardingsphere.elasticjob.lite.integrate.BaseIntegrateTest;
import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
-import org.apache.shardingsphere.elasticjob.lite.util.env.IpUtils;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNull;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java
index 83c3f17..bac6dcc 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/OneOffDisabledJobIntegrateTest.java
@@ -18,7 +18,7 @@
package org.apache.shardingsphere.elasticjob.lite.integrate.disable;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import org.junit.Test;
public final class OneOffDisabledJobIntegrateTest extends DisabledJobIntegrateTest {
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java
index 1cb9181..08bbd48 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/disable/ScheduleDisabledJobIntegrateTest.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java
index 4d2858c..c03c87e 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/EnabledJobIntegrateTest.java
@@ -24,8 +24,8 @@ import org.apache.shardingsphere.elasticjob.lite.integrate.BaseIntegrateTest;
import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.lite.internal.server.ServerStatus;
-import org.apache.shardingsphere.elasticjob.lite.util.env.IpUtils;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.env.IpUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
import org.junit.Before;
import static org.hamcrest.CoreMatchers.is;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java
index 586b364..c532905 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/OneOffEnabledJobIntegrateTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.integrate.enable;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java
index b662c2f..2bc7ed1 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/integrate/enable/ScheduleEnabledJobIntegrateTest.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.integrate.enable;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.fixture.job.DetailedFooJob;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java
index c0d8b49..96565f2 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/ConfigurationServiceTest.java
@@ -19,13 +19,13 @@ package org.apache.shardingsphere.elasticjob.lite.internal.config;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.lite.fixture.LiteYamlConstants;
import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobConfiguration;
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodeStorage;
import org.apache.shardingsphere.elasticjob.lite.util.ReflectionUtils;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/yaml/YamlJobConfigurationTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/yaml/YamlJobConfigurationTest.java
index 1fa388e..3e729af 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/yaml/YamlJobConfigurationTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/config/yaml/YamlJobConfigurationTest.java
@@ -18,14 +18,47 @@
package org.apache.shardingsphere.elasticjob.lite.internal.config.yaml;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
public final class YamlJobConfigurationTest {
+ private static final String YAML = "cron: 0/1 * * * * ?\n"
+ + "description: Job description\n"
+ + "disabled: false\n"
+ + "failover: false\n"
+ + "jobErrorHandlerType: IGNORE\n"
+ + "jobExecutorServiceHandlerType: CPU\n"
+ + "jobName: test_job\n"
+ + "jobParameter: param\n"
+ + "jobShardingStrategyType: AVG_ALLOCATION\n"
+ + "maxTimeDiffSeconds: 0\n"
+ + "misfire: false\n"
+ + "monitorExecution: false\n"
+ + "overwrite: false\n"
+ + "props:\n"
+ + " key: value\n"
+ + "reconcileIntervalMinutes: 0\n"
+ + "shardingItemParameters: 0=A,1=B,2=C\n"
+ + "shardingTotalCount: 3\n";
+
+ private static final String YAML_WITH_NULL = "cron: 0/1 * * * * ?\n"
+ + "disabled: false\n"
+ + "failover: false\n"
+ + "jobName: test_job\n"
+ + "maxTimeDiffSeconds: 0\n"
+ + "misfire: false\n"
+ + "monitorExecution: false\n"
+ + "overwrite: false\n"
+ + "reconcileIntervalMinutes: 0\n"
+ + "shardingTotalCount: 3\n";
+
@Test
public void assertToJobConfiguration() {
YamlJobConfiguration yamlJobConfiguration = new YamlJobConfiguration();
@@ -88,4 +121,67 @@ public final class YamlJobConfigurationTest {
assertTrue(actual.isDisabled());
assertTrue(actual.isOverwrite());
}
+
+ @Test
+ public void assertMarshal() {
+ YamlJobConfiguration yamlJobConfiguration = new YamlJobConfiguration();
+ yamlJobConfiguration.setJobName("test_job");
+ yamlJobConfiguration.setCron("0/1 * * * * ?");
+ yamlJobConfiguration.setShardingTotalCount(3);
+ yamlJobConfiguration.setShardingItemParameters("0=A,1=B,2=C");
+ yamlJobConfiguration.setJobParameter("param");
+ yamlJobConfiguration.setJobShardingStrategyType("AVG_ALLOCATION");
+ yamlJobConfiguration.setJobExecutorServiceHandlerType("CPU");
+ yamlJobConfiguration.setJobErrorHandlerType("IGNORE");
+ yamlJobConfiguration.setDescription("Job description");
+ yamlJobConfiguration.getProps().setProperty("key", "value");
+ assertThat(YamlEngine.marshal(yamlJobConfiguration), is(YAML));
+ }
+
+ @Test
+ public void assertMarshalWithNullValue() {
+ YamlJobConfiguration yamlJobConfiguration = new YamlJobConfiguration();
+ yamlJobConfiguration.setJobName("test_job");
+ yamlJobConfiguration.setCron("0/1 * * * * ?");
+ yamlJobConfiguration.setShardingTotalCount(3);
+ assertThat(YamlEngine.marshal(yamlJobConfiguration), is(YAML_WITH_NULL));
+ }
+
+ @Test
+ public void assertUnmarshal() {
+ YamlJobConfiguration yamlJobConfiguration = YamlEngine.unmarshal(YAML, YamlJobConfiguration.class);
+ assertThat(yamlJobConfiguration.getJobName(), is("test_job"));
+ assertThat(yamlJobConfiguration.getCron(), is("0/1 * * * * ?"));
+ assertThat(yamlJobConfiguration.getShardingTotalCount(), is(3));
+ assertThat(yamlJobConfiguration.getShardingItemParameters(), is("0=A,1=B,2=C"));
+ assertThat(yamlJobConfiguration.getJobParameter(), is("param"));
+ assertFalse(yamlJobConfiguration.isMonitorExecution());
+ assertFalse(yamlJobConfiguration.isFailover());
+ assertFalse(yamlJobConfiguration.isMisfire());
+ assertThat(yamlJobConfiguration.getJobShardingStrategyType(), is("AVG_ALLOCATION"));
+ assertThat(yamlJobConfiguration.getJobExecutorServiceHandlerType(), is("CPU"));
+ assertThat(yamlJobConfiguration.getJobErrorHandlerType(), is("IGNORE"));
+ assertThat(yamlJobConfiguration.getDescription(), is("Job description"));
+ assertThat(yamlJobConfiguration.getProps().getProperty("key"), is("value"));
+ }
+
+ @Test
+ public void assertUnmarshalWithNullValue() {
+ YamlJobConfiguration yamlJobConfiguration = YamlEngine.unmarshal(YAML_WITH_NULL, YamlJobConfiguration.class);
+ assertThat(yamlJobConfiguration.getJobName(), is("test_job"));
+ assertThat(yamlJobConfiguration.getCron(), is("0/1 * * * * ?"));
+ assertThat(yamlJobConfiguration.getShardingTotalCount(), is(3));
+ assertNull(yamlJobConfiguration.getShardingItemParameters());
+ assertNull(yamlJobConfiguration.getJobParameter());
+ assertFalse(yamlJobConfiguration.isMonitorExecution());
+ assertFalse(yamlJobConfiguration.isFailover());
+ assertFalse(yamlJobConfiguration.isMisfire());
+ assertNull(yamlJobConfiguration.getJobShardingStrategyType());
+ assertNull(yamlJobConfiguration.getJobExecutorServiceHandlerType());
+ assertNull(yamlJobConfiguration.getJobErrorHandlerType());
+ assertNull(yamlJobConfiguration.getDescription());
+ assertTrue(yamlJobConfiguration.getProps().isEmpty());
+ assertFalse(yamlJobConfiguration.isDisabled());
+ assertFalse(yamlJobConfiguration.isOverwrite());
+ }
}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java
index 23236f9..465eb11 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/schedule/JobScheduleControllerTest.java
@@ -17,7 +17,7 @@
package org.apache.shardingsphere.elasticjob.lite.internal.schedule;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
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 a40de05..c557936 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
@@ -21,7 +21,7 @@ import com.google.common.collect.Lists;
import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.ElasticJobListenerCaller;
import org.apache.shardingsphere.elasticjob.lite.api.listener.fixture.TestElasticJobListener;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobExecutionEnvironmentException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobExecutionEnvironmentException;
import org.apache.shardingsphere.elasticjob.lite.executor.ShardingContexts;
import org.apache.shardingsphere.elasticjob.lite.internal.config.ConfigurationService;
import org.apache.shardingsphere.elasticjob.lite.internal.failover.FailoverService;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemParametersTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingItemParametersTest.java
similarity index 91%
rename from elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemParametersTest.java
rename to elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingItemParametersTest.java
index cbe818d..f8586ee 100644
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemParametersTest.java
+++ b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/internal/sharding/ShardingItemParametersTest.java
@@ -7,7 +7,7 @@
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,9 +15,9 @@
* limitations under the License.
*/
-package org.apache.shardingsphere.elasticjob.lite.util.config;
+package org.apache.shardingsphere.elasticjob.lite.internal.sharding;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
import org.junit.Test;
import java.util.Collections;
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemsTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemsTest.java
deleted file mode 100644
index b0ce6a8..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/config/ShardingItemsTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.lite.util.config;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.Collections;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public final class ShardingItemsTest {
-
- @Test
- public void assertTtoItemListWhenNull() {
- assertThat(ShardingItems.toItemList(null), is(Collections.EMPTY_LIST));
- }
-
- @Test
- public void assertToItemListWhenEmpty() {
- assertThat(ShardingItems.toItemList(""), is(Collections.EMPTY_LIST));
- }
-
- @Test
- public void assertToItemList() {
- assertThat(ShardingItems.toItemList("0,1,2"), is(Arrays.asList(0, 1, 2)));
- }
-
- @Test
- public void assertToItemListForDuplicated() {
- assertThat(ShardingItems.toItemList("0,1,2,2"), is(Arrays.asList(0, 1, 2)));
- }
-
- @Test
- public void assertToItemsStringWhenEmpty() {
- assertThat(ShardingItems.toItemsString(Collections.emptyList()), is(""));
- }
-
- @Test
- public void assertToItemsString() {
- assertThat(ShardingItems.toItemsString(Arrays.asList(0, 1, 2)), is("0,1,2"));
- }
-}
diff --git a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/YamlEngineTest.java b/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/YamlEngineTest.java
deleted file mode 100644
index 151d879..0000000
--- a/elasticjob-lite/elasticjob-lite-core/src/test/java/org/apache/shardingsphere/elasticjob/lite/util/yaml/YamlEngineTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.elasticjob.lite.util.yaml;
-
-import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobConfiguration;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public final class YamlEngineTest {
-
- private static final String YAML = "cron: 0/1 * * * * ?\n"
- + "description: Job description\n"
- + "disabled: false\n"
- + "failover: false\n"
- + "jobErrorHandlerType: IGNORE\n"
- + "jobExecutorServiceHandlerType: CPU\n"
- + "jobName: test_job\n"
- + "jobParameter: param\n"
- + "jobShardingStrategyType: AVG_ALLOCATION\n"
- + "maxTimeDiffSeconds: 0\n"
- + "misfire: false\n"
- + "monitorExecution: false\n"
- + "overwrite: false\n"
- + "props:\n"
- + " key: value\n"
- + "reconcileIntervalMinutes: 0\n"
- + "shardingItemParameters: 0=A,1=B,2=C\n"
- + "shardingTotalCount: 3\n";
-
- private static final String YAML_WITH_NULL = "cron: 0/1 * * * * ?\n"
- + "disabled: false\n"
- + "failover: false\n"
- + "jobName: test_job\n"
- + "maxTimeDiffSeconds: 0\n"
- + "misfire: false\n"
- + "monitorExecution: false\n"
- + "overwrite: false\n"
- + "reconcileIntervalMinutes: 0\n"
- + "shardingTotalCount: 3\n";
-
- @Test
- public void assertMarshal() {
- YamlJobConfiguration yamlJobConfiguration = new YamlJobConfiguration();
- yamlJobConfiguration.setJobName("test_job");
- yamlJobConfiguration.setCron("0/1 * * * * ?");
- yamlJobConfiguration.setShardingTotalCount(3);
- yamlJobConfiguration.setShardingItemParameters("0=A,1=B,2=C");
- yamlJobConfiguration.setJobParameter("param");
- yamlJobConfiguration.setJobShardingStrategyType("AVG_ALLOCATION");
- yamlJobConfiguration.setJobExecutorServiceHandlerType("CPU");
- yamlJobConfiguration.setJobErrorHandlerType("IGNORE");
- yamlJobConfiguration.setDescription("Job description");
- yamlJobConfiguration.getProps().setProperty("key", "value");
- assertThat(YamlEngine.marshal(yamlJobConfiguration), is(YAML));
- }
-
- @Test
- public void assertMarshalWithNullValue() {
- YamlJobConfiguration yamlJobConfiguration = new YamlJobConfiguration();
- yamlJobConfiguration.setJobName("test_job");
- yamlJobConfiguration.setCron("0/1 * * * * ?");
- yamlJobConfiguration.setShardingTotalCount(3);
- assertThat(YamlEngine.marshal(yamlJobConfiguration), is(YAML_WITH_NULL));
- }
-
- @Test
- public void assertUnmarshal() {
- YamlJobConfiguration yamlJobConfiguration = YamlEngine.unmarshal(YAML, YamlJobConfiguration.class);
- assertThat(yamlJobConfiguration.getJobName(), is("test_job"));
- assertThat(yamlJobConfiguration.getCron(), is("0/1 * * * * ?"));
- assertThat(yamlJobConfiguration.getShardingTotalCount(), is(3));
- assertThat(yamlJobConfiguration.getShardingItemParameters(), is("0=A,1=B,2=C"));
- assertThat(yamlJobConfiguration.getJobParameter(), is("param"));
- assertFalse(yamlJobConfiguration.isMonitorExecution());
- assertFalse(yamlJobConfiguration.isFailover());
- assertFalse(yamlJobConfiguration.isMisfire());
- assertThat(yamlJobConfiguration.getJobShardingStrategyType(), is("AVG_ALLOCATION"));
- assertThat(yamlJobConfiguration.getJobExecutorServiceHandlerType(), is("CPU"));
- assertThat(yamlJobConfiguration.getJobErrorHandlerType(), is("IGNORE"));
- assertThat(yamlJobConfiguration.getDescription(), is("Job description"));
- assertThat(yamlJobConfiguration.getProps().getProperty("key"), is("value"));
- }
-
- @Test
- public void assertUnmarshalWithNullValue() {
- YamlJobConfiguration yamlJobConfiguration = YamlEngine.unmarshal(YAML_WITH_NULL, YamlJobConfiguration.class);
- assertThat(yamlJobConfiguration.getJobName(), is("test_job"));
- assertThat(yamlJobConfiguration.getCron(), is("0/1 * * * * ?"));
- assertThat(yamlJobConfiguration.getShardingTotalCount(), is(3));
- assertNull(yamlJobConfiguration.getShardingItemParameters());
- assertNull(yamlJobConfiguration.getJobParameter());
- assertFalse(yamlJobConfiguration.isMonitorExecution());
- assertFalse(yamlJobConfiguration.isFailover());
- assertFalse(yamlJobConfiguration.isMisfire());
- assertNull(yamlJobConfiguration.getJobShardingStrategyType());
- assertNull(yamlJobConfiguration.getJobExecutorServiceHandlerType());
- assertNull(yamlJobConfiguration.getJobErrorHandlerType());
- assertNull(yamlJobConfiguration.getDescription());
- assertTrue(yamlJobConfiguration.getProps().isEmpty());
- assertFalse(yamlJobConfiguration.isDisabled());
- assertFalse(yamlJobConfiguration.isOverwrite());
- }
-}
diff --git a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/executor/ScriptJobExecutor.java b/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/executor/ScriptJobExecutor.java
index f394ae7..f11b010 100644
--- a/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/executor/ScriptJobExecutor.java
+++ b/elasticjob-lite/elasticjob-lite-executor/elasticjob-lite-script-executor/src/main/java/org/apache/shardingsphere/elasticjob/lite/script/executor/ScriptJobExecutor.java
@@ -23,12 +23,12 @@ import org.apache.commons.exec.DefaultExecutor;
import org.apache.shardingsphere.elasticjob.api.ElasticJob;
import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
import org.apache.shardingsphere.elasticjob.api.ShardingContext;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobConfigurationException;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobConfigurationException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.apache.shardingsphere.elasticjob.lite.executor.JobFacade;
import org.apache.shardingsphere.elasticjob.lite.executor.item.impl.TypedJobItemExecutor;
import org.apache.shardingsphere.elasticjob.lite.script.props.ScriptJobProperties;
-import org.apache.shardingsphere.elasticjob.lite.util.json.GsonFactory;
+import org.apache.shardingsphere.elasticjob.infra.common.json.GsonFactory;
import java.io.IOException;
import java.util.Properties;
diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImpl.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImpl.java
index d738f1d..130da57 100644
--- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImpl.java
+++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/settings/JobConfigurationAPIImpl.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.config.yaml.YamlJobCon
import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath;
import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobConfigurationAPI;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
/**
* Job Configuration API implementation class.
diff --git a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImpl.java b/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImpl.java
index a9f3fff..afae51f 100644
--- a/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImpl.java
+++ b/elasticjob-lite/elasticjob-lite-lifecycle/src/main/java/org/apache/shardingsphere/elasticjob/lite/lifecycle/internal/statistics/JobStatisticsAPIImpl.java
@@ -24,7 +24,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.storage.JobNodePath;
import org.apache.shardingsphere.elasticjob.lite.lifecycle.api.JobStatisticsAPI;
import org.apache.shardingsphere.elasticjob.lite.lifecycle.domain.JobBriefInfo;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
-import org.apache.shardingsphere.elasticjob.lite.util.yaml.YamlEngine;
+import org.apache.shardingsphere.elasticjob.infra.common.yaml.YamlEngine;
import java.util.ArrayList;
import java.util.Collection;
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/job/util/AopTargetUtils.java b/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/job/util/AopTargetUtils.java
index 4ccbfc0..e7b90c9 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/job/util/AopTargetUtils.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/main/java/org/apache/shardingsphere/elasticjob/lite/spring/job/util/AopTargetUtils.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.job.util;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.elasticjob.lite.exception.JobSystemException;
+import org.apache.shardingsphere.elasticjob.infra.common.exception.JobSystemException;
import org.springframework.aop.framework.AdvisedSupport;
import org.springframework.aop.support.AopUtils;
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/AbstractJobSpringIntegrateTest.java b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/AbstractJobSpringIntegrateTest.java
index cd915db..96e49b8 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/AbstractJobSpringIntegrateTest.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/AbstractJobSpringIntegrateTest.java
@@ -23,7 +23,7 @@ import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.lite.spring.fixture.job.DataflowElasticJob;
import org.apache.shardingsphere.elasticjob.lite.spring.fixture.job.FooSimpleElasticJob;
import org.apache.shardingsphere.elasticjob.lite.spring.test.AbstractZookeeperJUnit4SpringContextTests;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/JobSpringNamespaceWithRefTest.java b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/JobSpringNamespaceWithRefTest.java
index f0d192f..9396096 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/JobSpringNamespaceWithRefTest.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/job/JobSpringNamespaceWithRefTest.java
@@ -21,7 +21,7 @@ import org.apache.shardingsphere.elasticjob.lite.internal.schedule.JobRegistry;
import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
import org.apache.shardingsphere.elasticjob.lite.spring.fixture.job.ref.RefFooSimpleElasticJob;
import org.apache.shardingsphere.elasticjob.lite.spring.test.AbstractZookeeperJUnit4SpringContextTests;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/test/EmbedZookeeperTestExecutionListener.java b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/test/EmbedZookeeperTestExecutionListener.java
index 2e28f20..2e39356 100644
--- a/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/test/EmbedZookeeperTestExecutionListener.java
+++ b/elasticjob-lite/elasticjob-lite-spring/src/test/java/org/apache/shardingsphere/elasticjob/lite/spring/test/EmbedZookeeperTestExecutionListener.java
@@ -19,7 +19,7 @@ package org.apache.shardingsphere.elasticjob.lite.spring.test;
import org.apache.curator.test.TestingServer;
import org.apache.shardingsphere.elasticjob.reg.exception.RegExceptionHandler;
-import org.apache.shardingsphere.elasticjob.lite.util.concurrent.BlockUtils;
+import org.apache.shardingsphere.elasticjob.infra.common.concurrent.BlockUtils;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.support.AbstractTestExecutionListener;